Clean up test case a little

This commit is contained in:
David Schmenk 2014-05-27 20:43:37 -07:00
parent 5ad39d6897
commit b41e759bc3
2 changed files with 14 additions and 4 deletions

View File

@ -1,5 +1,5 @@
;
; Declare all imported modules and their data/functions.
; Include all imported modules and their data/functions.
;
include(stdlib.plh)
@ -22,7 +22,7 @@ def tens(start)
i = start
repeat
print:hex(i)
puts(@spaces)
print:str(@spaces)
print:dec(i)
print:newln()
i = i / 10

View File

@ -1,14 +1,22 @@
;
; Declare all imported modules and their data/functions.
; Include all imported modules and their data/functions.
;
include(stdlib.plh)
;
; Module data.
;
predef puti, puth, putln
export word print[] = @puti, @puth, @putln
export word print[] = @puti, @puth, @putln, @puts, @putc
byte valstr[] = '0','1','2','3','4','5','6','7','8','9','A','B','C','D','E','F'
byte loadstr[] = "testlib loaded!"
;
; Define functions.
;
def puth(h)
putc('$')
putc(valstr[(h >> 12) & $0F])
@ -16,6 +24,7 @@ def puth(h)
putc(valstr[(h >> 4) & $0F])
putc(valstr[ h & $0F])
end
export def puti(i)
if i < 0
putc('-')
@ -28,6 +37,7 @@ export def puti(i)
putc(i % 10 + '0')
fin
end
export def putln
putc($0D)
end