Jeremy Penner
ccfb52aeaa
65816: support 8-bit immediate mode repl: add re-run and clear buttons ssc: fix returning false from an else clause add byteswap, byte reads / writes start stdlib with memcpy
18 lines
409 B
Fennel
18 lines
409 B
Fennel
(import-macros {:sss ! : compile} :ssc.macros)
|
|
|
|
#(compile $1
|
|
(fn memcpy ((long src) (long dst) count)
|
|
(let (bank (| (hiword dst) (byteswap (hiword src))))
|
|
(asm (lda bank)
|
|
(sta [{:abs #(+ ($1:lookup-addr :inst) 1)}])
|
|
(lda src) (tax)
|
|
(lda dst) (tay)
|
|
(lda count)
|
|
(dec)
|
|
(phb)
|
|
inst
|
|
(mvn 0 0)
|
|
(plb))))
|
|
)
|
|
|