[DCPU-16]Hello World

Jul 8th, 2014
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. ;A Hello World in DCPU-16 1.7
  3. :string
  4. dat "Hello, world!", 0
  6. :readString
  7. set j, [string+i]
  8. ife j, 0
  9. set pc, disp
  10. jsr setChar
  11. add i, 1
  12. set pc, readString
  14. :setChar
  15. bor j, 0xf000
  16. bor j, 0x0000
  17. set [0x3000+i], j
  18. set pc, pop
  20. :disp
  21. set a, 0
  22. set b, 0x3000
  23. hwi 0
  25. ;NOTES
  26. ;-The hardware id of the display may not be 0 in some cases. Set it appropriately for the hwi call
  27. ;-The string given can be anything you want, as long as you leave the 0
  28. ;-The 2 bor calls set the string's color and highlight respectively. You can change these if you want
  29. ;-Screen data is allocated in memory within the range of 0x3000 to 0x3181 (approx.)
  30. ;-The 0 data after the string is used to signify the end, as to tell the CPU when to call the disp subroutine
RAW Paste Data

Adblocker detected! Please consider disabling it...

We've detected AdBlock Plus or some other adblocking software preventing from fully loading.

We don't have any obnoxious sound, or popup ads, we actively block these annoying types of ads!

Please add to your ad blocker whitelist or disable your adblocking software.