Comatose-1990

DCPU-32 Bootloader

Sep 22nd, 2013
363
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. REM ####################################
  2. REM ## Install the bootloader
  3. REM ####################################
  4. SET A, 0
  5. SET B, 0x8000
  6. HWI 0
  7.  
  8. SET A, 1
  9. SET B, 0
  10. SET C, loader
  11. HWI 3
  12.  
  13. SET [0x8000], 0x1949
  14. SET [0x8001], 0x196e
  15. SET [0x8002], 0x1973
  16. SET [0x8003], 0x1974
  17. SET [0x8004], 0x1961
  18. SET [0x8005], 0x196c
  19. SET [0x8006], 0x196c
  20. SET [0x8007], 0x1965
  21. SET [0x8008], 0x1964
  22. SET [0x8009], 0x1920
  23. SET [0x800a], 0x1922
  24. SET [0x800b], 0x1920
  25. SET [0x800c], 0x1948
  26. SET [0x800d], 0x1965
  27. SET [0x800e], 0x196c
  28. SET [0x800f], 0x196c
  29. SET [0x8010], 0x196f
  30. SET [0x8011], 0x1920
  31. SET [0x8012], 0x1957
  32. SET [0x8013], 0x196f
  33. SET [0x8014], 0x1972
  34. SET [0x8015], 0x196c
  35. SET [0x8016], 0x1964
  36. SET [0x8017], 0x1921
  37. SET [0x8018], 0x1922
  38. HNG
  39.  
  40. REM ## The bootloader
  41. loader:
  42. SET B, 0x8000
  43. HWI 0
  44.  
  45. REM ## Allow loader to be overridden by compiler
  46. SET C, 0
  47.  
  48. SET [0x8000], 0x1948
  49. SET [0x8001], 0x1965
  50. SET [0x8002], 0x196c
  51. SET [0x8003], 0x196c
  52. SET [0x8004], 0x196f
  53. SET [0x8005], 0x1920
  54. SET [0x8006], 0x1957
  55. SET [0x8007], 0x196f
  56. SET [0x8008], 0x1972
  57. SET [0x8009], 0x196c
  58. SET [0x800a], 0x1964
  59. SET [0x800b], 0x1921
  60. HNG
  61.  
  62. REM ## Bootloader ID
  63. FILL loader, 511
  64. DAT 0x55AA
  65.  
  66.  
  67. REM ####################################
  68. REM ## Remove the bootloader
  69. REM ####################################
  70. SET A, 0
  71. SET B, 0x8000
  72. HWI 0
  73.  
  74. SET A, 1
  75. SET B, 0
  76. SET C, remove
  77. HWI 3
  78.  
  79. SET [0x8000], 0x1955
  80. SET [0x8001], 0x196e
  81. SET [0x8002], 0x1969
  82. SET [0x8003], 0x196e
  83. SET [0x8004], 0x1973
  84. SET [0x8005], 0x1974
  85. SET [0x8006], 0x1961
  86. SET [0x8007], 0x196c
  87. SET [0x8008], 0x196c
  88. SET [0x8009], 0x1965
  89. SET [0x800a], 0x1964
  90. SET [0x800b], 0x1920
  91.  
  92. HNG
  93.  
  94. REM ## Empty sector
  95. remove:
  96. FILL remove, 512
RAW Paste Data