25 lines
323 B
Plaintext
25 lines
323 B
Plaintext
// PRINT LIBRARY.
|
|
// don't run this as a program as it won't do anything useful.
|
|
|
|
dw display: 0x20000
|
|
|
|
start:
|
|
pop ret // return address
|
|
pop rg0 // length
|
|
pop rg1 // string
|
|
ldw display, rg2
|
|
|
|
loop:
|
|
ldw rg1, acc
|
|
stw acc, rg2
|
|
|
|
dec rg0
|
|
|
|
iadd rg1, 4
|
|
iadd rg2, 4
|
|
|
|
cmp rg0, zero
|
|
jge loop
|
|
|
|
end:
|
|
jmp ret |