feat: add assembler test file
This commit is contained in:
parent
aa0f28cc5e
commit
5ed27903ed
@ -6,7 +6,6 @@
|
||||
(require :host.assembler.opcodes))
|
||||
(local {: any : slice : push : map} (require :deps.lume))
|
||||
(local {: word->byte} (require :host.util))
|
||||
(local {: emulate} (require :host.util.emulator))
|
||||
|
||||
(fn label [name] {:label name})
|
||||
(fn label? [value]
|
||||
@ -39,7 +38,3 @@
|
||||
[move (r 9) (r 3)]
|
||||
[branch (label :label-1)]]
|
||||
0x8000)
|
||||
|
||||
(let [assembly (assemble [[move (r 8) 127]])
|
||||
byte-string (table.concat (map (. assembly :instructions) word->byte) "")]
|
||||
(emulate byte-string))
|
||||
|
||||
@ -1,5 +1,6 @@
|
||||
(local t (require :deps.faith))
|
||||
(local {: r : move} (require :host.assembler.opcodes))
|
||||
|
||||
(fn hex [n]
|
||||
"format a number as 32 bit hexadecimal"
|
||||
(string.format :0x%08x n))
|
||||
|
||||
Loading…
Reference in New Issue
Block a user