load int maybe?

This commit is contained in:
Mark Canlas 2022-09-27 10:13:43 -04:00
parent e7432eb5aa
commit 4acceeb146
3 changed files with 6 additions and 5 deletions

View File

@ -1,8 +1,9 @@
package com.htmlism.scratchpad
trait Load[A]:
// TODO genericize to take in encoder
// from constant
def init: String
def loadInt: String
// from register
def from: String

View File

@ -15,7 +15,7 @@ object Register:
object A:
given loadA: Load[A] with
def init: String =
def loadInt: String =
"LDA"
def from: String =
@ -29,7 +29,7 @@ object Register:
object X:
given loadX: Load[X] with
def init: String =
def loadInt: String =
"LDX"
def from: String =
@ -43,7 +43,7 @@ object Register:
object Y:
given loadY: Load[Y] with
def init: String =
def loadInt: String =
"LDY"
def from: String =

View File

@ -14,7 +14,7 @@ package object syntax:
summon[Register[C]].self
val loadInstruction =
Load[C].init // TODO load action needs to interact with encoder
Load[C].loadInt // TODO load action needs to interact with encoder
val storeInstruction =
Store[C].to // TODO store action needs to interact with encoder