move stub

This commit is contained in:
Mark Canlas 2022-11-19 22:29:10 -05:00
parent afe83c04dd
commit 0cdfef323f
7 changed files with 40 additions and 3 deletions

View File

@ -0,0 +1,4 @@
package com.htmlism.scratchpad
// anything can be encoded as a byte
trait ByteLike[A] {}

View File

@ -43,6 +43,11 @@ case class AndThen2[A, B](x: Asm2[A, B], y: Asm2[A, B]) extends Asm2[A, B]:
def xs: List[String] = def xs: List[String] =
x.xs ++ y.xs x.xs ++ y.xs
trait Asm3[A, B, C]:
def xs: List[String]
case class Asm3Instructions[A, B, C](xs: List[String]) extends Asm3[A, B, C]
case class R[A]() case class R[A]()
// TODO needs evidence that it is a storable target of one thing // TODO needs evidence that it is a storable target of one thing

View File

@ -0,0 +1,14 @@
package com.htmlism.scratchpad
// https://mads.atari8.info/mads_eng.html#_mv
object Move:
def const[R: Register, A: WriteLease, X: ByteLike](x: X): Asm2[R, A] =
// TODO freeze this into a data structure or a composition of data structures of load and store
Asm2Instructions(List(""))
def from[R: Register, A: ReadLease, B: WriteLease]: Asm3[R, A, B] =
Asm3Instructions(List(""))
object Word:
def const[R: Register, A: WriteLease, X: WordLike](x: X): Asm2[R, A] =
Asm2Instructions(List(""))

View File

@ -0,0 +1,3 @@
package com.htmlism.scratchpad
trait ReadLease[A] {}

View File

@ -0,0 +1,4 @@
package com.htmlism.scratchpad
// anything can be encoded as a word (two bytes)
trait WordLike[A] {}

View File

@ -0,0 +1,3 @@
package com.htmlism.scratchpad
trait WriteLease[A] {}

View File

@ -3,14 +3,18 @@ package com.htmlism.scratchpad
import weaver._ import weaver._
object MoveSuite extends FunSuite: object MoveSuite extends FunSuite:
test("move constant") { test("TODO move constant") {
success success
} }
test("move register") { test("TODO move register") {
success success
} }
test("move register, indexed") { test("TODO move register, indexed") {
success
}
test("TODO move wide") {
success success
} }