27 lines
735 B
Common Lisp
27 lines
735 B
Common Lisp
((code
|
|
(label main ; 0
|
|
(load-immediate $0 1) ; 6
|
|
(push $0) ; 8
|
|
(load-immediate $0 1) ; 14
|
|
(push $0) ; 16
|
|
(call &add) ; 19
|
|
(pop $0) ; 21
|
|
(int-to-string $1 $0) ; 24
|
|
(load-immediate $3 &terminal-str) ; 30
|
|
(string-length $2 $1) ; 33
|
|
(syscall DEVICE-WRITE $3 $1 $2) ; 41
|
|
(load-immediate $6 &new-line)
|
|
(string-length $7 $6)
|
|
(syscall DEVICE-WRITE $5 $6 $7)
|
|
(halt)) ; 42
|
|
|
|
(label add ; 43
|
|
(pop $0) ; 45
|
|
(pop $1) ; 47
|
|
(add-int $2 $1 $0)
|
|
(push $2)
|
|
(return)))
|
|
(data
|
|
(label terminal-str "/dev/term/0")
|
|
(label new-line "\n")))
|