Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ;A Hello World in DCPU-16 1.7
- :string
- dat "Hello, world!", 0
- :readString
- set j, [string+i]
- ife j, 0
- set pc, disp
- jsr setChar
- add i, 1
- set pc, readString
- :setChar
- bor j, 0xf000
- bor j, 0x0000
- set [0x3000+i], j
- set pc, pop
- :disp
- set a, 0
- set b, 0x3000
- hwi 0
- ;NOTES
- ;-The hardware id of the display may not be 0 in some cases. Set it appropriately for the hwi call
- ;-The string given can be anything you want, as long as you leave the 0
- ;-The 2 bor calls set the string's color and highlight respectively. You can change these if you want
- ;-Screen data is allocated in memory within the range of 0x3000 to 0x3181 (approx.)
- ;-The 0 data after the string is used to signify the end, as to tell the CPU when to call the disp subroutine
Advertisement
Add Comment
Please, Sign In to add comment