more examples
This commit is contained in:
parent
30bdd44ba5
commit
51299f33bc
2
examples/asm.lisp
Normal file
2
examples/asm.lisp
Normal file
|
@ -0,0 +1,2 @@
|
||||||
|
(asm
|
||||||
|
(li64 r1 0))
|
19
examples/log.lisp
Normal file
19
examples/log.lisp
Normal file
|
@ -0,0 +1,19 @@
|
||||||
|
|
||||||
|
(define log
|
||||||
|
(lambda (level message)
|
||||||
|
(
|
||||||
|
(append (message level))
|
||||||
|
(asm
|
||||||
|
(set-register r1 3)
|
||||||
|
(set-register r2 1)
|
||||||
|
(set-register r3 (ptr-to message))
|
||||||
|
(set-register r4 (+ 1 (length message)))
|
||||||
|
(eca)))))
|
||||||
|
|
||||||
|
(define error (lambda (message) (log 0 message)))
|
||||||
|
(define warn (lambda (message) (log 1 message)))
|
||||||
|
(define info (lambda (message) (log 2 message)))
|
||||||
|
(define debug (lambda (message) (log 3 message)))
|
||||||
|
(define trace (lambda (message) (log 4 message)))
|
||||||
|
|
||||||
|
(info "Logger works.")
|
Loading…
Reference in a new issue