Advertisement
Guest User

Untitled

a guest
Jan 28th, 2018
59
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.89 KB | None | 0 0
  1. .org 100h
  2.  
  3. start: di
  4. xra a
  5. out 10h
  6. mvi a, 0C3h ;jmp
  7. sta 0
  8. lxi h, start
  9. shld 1
  10. mvi a, 0C9h ;ret
  11. sta 38h
  12.  
  13. lxi sp, 100h
  14.  
  15. ei
  16. hlt
  17. call colorblack
  18.  
  19. lxi h, colors+15
  20. call colorset
  21.  
  22. call cls
  23.  
  24. lxi h,0E2F8h
  25. mvi a,1
  26. FillScr:
  27. call PrintNums
  28. inr h
  29. inr h
  30. inr a
  31. cpi 16
  32. jnz FillScr
  33.  
  34. neverend:
  35. jmp neverend
  36.  
  37.  
  38.  
  39. cls:
  40. xra a
  41. lxi h, 8000h
  42. cls1: mov m,a
  43. inx h
  44. cmp h
  45. jnz cls1
  46. ret
  47.  
  48. colorset:
  49. ei
  50. hlt
  51. ;3 (ñ ó÷åòîì ret)
  52. push psw
  53. push b
  54. push d
  55. push h
  56. mvi a, 88h
  57. out 0
  58. ;24
  59. mvi a,15
  60. out 2
  61. mov a,m
  62. ;31
  63. out 0Ch
  64. ;34
  65. mvi a,14
  66. out 2
  67. dcx h
  68. mov a,m
  69. ;43
  70. nop
  71. nop
  72. nop
  73. nop
  74. nop
  75. nop
  76. ;1
  77. out 0Ch
  78. ;4
  79. mvi a,13
  80. out 2
  81. dcx h
  82. mov a,m
  83. ;13
  84. out 0Ch
  85. ;16
  86. mvi a,12
  87. out 2
  88. dcx h
  89. mov a,m
  90. ;25
  91. out 0Ch
  92. ;28
  93. mvi a,11
  94. out 2
  95. dcx h
  96. mov a,m
  97. ;37
  98. xthl
  99. xthl
  100. ;1
  101. out 0Ch
  102. ;4
  103. mvi a,10
  104. out 2
  105. dcx h
  106. mov a,m
  107. ;13
  108. out 0Ch
  109. ;16
  110. mvi a,9
  111. out 2
  112. dcx h
  113. mov a,m
  114. ;25
  115. out 0Ch
  116. ;28
  117. mvi a,8
  118. out 2
  119. dcx h
  120. mov a,m
  121. ;37
  122. xthl
  123. xthl
  124. ;1
  125. out 0Ch
  126. ;4
  127. mvi a,7
  128. out 2
  129. dcx h
  130. mov a,m
  131. ;13
  132. out 0Ch
  133. ;16
  134. mvi a,6
  135. out 2
  136. dcx h
  137. mov a,m
  138. ;25
  139. out 0Ch
  140. ;28
  141. mvi a,5
  142. out 2
  143. dcx h
  144. mov a,m
  145. ;37
  146. xthl
  147. xthl
  148. ;1
  149. out 0Ch
  150. ;4
  151. mvi a,4
  152. out 2
  153. dcx h
  154. mov a,m
  155. ;13
  156. out 0Ch
  157. ;16
  158. mvi a,3
  159. out 2
  160. dcx h
  161. mov a,m
  162. ;25
  163. out 0Ch
  164. ;28
  165. mvi a,2
  166. out 2
  167. dcx h
  168. mov a,m
  169. ;37
  170. xthl
  171. xthl
  172. ;1
  173. out 0Ch
  174. ;4
  175. mvi a,1
  176. out 2
  177. dcx h
  178. mov a,m
  179. ;13
  180. out 0Ch
  181. ;16
  182. xra a
  183. out 2
  184. dcx h
  185. mov a,m
  186. ;24
  187. out 0Ch
  188. ;27
  189.  
  190. mvi a,255
  191. out 3
  192. pop h
  193. pop d
  194. pop b
  195. pop psw
  196. ret
  197.  
  198.  
  199. ;A-êîä (0-31)
  200. ;Ñ-öâåò (0-15)
  201. ;HL-êóäà (E000-FFFF)
  202. ;Âûâîäèò íà î÷èùåíûé ôîí
  203. PutSym:
  204. push psw
  205. push b
  206. push d
  207. push h
  208. add a
  209. add a
  210. add a
  211. lxi d,FONT
  212. add e
  213. mov e,a
  214. mvi a,0
  215. adc d
  216. mov d,a
  217. mov a,c
  218. rrc
  219. cc PutSym2c
  220. lxi b,$e000
  221. dad b
  222. rrc
  223. cc PutSym2c
  224. dad b
  225. rrc
  226. cc PutSym2c
  227. dad b
  228. rrc
  229. cc PutSym2c
  230. pop h
  231. pop d
  232. pop b
  233. pop psw
  234. ret
  235.  
  236. PutSym2c:
  237. push psw
  238. push d
  239. push h
  240. ldax d
  241. mov m,a
  242. inx d
  243. inr l
  244. ldax d
  245. mov m,a
  246. inx d
  247. inr l
  248. ldax d
  249. mov m,a
  250. inx d
  251. inr l
  252. ldax d
  253. mov m,a
  254. inx d
  255. inr l
  256. ldax d
  257. mov m,a
  258. inx d
  259. inr l
  260. ldax d
  261. mov m,a
  262. inx d
  263. inr l
  264. ldax d
  265. mov m,a
  266. inx d
  267. inr l
  268. ldax d
  269. mov m,a
  270. pop h
  271. pop d
  272. pop psw
  273. ret
  274.  
  275. PrintNums:
  276. push psw
  277. push b
  278. push d
  279. push h
  280. mvi d,32
  281. mov c,a
  282. Row:
  283. mvi e,2
  284. push h
  285. Col:
  286. call PutSym
  287. inr h
  288. dcr e
  289. jnz Col
  290. pop h
  291. dcr l
  292. dcr l
  293. dcr l
  294. dcr l
  295. dcr l
  296. dcr l
  297. dcr l
  298. dcr l
  299. dcr d
  300. jnz Row
  301. pop h
  302. pop d
  303. pop b
  304. pop psw
  305. ret
  306.  
  307.  
  308. colorblack:
  309. mvi a, 88h
  310. out 0
  311. mvi c, 15
  312. colorset1:
  313. mov a, c
  314. out 2
  315. xra a
  316. out 0Ch
  317. dcx h
  318. out 0Ch
  319. out 0Ch
  320. dcr c
  321. out 0Ch
  322. out 0Ch
  323. out 0Ch
  324. jp colorset1
  325. mvi a,255
  326. out 3
  327. ret
  328.  
  329.  
  330. Red equ 4
  331. Green equ 32
  332. Blue equ 128
  333. IRed equ 6
  334. IGreen equ 48
  335. IBlue equ 192
  336.  
  337. colors:
  338. .db 0,Red,Green,Green+Red,Blue,Blue+Red,Blue+Green,Blue+Green+Red
  339. .db 255,IRed,IGreen,IGreen+IRed,IBlue,IBlue+IRed,IBlue+IGreen,IBlue+IGreen+IRed
  340.  
  341.  
  342.  
  343. FONT:
  344. .DB 00,3Ch,66h,66h,66h,66h,3Ch,0
  345. .DB 00,3Ch,18h,18h,18h,78h,38h,0
  346. .DB 00,7Eh,30h,18h,0Ch,6Ch,38h,0
  347. .DB 00,3Ch,66h,06h,1Ch,06h,7Eh,0
  348. .DB 00,06h,06h,06h,7Eh,36h,1Eh,0
  349. .DB 00,3Ch,66h,06h,7Ch,60h,7Eh,0
  350. .DB 00,3Ch,66h,66h,7Ch,60h,3Ch,0
  351. .DB 00,30h,30h,30h,18h,0Ch,3Eh,0
  352. .DB 00,3Ch,66h,66h,3Ch,66h,3Ch,0
  353. .DB 00,3Ch,06h,06h,3Eh,66h,3Ch,0
  354. .DB 00,66h,66h,7Eh,66h,66h,3Eh,0
  355. .DB 00,7Ch,66h,66h,7Ch,66h,7Ch,0
  356. .DB 00,3Ch,66h,60h,60h,66h,3Ch,0
  357. .DB 00,7Ch,66h,66h,66h,66h,7Ch,0
  358. .DB 00,7Eh,60h,60h,78h,60h,7Eh,0
  359. .DB 00,60h,60h,60h,78h,60h,7Eh,0
  360.  
  361. .end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement