consistent asm stuffs
This commit is contained in:
parent
51299f33bc
commit
d34374858d
|
@ -1,2 +1,11 @@
|
||||||
|
(define a 12)
|
||||||
|
|
||||||
|
; maps fairly directly to the `htasm` assembler
|
||||||
(asm
|
(asm
|
||||||
(li64 r1 0))
|
; zero here might be replaced with a variable
|
||||||
|
(li64 r1 0)
|
||||||
|
; like so
|
||||||
|
(li64 r2 a))
|
||||||
|
|
||||||
|
; create a ptr to a
|
||||||
|
(ptr-to a)
|
|
@ -1,13 +1,14 @@
|
||||||
|
|
||||||
(define log
|
(define log
|
||||||
(lambda (level message)
|
(lambda (level message)
|
||||||
(
|
(
|
||||||
(append (message level))
|
(append (message level))
|
||||||
|
(define ptr-to-message (ptr-to message))
|
||||||
|
(define length-of-message (length message))
|
||||||
(asm
|
(asm
|
||||||
(set-register r1 3)
|
(li64 r1 3)
|
||||||
(set-register r2 1)
|
(li64 r2 1)
|
||||||
(set-register r3 (ptr-to message))
|
(li64 r3 ptr-to-message)
|
||||||
(set-register r4 (+ 1 (length message)))
|
(li64 r4 length-of-message)
|
||||||
(eca)))))
|
(eca)))))
|
||||||
|
|
||||||
(define error (lambda (message) (log 0 message)))
|
(define error (lambda (message) (log 0 message)))
|
||||||
|
|
Loading…
Reference in a new issue