mirror of
https://github.com/mcanlas/6502-opcodes.git
synced 2024-06-01 00:41:36 +00:00
37 lines
701 B
Scala
37 lines
701 B
Scala
package com.htmlism.firepower.core
|
|
|
|
object ScratchPad:
|
|
def reg[A: Reg]: PartialUsing[A] =
|
|
new PartialUsing[A]
|
|
|
|
class PartialUsing[A](using a: Reg[A]):
|
|
def use[B](f: Reg[A] => B): B =
|
|
f(a)
|
|
|
|
//
|
|
// case class Subroutine2[A, B](name: String, f: (Lease[A], Lease[B]) => State2[A, B]) {
|
|
// def jump(a: Lease[A], b: Lease[B]): State[A] =
|
|
// f(a, b)
|
|
// }
|
|
|
|
class Accumulator
|
|
|
|
object Accumulator extends Accumulator:
|
|
given Reg[Accumulator] with
|
|
def hello: Boolean =
|
|
true
|
|
|
|
class RegisterX
|
|
|
|
object RegisterX:
|
|
given Reg[RegisterX] with
|
|
def hello: Boolean =
|
|
true
|
|
|
|
class RegisterY
|
|
|
|
object RegisterY:
|
|
given Reg[RegisterY] with
|
|
def hello: Boolean =
|
|
true
|