SHARE
TWEET

weird

a guest Sep 23rd, 2013 169 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. ;----- Start Sequence -----
  2. jsr boot_dev_find
  3. jsr boot_screen_init
  4. jsr boot_stats
  5. set pc, os
  6.  
  7. ;----- Device IDs -----
  8. :dev_screen dat 0xffff
  9. :dev_keyboard dat 0xffff
  10. :dev_clock dat 0xffff
  11. :dev_vector dat 0xffff
  12. :dev_fdd dat 0xffff
  13.  
  14. ;----- Boot -----
  15. :boot_dev_find ;find devs
  16. set push, j
  17. set push, i
  18. set push, a
  19. hwn i
  20. set j, 0x0000
  21. jsr boot_dev_find_loop
  22. set a, pop
  23. set i, pop
  24. set j, pop
  25. set pc, pop
  26. :boot_dev_find_loop
  27. set b, [dev_screen] ; debug
  28. hwq j
  29. ife b, 0x7349
  30. ife a, 0xf615 ;Screen
  31. set [dev_screen], j
  32. ife b, 0x30cf
  33. ife a, 0x7406 ;Keyboard
  34. set [dev_keyboard], j
  35. ife b, 0x12d0
  36. ife a, 0xb402 ;Clock
  37. set [dev_clock], j
  38. ife b, 0x42ba
  39. ife a, 0xbf3c ;Vector Display
  40. set [dev_vector], j
  41. ife b, 0x4fd5
  42. ife a, 0x24c5 ;Floppy Drive
  43. set [dev_fdd], j
  44. ife j, i
  45. set pc, pop
  46. add j, 1
  47. set pc, boot_dev_find_loop
  48.  
  49. :boot_screen_init ;init desplay
  50. set push, a
  51. set push, b
  52. set a, 0
  53. set b, [dev_screen] ; debug
  54. set b, boot_stats_text
  55. hwi [dev_screen]
  56. set b, pop
  57. set a, pop
  58. set pc, pop
  59.  
  60.  
  61. :boot_stats
  62. set push, a
  63. set push, c
  64. set push, i
  65. set push, j
  66. set i, 0
  67. set a, 1 ;for keyboard
  68. ife [boot_stats_text], 0x704D
  69. set pc, boot_stats_loop2
  70.  
  71. :boot_stats_loop
  72. ife i, 0x100 ;8 lines
  73. set pc, boot_stats_loop2_start
  74. bor [boot_stats_text+i], 0x7000
  75. add i, 1
  76. set pc, boot_stats_loop
  77.  
  78. :boot_stats_loop2_start
  79. set push, x
  80. set push, y
  81. jsr boot_stats_scr
  82. jsr boot_stats_key
  83. jsr boot_stats_clock
  84. jsr boot_stats_vec
  85. jsr boot_stats_fdd
  86. set y, pop
  87. set x, pop
  88. set j, 0
  89. :boot_stats_loop2
  90. add j, 1
  91. hwi [dev_keyboard]
  92. ife c, 0
  93. ifl j, 0xD000
  94. set pc, boot_stats_loop2
  95. set j, pop
  96. set i, pop
  97. set c, pop
  98. set a, pop
  99. set pc, pop
  100.  
  101. :boot_stats_text
  102. dat " MMDANGGG2 BIOS "
  103. dat "Hardware Devices: "
  104. dat "Screen: "
  105. :boot_stats_text_scr dat 0x0C20, " "
  106. dat "Keyboard: "
  107. :boot_stats_text_key dat 0x0C20, " "
  108. dat "Clock: "
  109. :boot_stats_text_clk dat 0x0C20, " "
  110. dat "Vector: "
  111. :boot_stats_text_vec dat 0x0C20, " "
  112. dat "FDD: "
  113. :boot_stats_text_fdd dat 0x0C20, " "
  114. dat "Wait / press any key to continue"
  115.  
  116. :boot_stats_scr
  117. set x, boot_stats_text_scr
  118. set y, dev_screen
  119. jsr boot_stats_check
  120. set pc, pop
  121.  
  122. :boot_stats_key
  123. set x, boot_stats_text_key
  124. set y, dev_keyboard
  125. jsr boot_stats_check
  126. set pc, pop
  127.  
  128. :boot_stats_clock
  129. set x, boot_stats_text_clk
  130. set y, dev_clock
  131. jsr boot_stats_check
  132. set pc, pop
  133.  
  134. :boot_stats_vec
  135. set x, boot_stats_text_vec
  136. set y, dev_vector
  137. jsr boot_stats_check
  138. set pc, pop
  139.  
  140. :boot_stats_fdd
  141. set x, boot_stats_text_fdd
  142. set y, dev_fdd
  143. jsr boot_stats_check
  144. set pc, pop
  145.  
  146. :boot_stats_check
  147. set [x], 0x0C20
  148. ife [y], 0xffff
  149. set pc, pop
  150. set push, a
  151. set [x], 0xF200
  152. set a, [y]
  153. ifg a, 0x9
  154. add a, 0x37
  155. ifl a, 0xA
  156. add a, 0x30
  157. bor [x], a
  158. set a, pop
  159. set pc, pop
  160.  
  161.  
  162. :end
  163. sub pc, 0x0001
  164.  
  165. :os
  166. sub pc, 0x0001
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top