
Booted, DISKMON's T would CALL 5 - and there is nothing at 0005h to call. The machine would stop in the MOS's register display. DISKMON needs to know whether it has a DOS, and to refuse politely when it has not.
Under XtalDOS, 0005h holds C3: the JP to the BDOS. Booted with no DOS, the MOS leaves FFh there. So START looks at 0005h once and keeps the answer in HASDOS. NEEDDOS - which every BDOS command has called since S7 - now checks it and says NEEDS THE DOS instead of calling 5.
Q changes too: with a DOS, it returns to 0:; with none, there is nothing to return to, so it says STOPPED and waits there until you reset the machine.
| Under XtalDOS | Booted | |
|---|---|---|
| Your program and data | 0100h up to E0FFh (EBFFh if you end with JP 0) | 0100h up to FAFFh |
| The system's | E100h up: the DOS; FB00h up: the MOS | FB00h up: the MOS's scratch-pad and stack |
Booted, nearly all of memory is yours. DISKMON's buffers at 8000h are fine either way.
After the last line of START (CALL PRINT), add:
XOR A ; is there a DOS? 0005h holds JP (C3h) if so
LD (HASDOS),A
LD A,(0005H)
CP 0C3H
JR NZ,NODOS
LD A,1
LD (HASDOS),A
JR MAIN
NODOS: LD HL,NODOSM
CALL PRINT
After the line QUIT:, add:
LD A,(HASDOS)
OR A
JR NZ,QUIT1
LD HL,STOPM ; no DOS to go back to
CALL PRINT
STOP: JR STOP
QUIT1:
After the line NEEDDOS:, add:
LD A,(HASDOS)
OR A
RET NZ
LD HL,NEEDM
JP DONE
After the line BOOTM: DEFB ' SECTORS WRITTEN TO TRACK 0',13,10,0, add:
HASDOS: DEFB 0
NODOSM: DEFB 'NO DOS: SECTORS ONLY',13,10,0
NEEDM: DEFB 'NEEDS THE DOS',13,10,0
STOPM: DEFB 'STOPPED',13,10,0
Run it: as in S20, B to work.mfi, then boot it in drive 0.
T 0:POEM.TXT
S 0 0 0
Q
What you should see
> T 0:POEM.TXT
NEEDS THE DOS
> S 0 0 0
0000 F9 00 DA 09 00 01 00 ED ........
0008 73 71 08 31 00 90 21 57 sq.1..!W
0010 08 CD 57 07 AF 32 A8 09 ..W..2..
0018 3A 05 00 FE C3 20 07 3E :.... .>
0020 01 32 A8 09 18 06 21 A9 .2....!.
0028 09 CD 57 07 31 00 90 21 ..W.1..!
0030 61 08 CD 57 07 CD 8F 06 a..W....
0038 CD 69 07 CD B7 06 B7 28 .i.....(
0040 EB 23 22 73 08 FE 51 CA .#"s..Q.
0048 A2 01 FE 46 CA B5 01 FE ...F....
0050 4F CA CA 01 FE 54 CA 02 O....T..
0058 02 FE 52 CA 5C 02 FE 57 ..R.\..W
0060 CA AC 02 FE 45 CA 14 03 ....E...
0068 FE 4E CA 36 03 FE 50 CA .N.6..P.
0070 70 03 FE 53 CA B0 03 FE p..S....
0078 2B CA FD 03 FE 44 CA 30 +....D.0
(KEY)
NO DOS: SECTORS ONLY at the start; T refused; and track 0 sector 0 - DISKMON's own header, F9 00 (start), the end address, 00 01 (jump) - followed by DISKMON itself.
START find at 0005h, and does T work?One byte at 0005h tells a program whether it has a DOS. Without one it has the MOS, and almost all of memory.
S22: keeping data on disc and reading it as needed, with no DOS - Blackwater Hall's pattern, by hand.
This form is protected by reCAPTCHA, and the Google Privacy Policy and Terms of Service apply.