mirror of
https://github.com/mcanlas/6502-opcodes.git
synced 2024-12-23 01:29:47 +00:00
move stub
This commit is contained in:
parent
afe83c04dd
commit
0cdfef323f
@ -0,0 +1,4 @@
|
|||||||
|
package com.htmlism.scratchpad
|
||||||
|
|
||||||
|
// anything can be encoded as a byte
|
||||||
|
trait ByteLike[A] {}
|
@ -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
|
||||||
|
14
scratchpad/src/main/scala/com/htmlism/scratchpad/Move.scala
Normal file
14
scratchpad/src/main/scala/com/htmlism/scratchpad/Move.scala
Normal 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(""))
|
@ -0,0 +1,3 @@
|
|||||||
|
package com.htmlism.scratchpad
|
||||||
|
|
||||||
|
trait ReadLease[A] {}
|
@ -0,0 +1,4 @@
|
|||||||
|
package com.htmlism.scratchpad
|
||||||
|
|
||||||
|
// anything can be encoded as a word (two bytes)
|
||||||
|
trait WordLike[A] {}
|
@ -0,0 +1,3 @@
|
|||||||
|
package com.htmlism.scratchpad
|
||||||
|
|
||||||
|
trait WriteLease[A] {}
|
@ -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
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user