monroe_oc8820_r3.00.asm 28 KB

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