monroe_oc8820_r3.00.asm 28 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470
  1. ; z80dasm 1.1.6
  2. ; command line: z80dasm -g 0000h -l -a -b block_monroe_oc8820_r3.00 -o monroe_test.asm ../prom/monroe_oc8820_boot_prom_r3_00C_tms2516_ea751e22.bin
  3. displaymem equ 0x3000
  4. nomemchecks equ 9
  5. org 00000h
  6. l0000h:
  7. di ;0000 no interrupt
  8. ld sp,0ffa6h ;0001 init stack
  9. xor a ;0004 A=0
  10. jp l_init ;0005 go init 00046h
  11. ld de,0303eh ;0008 point to screen ram
  12. call cleartopline ;000b go clear top line 0052dh
  13. nop ;000e
  14. nop ;000f
  15. pop hl ;0010 get return addr
  16. displaymsg:
  17. ld c,(hl) ;0011 load count
  18. inc hl ;0012 bump
  19. ld b,000h ;0013
  20. jp printroutine ;0015
  21. rst 38h ;0018
  22. rst 38h ;0019
  23. rst 38h ;001a
  24. rst 38h ;001b
  25. rst 38h ;001c
  26. rst 38h ;001d
  27. rst 38h ;001e
  28. rst 38h ;001f
  29. rst 38h ;0020
  30. rst 38h ;0021
  31. rst 38h ;0022
  32. rst 38h ;0023
  33. rst 38h ;0024
  34. rst 38h ;0025
  35. rst 38h ;0026
  36. rst 38h ;0027
  37. rst 38h ;0028
  38. rst 38h ;0029
  39. rst 38h ;002a
  40. rst 38h ;002b
  41. rst 38h ;002c
  42. rst 38h ;002d
  43. rst 38h ;002e
  44. rst 38h ;002f
  45. rst 38h ;0030
  46. rst 38h ;0031
  47. rst 38h ;0032
  48. rst 38h ;0033
  49. rst 38h ;0034
  50. rst 38h ;0035
  51. rst 38h ;0036
  52. rst 38h ;0037
  53. rst 38h ;0038
  54. rst 38h ;0039
  55. rst 38h ;003a
  56. rst 38h ;003b
  57. rst 38h ;003c
  58. rst 38h ;003d
  59. rst 38h ;003e
  60. rst 38h ;003f
  61. jp l0000h ;0040
  62. jp l0000h ;0043
  63. l_init:
  64. out (0c0h),a ;0046 clear io, floppy control
  65. out (0c4h),a ;0048 clear io,Program map A base
  66. out (0c5h),a ;004a clear io,Program map B base
  67. out (0c6h),a ;004c clear io,DMA map A base
  68. out (0c7h),a ;004e clear io,DMA map B base
  69. out (0d4h),a ;0050 clear io,Hi-res color
  70. out (0d8h),a ;0052 clear io,Hi-res start
  71. ld hl,PIOA_start ;0054
  72. jp l0562h ;0057 do OTIR loop on following data 00562h
  73. ; BLOCK 'PIOA' (start 0x005a end 0x008b)
  74. PIOA_start:
  75. defb 0b5h ;005a io port CRT register select
  76. defb 004h ;005b count 4
  77. defb 0cfh ;005c
  78. defb 0b8h ;005d
  79. defb 037h ;005e
  80. defb 0efh ;005f
  81. ;
  82. defb 0b4h ;0060 io port PIO A data
  83. defb 001h ;0061 count 1
  84. defb 001h ;0062
  85. ;
  86. defb 0a1h ;0063 io port DART A command
  87. defb 006h ;0064 count 6
  88. defb 048h ;0065
  89. defb 048h ;0066
  90. defb 004h ;0067
  91. defb 044h ;0068
  92. defb 005h ;0069
  93. defb 0eah ;006a
  94. ;
  95. defb 0a3h ;006b io port DART B command
  96. defb 008h ;006c count 8
  97. defb 048h ;006d
  98. defb 048h ;006e
  99. defb 004h ;006f
  100. defb 044h ;0070
  101. defb 001h ;0071
  102. defb 000h ;0072
  103. defb 003h ;0073
  104. defb 0c1h ;0074
  105. ;
  106. defb 0a5h ;0075 io port SIO A command
  107. defb 002h ;0076 count 2
  108. defb 048h ;0077
  109. defb 048h ;0078
  110. ;
  111. defb 0a7h ;0079 io port SIO B command
  112. defb 002h ;007a count 2
  113. defb 048h ;007b
  114. defb 048h ;007c
  115. ;
  116. defb 0a8h ;007d io port CTC CHANNEL 0 - Communications baud rate
  117. defb 002h ;007e count 2
  118. defb 003h ;007f
  119. defb 003h ;0080
  120. ;
  121. defb 0a9h ;0081 io port CTC CHANNEL 1 - AUX RS-232C baud rate
  122. defb 002h ;0082 count 2
  123. defb 003h ;0083
  124. defb 003h ;0084
  125. ;
  126. defb 0aah ;0085 io port CTC CHANNEL 2 - Printer baud rate
  127. defb 002h ;0086 count 2
  128. defb 057h ;0087
  129. defb 04eh ;0088
  130. ;
  131. defb 000h ;0089 io port reset
  132. defb 000h ;008a count 0 terminator
  133. PIOA_end:
  134. ld ix,initcontinue ;008b continuation addr 00092h
  135. jp setupclearscreen ;008f setup display and clear screen 00505h
  136. initcontinue:
  137. ld a,080h ;0092
  138. out (0d4h),a ;0094 out 0d4h,80h Hi-res color enable copy, buzzer off
  139. ld de,displaymem ;0096 point to display upper left corner 03000h
  140. ld hl,TESTING_start ;0099 point to message 0009fh
  141. jp displaymsg ;009c go display message at HL 00011h
  142. ; BLOCK 'TESTING' (start 0x009f end 0x00a8)
  143. TESTING_start:
  144. defb 008h ;009f 8 bytes "Testing."
  145. defb 054h ;00a0
  146. defb 065h ;00a1
  147. defb 073h ;00a2
  148. defb 074h ;00a3
  149. defb 069h ;00a4
  150. defb 06eh ;00a5
  151. defb 067h ;00a6
  152. defb 02eh ;00a7
  153. TESTING_end:
  154. ld a,005h ;00a8
  155. out (0a3h),a ;00aa DART B command
  156. ld a,068h ;00ac
  157. out (0a3h),a ;00ae DART B command
  158. ld a,0f0h ;00b0 ?????
  159. out (0c8h),a ;00b2 Map and system control
  160. ld ix,0c001h ;00b4
  161. ld bc,00c5h ;00b8
  162. ld d,nomemchecks ;00bb Start test memory bank (1-9), go to zero afterwards 009h
  163. ld a,0a0h ;00bd
  164. out (0c5h),a ;00bf Program map B base
  165. ld (ix-001h),b ;00c1
  166. dec b ;00c4
  167. inc a ;00c5
  168. out (0c5h),a ;00c6 Program map B base
  169. ld (ix-001h),b ;00c8
  170. dec a ;00cb
  171. out (0c5h),a ;00cc Program map B base
  172. ld b,(ix-001h) ;00ce
  173. inc b ;00d1
  174. jr z,skipd011 ;00d2 $+4 skip for start of memtest
  175. ld d,011h ;00d4
  176. skipd011:
  177. ld b,d ;00d6
  178. ld hl,memtesteval ;00d7 00122h
  179. ld de,0000h ;00da
  180. beginmemtest:
  181. outi ;00dd
  182. jr z,memcmp ;00df
  183. exx ;00e1
  184. ld b,055h ;00e2 memory check value
  185. ld e,000h ;00e4
  186. memtestloop:
  187. ld hl,0c000h ;00e6 Start for membank that has been switch into
  188. ld c,b ;00e9
  189. memtestwriteloop:
  190. ld (hl),c ;00ea
  191. rlc c ;00eb
  192. inc l ;00ed
  193. jr nz,memtestwriteloop ;00ee -4
  194. rlc c ;00f0
  195. inc h ;00f2
  196. jr nz,memtestwriteloop ;00f3 -9
  197. ld h,0c0h ;00f5
  198. ld c,b ;00f7
  199. memtestreadloop:
  200. ld a,(hl) ;00f8
  201. xor c ;00f9
  202. or e ;00fa
  203. ld e,a ;00fb
  204. rlc c ;00fc
  205. inc l ;00fe
  206. jr nz,memtestreadloop ;00ff
  207. rlc c ;0101
  208. inc h ;0103
  209. jr nz,memtestreadloop ;0104
  210. rlc b ;0106
  211. jr nc,memtestloop ;0108
  212. ld a,e ;010a
  213. exx ;010b
  214. and a ;010c
  215. jr z,memgood ;010d
  216. inc a ;010f
  217. jr z,memerror ;0110
  218. or d ;0112
  219. ld d,a ;0113
  220. jr memgood ;0114
  221. memerror:
  222. inc e ;0116
  223. memgood:
  224. ld a,b ;0117
  225. cp 004h ;0118
  226. jr nz,beginmemtest ;011a
  227. ld a,020h ;011c
  228. out (0c0h),a ;011e Floppy external control Motor on!
  229. jr beginmemtest ;0120
  230. memtesteval:
  231. and c ;0122
  232. pop bc ;0123
  233. pop hl ;0124
  234. nop ;0125
  235. jr nz,floppystart2 ;0126
  236. ld h,b ;0128
  237. add a,b ;0129
  238. and b ;012a
  239. ret nz ;012b
  240. ret po ;012c
  241. ld bc,04121h ;012d
  242. ld h,c ;0130
  243. add a,c ;0131
  244. nop ;0132
  245. memcmp:
  246. xor a ;0133
  247. or d ;0134
  248. or e ;0135 Any errors?
  249. jr z,floppystart ;0136
  250. ld ix,memcheckdisplay ;0138
  251. jp setupcrt ;013c
  252. memcheckdisplay:
  253. ld de,displaymem ;013f
  254. ld hl,ERROR2_start ;0142
  255. jp displaymsg ;0145
  256. ; BLOCK 'ERROR2' (start 0x0148 end 0x0160)
  257. ERROR2_start:
  258. defb 017h ;0148 count 23
  259. defb 045h ;0149 Error #2 :Call service.
  260. defb 072h ;014a
  261. defb 072h ;014b
  262. defb 06fh ;014c
  263. defb 072h ;014d
  264. defb 020h ;014e
  265. defb 023h ;014f
  266. defb 032h ;0150
  267. defb 020h ;0151
  268. defb 03ah ;0152
  269. defb 043h ;0153
  270. defb 061h ;0154
  271. defb 06ch ;0155
  272. defb 06ch ;0156
  273. defb 020h ;0157
  274. defb 073h ;0158
  275. defb 065h ;0159
  276. defb 072h ;015a
  277. defb 076h ;015b
  278. defb 069h ;015c
  279. defb 063h ;015d
  280. defb 065h ;015e
  281. defb 02eh ;015f
  282. ERROR2_end:
  283. halt ;0160
  284. floppystart:
  285. out (0c5h),a ;0161 Program map B base
  286. out (0c8h),a ;0163 Map and system control
  287. dec hl ;0165
  288. dec hl ;0166
  289. ld a,(hl) ;0167
  290. floppystart2:
  291. rrca ;0168
  292. and 080h ;0169
  293. ld (0ff80h),a ;016b
  294. ld de,0ffa6h ;016e
  295. ld hl,005beh ;0171
  296. ld bc,0005ah ;0174
  297. ldir ;0177
  298. call setupclearscreen2 ;0179
  299. readydiskloop:
  300. call readydisk ;017c
  301. call sub_061ch ;017f
  302. ld a,0ffh ;0182
  303. jr c,skipinvert ;0184
  304. cpl ;0186
  305. skipinvert:
  306. ld (0ff93h),a ;0187
  307. ld hl,00404h ;018a
  308. ld (0ff91h),hl ;018d
  309. or a ;0190
  310. jr nz,l01c3h ;0191
  311. ld c,010h ;0193
  312. call sub_065ah ;0195
  313. jr c,l01abh ;0198
  314. ld bc,00000h ;019a
  315. call sub_040eh ;019d
  316. jr c,l01abh ;01a0
  317. call sub_03a2h ;01a2
  318. ld a,(0ff8bh) ;01a5
  319. ld (0ff91h),a ;01a8
  320. l01abh:
  321. ld c,011h ;01ab
  322. call sub_065ah ;01ad
  323. jr c,l01c3h ;01b0
  324. ld bc,0000h ;01b2
  325. call sub_040eh ;01b5
  326. jr c,l01c3h ;01b8
  327. call sub_03a2h ;01ba
  328. ld a,(0ff8bh) ;01bd
  329. ld (0ff92h),a ;01c0
  330. l01c3h:
  331. ld a,001h ;01c3
  332. ld c,008h ;01c5
  333. l01c7h:
  334. or 0a0h ;01c7
  335. out (0c0h),a ;01c9 Floppy external control
  336. ld b,a ;01cb
  337. l01cch:
  338. in a,(0b0h) ;01cc Floppy status
  339. rr a ;01ce
  340. jr c,l01cch ;01d0
  341. in a,(0b0h) ;01d2 Floppy status
  342. add a,a ;01d4
  343. jr c,l01ddh ;01d5
  344. call delayloop ;01d7
  345. call loadingdisk ;01da
  346. l01ddh:
  347. inc c ;01dd
  348. ld a,b ;01de
  349. add a,a ;01df
  350. and 00fh ;01e0
  351. jr nz,l01c7h ;01e2
  352. ld a,(0ff93h) ;01e4
  353. or a ;01e7
  354. jr nz,l0204h ;01e8
  355. in a,(0ffh) ;01ea ????
  356. and 020h ;01ec
  357. jr nz,l0204h ;01ee
  358. ld c,010h ;01f0
  359. call sub_065ah ;01f2
  360. ld b,000h ;01f5
  361. call nc,loadingdisk ;01f7
  362. ld c,011h ;01fa
  363. call sub_065ah ;01fc
  364. ld b,000h ;01ff
  365. call nc,loadingdisk ;0201
  366. l0204h:
  367. call setupclearscreen2 ;0204
  368. ld bc,002a3h ;0207
  369. ld hl,0061ah ;020a
  370. otir ;020d
  371. ld de,03000h ;020f
  372. ld hl,NOSYSTEM_start ;0212
  373. jp displaymsg ;0215
  374. ; BLOCK 'NOSYSTEM' (start 0x0218 end 0x0232)
  375. NOSYSTEM_start:
  376. defb 019h ;0218 count 25
  377. defb 04eh ;0219 No System Device On Line.
  378. defb 06fh ;021a
  379. defb 020h ;021b
  380. defb 053h ;021c
  381. defb 079h ;021d
  382. defb 073h ;021e
  383. defb 074h ;021f
  384. defb 065h ;0220
  385. defb 06dh ;0221
  386. defb 020h ;0222
  387. defb 044h ;0223
  388. defb 065h ;0224
  389. defb 076h ;0225
  390. defb 069h ;0226
  391. defb 063h ;0227
  392. defb 065h ;0228
  393. defb 020h ;0229
  394. defb 04fh ;022a
  395. defb 06eh ;022b
  396. defb 020h ;022c
  397. defb 04ch ;022d
  398. defb 069h ;022e
  399. defb 06eh ;022f
  400. defb 065h ;0230
  401. defb 02eh ;0231
  402. NOSYSTEM_end:
  403. call delayloop ;0232
  404. call delayloop ;0235
  405. call delayloop ;0238
  406. jp readydiskloop ;023b
  407. l023eh:
  408. ld ix,returnsetupcrt1 ;023e
  409. jp setupcrt ;0242
  410. returnsetupcrt1:
  411. call screenclearnetry2 ;0245
  412. rst 10h ;0248
  413. ; BLOCK 'ERROR0' (start 0x0249 end 0x0261)
  414. ERROR0_start:
  415. defb 017h ;0249 count 23
  416. defb 045h ;024a Error #0: Call service.
  417. defb 072h ;024b
  418. defb 072h ;024c
  419. defb 06fh ;024d
  420. defb 072h ;024e
  421. defb 020h ;024f
  422. defb 023h ;0250
  423. defb 030h ;0251
  424. defb 03ah ;0252
  425. defb 020h ;0253
  426. defb 043h ;0254
  427. defb 061h ;0255
  428. defb 06ch ;0256
  429. defb 06ch ;0257
  430. defb 020h ;0258
  431. defb 073h ;0259
  432. defb 065h ;025a
  433. defb 072h ;025b
  434. defb 076h ;025c
  435. defb 069h ;025d
  436. defb 063h ;025e
  437. defb 065h ;025f
  438. defb 02eh ;0260
  439. ERROR0_end:
  440. halt ;0261
  441. loadingdisk:
  442. push bc ;0262
  443. xor a ;0263
  444. ld (0ff81h),a ;0264
  445. ld (0ff82h),a ;0267
  446. rst 8 ;026a
  447. ; BLOCK 'LOADING' (start 0x026b end 0x0274)
  448. LOADING_start:
  449. defb 008h ;026b count 8
  450. defb 04ch ;026c Loading
  451. defb 06fh ;026d
  452. defb 061h ;026e
  453. defb 064h ;026f
  454. defb 069h ;0270
  455. defb 06eh ;0271
  456. defb 067h ;0272
  457. defb 020h ;0273
  458. LOADING_end:
  459. pop ix ;0274
  460. call sub_04a1h ;0276
  461. jr c,l023eh ;0279
  462. ld bc,0000h ;027b
  463. call sub_040eh ;027e
  464. jr c,l02ddh ;0281
  465. ld hl,(0ff81h) ;0283
  466. ld a,l ;0286
  467. and a ;0287
  468. jr z,l029ch ;0288
  469. ld a,h ;028a
  470. and 003h ;028b
  471. in a,(0ffh) ;028d
  472. jr z,l0298h ;028f
  473. bit 0,a ;0291
  474. jr nz,l029ch ;0293
  475. l0295h:
  476. jp l034bh ;0295
  477. l0298h:
  478. bit 1,a ;0298
  479. jr z,l0295h ;029a
  480. l029ch:
  481. call sub_03a2h ;029c
  482. jp c,l0343h ;029f
  483. jr z,l02b6h ;02a2
  484. call sub_040eh ;02a4
  485. jr c,l02ddh ;02a7
  486. ld hl,0401fh ;02a9
  487. bit 0,(hl) ;02ac
  488. jp nz,l034fh ;02ae
  489. call sub_040eh ;02b1
  490. jr c,l02ddh ;02b4
  491. l02b6h:
  492. exx ;02b6
  493. ld hl,0400eh ;02b7
  494. ld d,(hl) ;02ba
  495. inc hl ;02bb
  496. ld e,(hl) ;02bc
  497. push de ;02bd
  498. pop iy ;02be
  499. ld hl,04080h ;02c0
  500. ld c,(hl) ;02c3
  501. inc hl ;02c4
  502. inc hl ;02c5
  503. ld d,(hl) ;02c6
  504. inc hl ;02c7
  505. ld e,(hl) ;02c8
  506. inc hl ;02c9
  507. ld a,(hl) ;02ca
  508. inc hl ;02cb
  509. ld l,(hl) ;02cc
  510. ld h,a ;02cd
  511. ex de,hl ;02ce
  512. push hl ;02cf
  513. ld a,e ;02d0
  514. add a,0ffh ;02d1
  515. ld a,d ;02d3
  516. exx ;02d4
  517. ld e,000h ;02d5
  518. adc a,e ;02d7
  519. ld d,a ;02d8
  520. pop hl ;02d9
  521. call sub_0414h ;02da
  522. l02ddh:
  523. jr c,l0347h ;02dd
  524. ld a,(0ff8bh) ;02df
  525. cp 002h ;02e2
  526. jr z,l02eeh ;02e4
  527. xor a ;02e6
  528. ex af,af' ;02e7
  529. exx ;02e8
  530. jp 0ffa6h ;02e9
  531. l02ech:
  532. ex af,af' ;02ec
  533. adc a,c ;02ed
  534. l02eeh:
  535. push ix ;02ee
  536. pop bc ;02f0
  537. ld a,(0ff8bh) ;02f1
  538. ld de,00013h ;02f4
  539. ld hl,0ff8dh ;02f7
  540. jr nz,l033fh ;02fa
  541. cp 002h ;02fc
  542. jp nz,0ffb8h ;02fe
  543. push bc ;0301
  544. bit 3,c ;0302
  545. jr nz,l030bh ;0304
  546. ld a,0ffh ;0306
  547. ld (0ff81h),a ;0308
  548. l030bh:
  549. in a,(0ffh) ;030b
  550. ld c,a ;030d
  551. xor a ;030e
  552. bit 0,c ;030f
  553. jr z,l0315h ;0311
  554. ld a,00fh ;0313
  555. l0315h:
  556. bit 1,c ;0315
  557. jr z,l031bh ;0317
  558. or 0f0h ;0319
  559. l031bh:
  560. ld b,a ;031b
  561. ld a,(0ff81h) ;031c
  562. cpl ;031f
  563. and a ;0320
  564. jr z,l0334h ;0321
  565. push bc ;0323
  566. push ix ;0324
  567. pop bc ;0326
  568. ld a,c ;0327
  569. sub 007h ;0328
  570. ld b,a ;032a
  571. ld a,080h ;032b
  572. l032dh:
  573. rlca ;032d
  574. rlca ;032e
  575. djnz l032dh ;032f
  576. pop bc ;0331
  577. and b ;0332
  578. rrca ;0333
  579. l0334h:
  580. xor b ;0334
  581. pop bc ;0335
  582. ld (0ff81h),a ;0336
  583. ld a,(0ff8bh) ;0339
  584. jp 0ffb8h ;033c
  585. l033fh:
  586. ld a,033h ;033f
  587. jr l0351h ;0341
  588. l0343h:
  589. ld a,030h ;0343
  590. jr l0351h ;0345
  591. l0347h:
  592. ld a,032h ;0347
  593. jr l0351h ;0349
  594. l034bh:
  595. ld a,039h ;034b
  596. jr l0351h ;034d
  597. l034fh:
  598. ld a,031h ;034f
  599. l0351h:
  600. push ix ;0351
  601. push af ;0353
  602. call screenclearnetry2 ;0354
  603. push de ;0357
  604. rst 10h ;0358
  605. ; BLOCK 'INVALID' (start 0x0359 end 0x0382)
  606. INVALID_start:
  607. defb 028h ;0359 count 40
  608. defb 045h ;035a Error #10: Invalid System Disk in Drive
  609. defb 072h ;035b
  610. defb 072h ;035c
  611. defb 06fh ;035d
  612. defb 072h ;035e
  613. defb 020h ;035f
  614. defb 023h ;0360
  615. defb 031h ;0361
  616. defb 030h ;0362
  617. defb 03ah ;0363
  618. defb 020h ;0364
  619. defb 049h ;0365
  620. defb 06eh ;0366
  621. defb 076h ;0367
  622. defb 061h ;0368
  623. defb 06ch ;0369
  624. defb 069h ;036a
  625. defb 064h ;036b
  626. defb 020h ;036c
  627. defb 053h ;036d
  628. defb 079h ;036e
  629. defb 073h ;036f
  630. defb 074h ;0370
  631. defb 065h ;0371
  632. defb 06dh ;0372
  633. defb 020h ;0373
  634. defb 044h ;0374
  635. defb 069h ;0375
  636. defb 073h ;0376
  637. defb 06bh ;0377
  638. defb 020h ;0378
  639. defb 069h ;0379
  640. defb 06eh ;037a
  641. defb 020h ;037b
  642. defb 044h ;037c
  643. defb 072h ;037d
  644. defb 069h ;037e
  645. defb 076h ;037f
  646. defb 065h ;0380
  647. defb 020h ;0381
  648. INVALID_end:
  649. pop hl ;0382
  650. pop bc ;0383
  651. ld de,0008h ;0384
  652. add hl,de ;0387
  653. add hl,de ;0388
  654. inc hl ;0389
  655. ld a,004h ;038a Select display memory
  656. out (0c8h),a ;038c Map and system control
  657. ld (hl),b ;038e
  658. xor a ;038f
  659. out (0c8h),a ;0390 Map and system control
  660. call delayloop ;0392
  661. call delayloop ;0395
  662. call setupclearscreen2 ;0398
  663. call readydisk ;039b
  664. exx ;039e
  665. pop bc ;039f
  666. scf ;03a0
  667. ret ;03a1
  668. sub_03a2h:
  669. ld a,003h ;03a2
  670. ld (0ff8bh),a ;03a4
  671. ld hl,0401dh ;03a7
  672. ld a,(hl) ;03aa
  673. cp 0e5h ;03ab
  674. scf ;03ad
  675. ret z ;03ae
  676. cp 06ch ;03af
  677. scf ;03b1
  678. ret z ;03b2
  679. add a,001h ;03b3
  680. jr nc,l03bdh ;03b5
  681. ld hl,0ff8bh ;03b7
  682. ld (hl),002h ;03ba
  683. ret ;03bc
  684. l03bdh:
  685. inc hl ;03bd
  686. ld b,(hl) ;03be
  687. ld a,b ;03bf
  688. inc hl ;03c0
  689. ld c,(hl) ;03c1
  690. add a,001h ;03c2
  691. adc a,c ;03c4
  692. ld hl,0ff8bh ;03c5
  693. ld (hl),002h ;03c8
  694. jr z,l03d4h ;03ca
  695. ld (hl),001h ;03cc
  696. ld a,b ;03ce
  697. or c ;03cf
  698. scf ;03d0
  699. ret z ;03d1
  700. or a ;03d2
  701. ret ;03d3
  702. l03d4h:
  703. ld bc,0001h ;03d4
  704. or a ;03d7
  705. ret ;03d8
  706. readydisk:
  707. ld de,displaymem ;03d9
  708. rst 10h ;03dc
  709. ; BLOCK 'READY' (start 0x03dd end 0x03fb)
  710. READY_start:
  711. defb 01dh ;03dd count 29
  712. defb 052h ;03de R3-00C Ready For System Disk
  713. defb 033h ;03df
  714. defb 02dh ;03e0
  715. defb 030h ;03e1
  716. defb 030h ;03e2
  717. defb 043h ;03e3
  718. defb 020h ;03e4
  719. defb 052h ;03e5
  720. defb 065h ;03e6
  721. defb 061h ;03e7
  722. defb 064h ;03e8
  723. defb 079h ;03e9
  724. defb 020h ;03ea
  725. defb 046h ;03eb
  726. defb 06fh ;03ec
  727. defb 072h ;03ed
  728. defb 020h ;03ee
  729. defb 053h ;03ef
  730. defb 079h ;03f0
  731. defb 073h ;03f1
  732. defb 074h ;03f2
  733. defb 065h ;03f3
  734. defb 06dh ;03f4
  735. defb 020h ;03f5
  736. defb 044h ;03f6
  737. defb 069h ;03f7
  738. defb 073h ;03f8
  739. defb 06bh ;03f9
  740. defb 020h ;03fa
  741. READY_end:
  742. call delayloop ;03fb
  743. ret ;03fe
  744. ld b,00ah ;03ff
  745. ld hl,0000h ;0401
  746. l0404h:
  747. inc hl ;0404
  748. ld a,l ;0405
  749. or h ;0406
  750. jr nz,l0404h ;0407
  751. djnz l0404h ;0409
  752. jp memcmp ;040b
  753. sub_040eh:
  754. ld de,00100h ;040e
  755. ld hl,04000h ;0411
  756. sub_0414h:
  757. push bc ;0414
  758. push ix ;0415
  759. pop bc ;0417
  760. ld a,c ;0418
  761. pop bc ;0419
  762. cp 010h ;041a
  763. jp nc,l06c1h ;041c
  764. l041fh:
  765. ld a,005h ;041f
  766. l0421h:
  767. ex af,af' ;0421
  768. push bc ;0422
  769. ex (sp),hl ;0423
  770. ld a,l ;0424
  771. and 00fh ;0425
  772. push bc ;0427
  773. push af ;0428
  774. ld a,(0ff81h) ;0429
  775. and a ;042c
  776. ld b,000h ;042d
  777. jr z,l0433h ;042f
  778. ld b,010h ;0431
  779. l0433h:
  780. pop af ;0433
  781. add a,b ;0434
  782. inc a ;0435
  783. out (0b2h),a ;0436 Floppy sector register
  784. add hl,hl ;0438
  785. add hl,hl ;0439
  786. add hl,hl ;043a
  787. add hl,hl ;043b
  788. cp 011h ;043c
  789. ld a,h ;043e
  790. out (0b3h),a ;043f Floppy data register
  791. jr c,l0453h ;0441
  792. rra ;0443
  793. out (0b3h),a ;0444 Floppy data register
  794. push ix ;0446
  795. pop bc ;0448
  796. ld a,b ;0449
  797. jr nc,l044eh ;044a
  798. or 010h ;044c
  799. l044eh:
  800. ld (0ff82h),a ;044e
  801. out (0c0h),a ;0451 Floppy external control
  802. l0453h:
  803. pop bc ;0453
  804. pop hl ;0454
  805. ld a,01dh ;0455
  806. call setfloppystatus ;0457
  807. and 098h ;045a
  808. jr nz,l0486h ;045c
  809. call sub_04c1h ;045e
  810. l0461h:
  811. ld a,(0ff82h) ;0461
  812. bit 4,a ;0464
  813. ld a,082h ;0466
  814. jr z,l046ch ;0468
  815. ld a,08ah ;046a
  816. l046ch:
  817. call setfloppystatus ;046c
  818. and 09ch ;046f
  819. jr nz,l0486h ;0471
  820. inc h ;0473
  821. inc bc ;0474
  822. dec d ;0475
  823. ret z ;0476
  824. ld a,c ;0477
  825. and 00fh ;0478
  826. jr z,l041fh ;047a
  827. in a,(0b2h) ;047c Floppy sector register
  828. inc a ;047e
  829. out (0b2h),a ;047f Floppy sector register
  830. ld a,005h ;0481
  831. l0483h:
  832. ex af,af' ;0483
  833. jr l0461h ;0484
  834. l0486h:
  835. scf ;0486
  836. bit 7,a ;0487
  837. ret nz ;0489
  838. ex af,af' ;048a
  839. dec a ;048b
  840. jr nz,l0421h ;048c
  841. ex af,af' ;048e
  842. bit 4,a ;048f
  843. jr z,l049fh ;0491
  844. ld a,(0ff81h) ;0493
  845. and a ;0496
  846. jr nz,l049fh ;0497
  847. cpl ;0499
  848. ld (0ff81h),a ;049a
  849. jr l041fh ;049d
  850. l049fh:
  851. scf ;049f
  852. ret ;04a0
  853. sub_04a1h:
  854. push bc ;04a1
  855. push ix ;04a2
  856. pop bc ;04a4
  857. ld a,c ;04a5
  858. pop bc ;04a6
  859. cp 010h ;04a7
  860. jp nc,l0788h ;04a9
  861. ld a,001h ;04ac
  862. call setfloppystatus ;04ae
  863. and 004h ;04b1
  864. ret nz ;04b3
  865. scf ;04b4
  866. ret ;04b5
  867. setfloppystatus:
  868. out (0b0h),a ;04b6 Floppy status
  869. l04b8h:
  870. in a,(0b4h) ;04b8 PIO A data
  871. bit 4,a ;04ba
  872. jr z,l04b8h ;04bc
  873. in a,(0b0h) ;04be floppy status and command
  874. ret ;04c0
  875. sub_04c1h:
  876. push bc ;04c1
  877. ld bc,0b301h ;04c2
  878. jr l04cbh ;04c5
  879. sub_04c7h:
  880. push bc ;04c7
  881. ld bc,07803h ;04c8
  882. l04cbh:
  883. ld a,b ;04cb
  884. ld (0ff8ch),a ;04cc
  885. ld a,c ;04cf
  886. out (0b4h),a ;04d0 PIO A data
  887. ld bc,006ach ;04d2
  888. ld a,0c3h ;04d5
  889. l04d7h:
  890. out (c),a ;04d7
  891. djnz l04d7h ;04d9
  892. ld a,07dh ;04db
  893. out (c),a ;04dd
  894. out (c),l ;04df
  895. out (c),h ;04e1
  896. out (c),e ;04e3
  897. out (c),d ;04e5
  898. push hl ;04e7
  899. ld hl,004fbh ;04e8
  900. ld b,003h ;04eb
  901. otir ;04ed
  902. ld a,(0ff8ch) ;04ef
  903. out (c),a ;04f2
  904. ld b,005h ;04f4
  905. otir ;04f6
  906. pop hl ;04f8
  907. pop bc ;04f9
  908. ret ;04fa
  909. inc d ;04fb
  910. jr z,l0483h ;04fc
  911. adc a,d ;04fe
  912. rst 8 ;04ff
  913. ld bc,087cfh ;0500
  914. setupclearscreen2:
  915. pop ix ;0503
  916. setupclearscreen:
  917. ;entry during initiation with IX=0092
  918. xor a ;0505 start A=0
  919. ld bc,00eb9h ;0506 C=B9 B=14
  920. ld hl,0054fh ;0509
  921. setupclearloop :
  922. out (0b8h),a ;050cCRT register select
  923. inc a ;050e A++
  924. outi ;050f C)=(HL++) and B--
  925. jr nz,setupclearloop ;0511 loop until B==0 (14 bytes to write) $-5
  926. ld de,03002h ;0513
  927. ld hl,displaymem ;0516
  928. ld bc,00ffeh ;0519
  929. ;RST 08 jump in here HL=300C DE=300E BC=4E IX=032F
  930. l051ch:
  931. ld a,004h ;051c Select display memory
  932. out (0c8h),a ;051e Output to screen out C8,04 Map and system control
  933. xor a ;0520
  934. ld (hl),a ;0521 put 00h at 3000h or 300Ch
  935. inc hl ;0522 bump
  936. ld (hl),020h ;0523 put 20h at 3001h or 300Dh
  937. dec hl ;0525 go back point to original
  938. ldir ;0526 copy 00 20 through 4K or 80 words
  939. xor a ;0528 Reset map A=0
  940. out (0c8h),a ;0529 out C8,00 Map and system control
  941. jp (ix) ;052b continue
  942. cleartopline:
  943. push de ;052d save old DE
  944. ld l,e ;052e HL=DE
  945. ld h,d ;052f
  946. inc de ;0530 DE+=2
  947. inc de ;0531
  948. ld bc,0004eh ;0532 80-2
  949. push ix ;0535 save old IX
  950. ld ix,clearlineend ;0537 exit addr 0053dh
  951. jr l051ch ;053b clear line 300C 80char $-3
  952. ;clear line returns here
  953. clearlineend:
  954. pop ix ;053d restore old IX
  955. pop de ;053f restore old DE
  956. ret ;0540
  957. ; BLOCK 'DB' (start 0x0541 end 0x055d)
  958. printroutine:
  959. ;print routine
  960. ;BC count
  961. ;HL message source
  962. ;DE screen target
  963. ld a,004h ;0541 Select display memory
  964. out (0c8h),a ;0543 Output to screen Map and system control
  965. printcharloop:
  966. inc de ;0545 do every other addr
  967. ldi ;0546 (DE++)=(HL++) and BC--
  968. jp pe,printcharloop ;0548 repeat while BC not 0 00545h
  969. xor a ;054b Reset map
  970. out (0c8h),a ;054c Reset to memory Map and system control
  971. jp (hl) ;054e
  972. ;data to be output to io port B9 14 byte CRT data register
  973. defb 069h ;054f
  974. defb 050h ;0550
  975. defb 056h ;0551
  976. defb 00bh ;0552
  977. defb 019h ;0553
  978. defb 003h ;0554
  979. defb 018h ;0555
  980. defb 018h ;0556
  981. defb 000h ;0557
  982. defb 00bh ;0558
  983. defb 020h ;0559
  984. defb 000h ;055a
  985. defb 000h ;055b
  986. defb 000h ;055c
  987. DB_end:
  988. pop hl ;055d
  989. jr l0562h ;055e
  990. screenclearloop:
  991. otir ;0560 out B bytes from (HL) to (C)
  992. l0562h:
  993. ld c,(hl) ;0562 get register
  994. inc hl ;0563 bump
  995. ld b,(hl) ;0564 get count
  996. inc hl ;0565 bump
  997. ld a,b ;0566
  998. and a ;0567
  999. jr nz,screenclearloop ;0568 if count not 0 loop $-8
  1000. jp (hl) ;056a
  1001. screenclearnetry2:
  1002. ld de,03100h ;056b
  1003. ld a,00fh ;056e
  1004. out (0b8h),a ;0570 CRT register select
  1005. xor a ;0572
  1006. out (0b9h),a ;0573 CRT data register
  1007. in a,(0bbh) ;0575 ?????
  1008. or a ;0577
  1009. ret nz ;0578
  1010. ld de,030a0h ;0579
  1011. ret ;057c
  1012. delayloop:
  1013. ld hl,04600h ;057d
  1014. l0580h:
  1015. dec hl ;0580
  1016. ex (sp),hl ;0581
  1017. ex (sp),hl ;0582
  1018. ex (sp),hl ;0583
  1019. ex (sp),hl ;0584
  1020. ld a,l ;0585
  1021. or h ;0586
  1022. jr nz,l0580h ;0587
  1023. ret ;0589
  1024. pop ix ;058a
  1025. setupcrt:
  1026. ld a,00fh ;058c
  1027. out (0b8h),a ;058e CRT register select
  1028. xor a ;0590
  1029. out (0b9h),a ;0591 CRT data register
  1030. in a,(0bbh) ;0593
  1031. and a ;0595
  1032. jr nz,l059ch ;0596
  1033. ld a,081h ;0598
  1034. out (0d4h),a ;059a Buzzer on
  1035. l059ch:
  1036. ld bc,006cch ;059c
  1037. ld hl,005b8h ;059f
  1038. otir ;05a2
  1039. ld bc,0000h ;05a4
  1040. l05a7h:
  1041. ex (sp),hl ;05a7
  1042. ex (sp),hl ;05a8
  1043. dec bc ;05a9
  1044. ld a,b ;05aa
  1045. or c ;05ab
  1046. jr nz,l05a7h ;05ac
  1047. ld a,080h ;05ae
  1048. out (0d4h),a ;05b0 Buzzer off
  1049. ld a,09fh ;05b2
  1050. out (0cch),a ;05b4 ?????
  1051. jp (ix) ;05b6
  1052. l05b8h:
  1053. adc a,(hl) ;05b8
  1054. inc b ;05b9
  1055. sub d ;05ba
  1056. cp a ;05bb
  1057. rst 18h ;05bc
  1058. rst 38h ;05bd
  1059. l05beh:
  1060. ld a,001h ;05be
  1061. out (0c8h),a ;05c0 Map and system control
  1062. l05c2h:
  1063. ex af,af' ;05c2
  1064. adc a,(hl) ;05c3
  1065. ex af,af' ;05c4
  1066. inc hl ;05c5
  1067. dec de ;05c6
  1068. ld a,e ;05c7
  1069. or d ;05c8
  1070. jr nz,l05c2h ;05c9
  1071. out (0c8h),a ;05cb Map and system control
  1072. jp l02ech ;05cd
  1073. cp 002h ;05d0
  1074. ld a,001h ;05d2
  1075. out (0c8h),a ;05d4 Map and system control
  1076. jr nz,l05f5h ;05d6
  1077. ld a,(0ff81h) ;05d8
  1078. ld (0022h),a ;05db
  1079. ld a,c ;05de
  1080. sub 010h ;05df
  1081. jr c,l05f5h ;05e1
  1082. ld c,a ;05e3
  1083. jr z,l05eeh ;05e4
  1084. ld a,(0ff8fh) ;05e6
  1085. cp 095h ;05e9
  1086. jr nz,l05eeh ;05eb
  1087. inc c ;05ed
  1088. l05eeh:
  1089. ld a,004h ;05ee
  1090. add a,c ;05f0
  1091. ld c,a ;05f1
  1092. push bc ;05f2
  1093. pop ix ;05f3
  1094. l05f5h:
  1095. ld a,(0ff80h) ;05f5
  1096. or c ;05f8
  1097. ld c,a ;05f9
  1098. ld a,(0ff91h) ;05fa
  1099. ld (de),a ;05fd
  1100. inc de ;05fe
  1101. push bc ;05ff
  1102. ld bc,00004h ;0600
  1103. ldir ;0603
  1104. ld de,00023h ;0605
  1105. ld hl,0ff8dh ;0608
  1106. ld a,(0ff92h) ;060b
  1107. ld (de),a ;060e
  1108. inc de ;060f
  1109. ld bc,00004h ;0610
  1110. ldir ;0613
  1111. pop bc ;0615
  1112. jp (iy) ;0616
  1113. dec b ;0618
  1114. add a,b ;0619
  1115. dec b ;061a
  1116. nop ;061b
  1117. sub_061ch:
  1118. ld bc,002a3h ;061c
  1119. ld hl,00618h ;061f
  1120. otir ;0622
  1121. ld b,0ffh ;0624
  1122. l0626h:
  1123. in a,(079h) ;0626
  1124. cp 0c7h ;0628
  1125. jr z,l0630h ;062a
  1126. djnz l0626h ;062c
  1127. scf ;062e
  1128. ret ;062f
  1129. l0630h:
  1130. call reading ;0630
  1131. ret c ;0633
  1132. in a,(0ffh) ;0634
  1133. rra ;0636
  1134. rra ;0637
  1135. and 007h ;0638
  1136. ld hl,007e2h ;063a
  1137. jr z,l064fh ;063d
  1138. ld hl,007d6h ;063f
  1139. dec a ;0642
  1140. jr z,l0648h ;0643
  1141. ld hl,007cah ;0645
  1142. l0648h:
  1143. call sub_076bh ;0648
  1144. call reading ;064b
  1145. ret c ;064e
  1146. l064fh:
  1147. ld de,0ff8dh ;064f
  1148. ld bc,00004h ;0652
  1149. ldir ;0655
  1150. jp l077fh ;0657
  1151. sub_065ah:
  1152. push bc ;065a
  1153. pop ix ;065b
  1154. ld a,010h ;065d
  1155. sub c ;065f
  1156. jr z,l0664h ;0660
  1157. ld a,020h ;0662
  1158. l0664h:
  1159. ld hl,0ff83h ;0664
  1160. ld b,004h ;0667
  1161. ld (hl),008h ;0669
  1162. inc hl ;066b
  1163. ld (hl),a ;066c
  1164. l066dh:
  1165. inc hl ;066d
  1166. ld (hl),000h ;066e
  1167. djnz l066dh ;0670
  1168. call reading ;0672
  1169. ret c ;0675
  1170. call moveoutreseta ;0676
  1171. call reading2 ;0679
  1172. and 002h ;067c
  1173. ret z ;067e
  1174. scf ;067f
  1175. ret ;0680
  1176. l0681h:
  1177. push bc ;0681
  1178. call screenclearnetry2 ;0682
  1179. rst 10h ;0685
  1180. ; BLOCK 'ERROR1' (start 0x0686 end 0x06af)
  1181. ERROR1_start:
  1182. defb 028h ;0686
  1183. defb 045h ;0687 count 40
  1184. defb 072h ;0688 Error 1: Disk system error, Call Service
  1185. defb 072h ;0689
  1186. defb 06fh ;068a
  1187. defb 072h ;068b
  1188. defb 020h ;068c
  1189. defb 031h ;068d
  1190. defb 03ah ;068e
  1191. defb 020h ;068f
  1192. defb 044h ;0690
  1193. defb 069h ;0691
  1194. defb 073h ;0692
  1195. defb 06bh ;0693
  1196. defb 020h ;0694
  1197. defb 073h ;0695
  1198. defb 079h ;0696
  1199. defb 073h ;0697
  1200. defb 074h ;0698
  1201. defb 065h ;0699
  1202. defb 06dh ;069a
  1203. defb 020h ;069b
  1204. defb 065h ;069c
  1205. defb 072h ;069d
  1206. defb 072h ;069e
  1207. defb 06fh ;069f
  1208. defb 072h ;06a0
  1209. defb 02ch ;06a1
  1210. defb 020h ;06a2
  1211. defb 043h ;06a3
  1212. defb 061h ;06a4
  1213. defb 06ch ;06a5
  1214. defb 06ch ;06a6
  1215. defb 020h ;06a7
  1216. defb 053h ;06a8
  1217. defb 065h ;06a9
  1218. defb 072h ;06aa
  1219. defb 076h ;06ab
  1220. l06ach:
  1221. defb 069h ;06ac
  1222. defb 063h ;06ad
  1223. defb 065h ;06ae
  1224. ERROR1_end:
  1225. call delayloop ;06af
  1226. call delayloop ;06b2
  1227. call delayloop ;06b5
  1228. call setupclearscreen2 ;06b8
  1229. call readydisk ;06bb
  1230. pop bc ;06be
  1231. scf ;06bf
  1232. ret ;06c0
  1233. l06c1h:
  1234. call sub_04c7h ;06c1
  1235. ld a,b ;06c4
  1236. ld (0ff85h),a ;06c5
  1237. ld a,c ;06c8
  1238. ld (0ff86h),a ;06c9
  1239. l06cch:
  1240. ld a,d ;06cc
  1241. ld (0ff87h),a ;06cd
  1242. push bc ;06d0
  1243. push hl ;06d1
  1244. call reading ;06d2
  1245. jp c,l06fbh ;06d5
  1246. ld hl,0ff83h ;06d8
  1247. ld bc,00678h ;06db
  1248. l06deh:
  1249. in a,(079h) ;06de
  1250. and 041h ;06e0
  1251. jr nz,l06deh ;06e2
  1252. outi ;06e4
  1253. jr nz,l06deh ;06e6
  1254. out (07ah),a ;06e8
  1255. nop ;06ea
  1256. l06ebh:
  1257. in a,(079h) ;06eb
  1258. and 044h ;06ed
  1259. jr nz,l06ebh ;06ef
  1260. out (07bh),a ;06f1
  1261. call reading2 ;06f3
  1262. and 002h ;06f6
  1263. call nz,sub_06ffh ;06f8
  1264. l06fbh:
  1265. pop hl ;06fb
  1266. pop bc ;06fc
  1267. inc bc ;06fd
  1268. ret ;06fe
  1269. sub_06ffh:
  1270. call reading ;06ff
  1271. ret c ;0702
  1272. ld a,003h ;0703
  1273. call moveout ;0705
  1274. ld bc,00478h ;0708
  1275. ld hl,0ff89h ;070b
  1276. l070eh:
  1277. in a,(079h) ;070e
  1278. cp 00fh ;0710
  1279. jr nz,l070eh ;0712
  1280. ini ;0714
  1281. jr nz,l070eh ;0716
  1282. call reading2 ;0718
  1283. ld a,(0ff89h) ;071b
  1284. sub 098h ;071e
  1285. ret z ;0720
  1286. scf ;0721
  1287. ret ;0722
  1288. reading:
  1289. in a,(079h) ;0723
  1290. and 080h ;0725
  1291. scf ;0727
  1292. ret z ;0728
  1293. ld a,001h ;0729
  1294. out (079h),a ;072b
  1295. ld b,0ffh ;072d
  1296. l072fh:
  1297. in a,(079h) ;072f
  1298. and 080h ;0731
  1299. ret z ;0733
  1300. djnz l072fh ;0734
  1301. scf ;0736
  1302. ret ;0737
  1303. reading2:
  1304. in a,(079h) ;0738
  1305. and 044h ;073a
  1306. jr nz,reading2 ;073c
  1307. in a,(078h) ;073e
  1308. ld b,a ;0740
  1309. l0741h:
  1310. in a,(079h) ;0741
  1311. and 042h ;0743
  1312. jr nz,l0741h ;0745
  1313. in a,(078h) ;0747
  1314. ld a,b ;0749
  1315. ret ;074a
  1316. moveoutreseta:
  1317. ld a,000h ;074b
  1318. moveout:
  1319. call sub_0760h ;074d
  1320. ld a,(0ff84h) ;0750
  1321. call sub_0760h ;0753
  1322. ld a,000h ;0756
  1323. ld b,004h ;0758
  1324. l075ah:
  1325. call sub_0760h ;075a
  1326. djnz l075ah ;075d
  1327. ret ;075f
  1328. sub_0760h:
  1329. push af ;0760
  1330. l0761h:
  1331. in a,(079h) ;0761
  1332. and 041h ;0763
  1333. jr nz,l0761h ;0765
  1334. pop af ;0767
  1335. out (078h),a ;0768
  1336. ret ;076a
  1337. sub_076bh:
  1338. ld a,00ch ;076b
  1339. call moveout ;076d
  1340. ld bc,00878h ;0770
  1341. l0773h:
  1342. in a,(079h) ;0773
  1343. cp 007h ;0775
  1344. jr nz,l0773h ;0777
  1345. outi ;0779
  1346. jr nz,l0773h ;077b
  1347. jr reading2 ;077d
  1348. l077fh:
  1349. ld a,0e4h ;077f
  1350. call steproutine ;0781
  1351. ret z ;0784
  1352. jp l0681h ;0785
  1353. l0788h:
  1354. call reading ;0788
  1355. ret c ;078b
  1356. ld a,001h ;078c
  1357. call steproutine ;078e
  1358. ret z ;0791
  1359. jr l079dh ;0792
  1360. steproutine:
  1361. call moveout ;0794
  1362. call reading2 ;0797
  1363. and 002h ;079a
  1364. ret ;079c
  1365. l079dh:
  1366. call screenclearnetry2 ;079d
  1367. rst 10h ;07a0
  1368. ; BLOCK 'ERROR3' (start 0x07a1 end 0x07c9)
  1369. ERROR3_start:
  1370. defb 027h ;07a1 count 39
  1371. defb 045h ;07a2 Error 3: Disk Malfunction, Call Service
  1372. defb 072h ;07a3
  1373. defb 072h ;07a4
  1374. defb 06fh ;07a5
  1375. defb 072h ;07a6
  1376. defb 020h ;07a7
  1377. defb 033h ;07a8
  1378. defb 03ah ;07a9
  1379. defb 020h ;07aa
  1380. defb 044h ;07ab
  1381. defb 069h ;07ac
  1382. defb 073h ;07ad
  1383. defb 06bh ;07ae
  1384. defb 020h ;07af
  1385. defb 04dh ;07b0
  1386. defb 061h ;07b1
  1387. defb 06ch ;07b2
  1388. defb 066h ;07b3
  1389. defb 075h ;07b4
  1390. defb 06eh ;07b5
  1391. defb 063h ;07b6
  1392. defb 074h ;07b7
  1393. defb 069h ;07b8
  1394. defb 06fh ;07b9
  1395. defb 06eh ;07ba
  1396. defb 02ch ;07bb
  1397. defb 020h ;07bc
  1398. defb 043h ;07bd
  1399. defb 061h ;07be
  1400. defb 06ch ;07bf
  1401. defb 06ch ;07c0
  1402. defb 020h ;07c1
  1403. defb 053h ;07c2
  1404. defb 065h ;07c3
  1405. defb 072h ;07c4
  1406. defb 076h ;07c5
  1407. defb 069h ;07c6
  1408. defb 063h ;07c7
  1409. defb 065h ;07c8
  1410. ERROR3_end:
  1411. halt ;07c9
  1412. l07cah:
  1413. ld bc,00432h ;07ca
  1414. ld bc,00031h ;07cd
  1415. ld b,b ;07d0
  1416. dec bc ;07d1
  1417. ld b,000h ;07d2
  1418. sub l ;07d4
  1419. rst 38h ;07d5
  1420. l07d6h:
  1421. ld bc,00232h ;07d6
  1422. ld bc,00031h ;07d9
  1423. ld b,b ;07dc
  1424. dec bc ;07dd
  1425. ld b,000h ;07de
  1426. ld c,d ;07e0
  1427. rst 38h ;07e1
  1428. l07e2h:
  1429. nop ;07e2
  1430. nop ;07e3
  1431. ld c,d ;07e4
  1432. rst 38h ;07e5
  1433. rst 38h ;07e6
  1434. rst 38h ;07e7
  1435. rst 38h ;07e8
  1436. rst 38h ;07e9
  1437. rst 38h ;07ea
  1438. rst 38h ;07eb
  1439. rst 38h ;07ec
  1440. rst 38h ;07ed
  1441. rst 38h ;07ee
  1442. rst 38h ;07ef
  1443. rst 38h ;07f0
  1444. rst 38h ;07f1
  1445. rst 38h ;07f2
  1446. rst 38h ;07f3
  1447. rst 38h ;07f4
  1448. rst 38h ;07f5
  1449. rst 38h ;07f6
  1450. rst 38h ;07f7
  1451. rst 38h ;07f8
  1452. rst 38h ;07f9
  1453. rst 38h ;07fa
  1454. rst 38h ;07fb
  1455. rst 38h ;07fc
  1456. rst 38h ;07fd
  1457. rst 38h ;07fe
  1458. rst 38h ;07ff