mirror of
https://github.com/mcanlas/6502-opcodes.git
synced 2024-12-22 09:30:45 +00:00
store w instruction
This commit is contained in:
parent
021fb3b2e8
commit
159fd422fc
@ -47,5 +47,14 @@ case class R[A]()
|
||||
|
||||
// TODO needs evidence that it is a storable target of one thing
|
||||
case class StoreTo[A: Store, B]() extends Asm2[A, B]:
|
||||
// TODO
|
||||
def xs: List[String] =
|
||||
Nil
|
||||
|
||||
case class LoadImmediate[R: Load, A: ImmediateValue]() extends Asm1[R]:
|
||||
// TODO
|
||||
def xs: List[String] =
|
||||
Nil
|
||||
|
||||
trait ImmediateValue[A]:
|
||||
def toByte(x: A): Int
|
||||
|
@ -19,7 +19,7 @@ object Register:
|
||||
"LDA"
|
||||
|
||||
given storeA: Store[A] with
|
||||
def to: String =
|
||||
def instruction: String =
|
||||
"STA"
|
||||
|
||||
class A
|
||||
@ -30,7 +30,7 @@ object Register:
|
||||
"LDX"
|
||||
|
||||
given storeX: Store[X] with
|
||||
def to: String =
|
||||
def instruction: String =
|
||||
"STX"
|
||||
|
||||
class X
|
||||
@ -41,7 +41,7 @@ object Register:
|
||||
"LDY"
|
||||
|
||||
given storeY: Store[Y] with
|
||||
def to: String =
|
||||
def instruction: String =
|
||||
"STY"
|
||||
|
||||
class Y
|
||||
|
@ -1,7 +1,7 @@
|
||||
package com.htmlism.scratchpad
|
||||
|
||||
trait Store[A]:
|
||||
def to: String
|
||||
def instruction: String
|
||||
|
||||
object Store:
|
||||
def apply[A: Store]: Store[A] =
|
||||
|
@ -20,7 +20,7 @@ package object syntax:
|
||||
Load[R].instruction // TODO load action needs to interact with encoder
|
||||
|
||||
val storeInstruction =
|
||||
Store[R].to // TODO store action needs to interact with encoder
|
||||
Store[R].instruction // TODO store action needs to interact with encoder
|
||||
|
||||
val first =
|
||||
s"$loadInstruction $literal"
|
||||
|
Loading…
Reference in New Issue
Block a user