6502-opcodes/firepower-core/src/main/scala/com/htmlism/firepower/core/Subroutine.scala
2022-12-07 18:12:49 -05:00

14 lines
400 B
Scala

package com.htmlism.firepower.core
import cats.syntax.all.*
import com.htmlism.firepower.core.AsmBlock._
case class Subroutine(name: String, description: String, intents: () => List[MetaIntent]):
def call: MetaIntent =
MetaIntent.Jump(name, description, intents())
object Subroutine:
def apply(name: String, description: String): Subroutine =
Subroutine(name, description, () => Nil)