Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- hwn i
- :hwloop
- ife i,0
- set pc, begin
- sub i,1
- hwq i
- ife a,0xf615
- ife b,0x7349
- set pc,initDisplay
- set pc,hwloop
- :initDisplay
- set a,0
- set b,[vidMemAddr]
- hwi i
- set [curPos], b
- set pc, hwloop
- :mask
- dat 0x7000
- :begin
- set PUSH, helloWorldStr
- jsr print
- add SP, 1
- set PUSH, testStr2
- jsr print
- add SP, 1
- :infLoop
- jsr cls
- hlt
- :print
- set PUSH, I
- set PUSH, X
- set I, [SP+3]
- set X, [curPos]
- :printLoop
- ife [I], 0
- set PC, endPrintLoop
- ife [I], 13
- set PC, printDoCR
- ife [I], 10
- set PC, printDoLF
- set [X], [I]
- xor [X], [mask]
- add X, 1
- add I, 1
- set PC, printLoop
- :printDoLF
- add X, 32
- add I, 1
- set PC, printLoop
- :printDoCR
- set A, X
- mod A, 32
- sub X, A
- add I, 1
- set PC, printLoop
- :endPrintLoop
- set [curPos], X
- set X, POP
- set I, POP
- set PC, POP
- :cls
- :clear
- set A, [vidMemAddr]
- :clsLoop
- ife A, [curPos]
- set PC, endCls
- set [A], 0
- add A, 1
- set PC, clsLoop
- :endCls
- set [curPos], [vidMemAddr]
- ret
- :vidMemAddr
- dat 0x8000
- :curPos
- dat 0
- :helloWorldStr
- dat "Hello, world!", 13, 10, 0
- :testStr2
- dat "String 2", 0
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement