IT WORKS HELL YEAH.
This commit is contained in:
+16
-19
@@ -1,28 +1,25 @@
|
||||
dw stack: 0x10000
|
||||
dw screen: 0x20000
|
||||
db string: "Dominos sucks!"
|
||||
db string2: 0, 1, 2, 3, 4, 5, 6
|
||||
db length: 14
|
||||
// PRINT LIBRARY.
|
||||
// don't run this as a program as it won't do anything useful.
|
||||
|
||||
init:
|
||||
ldw stack, bpr
|
||||
mov bpr, spr
|
||||
dw display: 0x20000
|
||||
|
||||
start:
|
||||
ldb length, rg0
|
||||
lwi rg1, string
|
||||
lwi rg2, display
|
||||
pop ret // return address
|
||||
pop rg0 // length
|
||||
pop rg1 // string
|
||||
ldw display, rg2
|
||||
|
||||
loop:
|
||||
// read from string and write to display
|
||||
ldb rg1, rg3, rg4
|
||||
stb rg3, rg1, rg4
|
||||
ldw rg1, acc
|
||||
stw acc, rg2
|
||||
|
||||
// increment the offset & decrement the loop counter
|
||||
inc rg4
|
||||
dec rg0
|
||||
|
||||
// if loop counter <= 0 return.
|
||||
cmp rg0, zero,
|
||||
jgt loop
|
||||
iadd rg1, 4
|
||||
iadd rg2, 4
|
||||
|
||||
cmp rg0, zero
|
||||
jge loop
|
||||
|
||||
end:
|
||||
jmp ret
|
||||
Reference in New Issue
Block a user