
There is one thing left that the MOS does for DISKMON: actually reading a sector's bytes. Here it is, with the controller and nothing else.
The disc does not wait. Once the sector starts passing under the head the bytes come one after another, and each must be taken before the next arrives - so the loop is short, and interrupts are off. DISKMON counts the bytes, so you can see that all 512 arrived, and shows the final status.
H d t s - the sector may be a number or a letter, as for S:
After the line JP Z,CMDI, add:
CP 'H'
JP Z,CMDH
After the last line of CMDI5 (JP MAIN), add:
; H d t s: read a sector through the controller's ports, byte by byte.
CMDH: CALL GETDTS
JP C,WHAT
CALL FDCSEL
CALL FDCHOME
CALL FDCSEEK
LD A,(SSEC)
OUT (1AH),A ; the ID to look for
LD HL,SECBUF
LD DE,0
LD A,80H ; Read Sector
OUT (18H),A
CALL BUSYON
CMDH1: IN A,(18H)
BIT 1,A
JR NZ,CMDH2
BIT 0,A
JR NZ,CMDH1
JR CMDH3
CMDH2: IN A,(1BH)
LD (HL),A
INC HL
INC DE
JR CMDH1
CMDH3: LD (COUNT),DE
PUSH AF
CALL PUTBACK
LD HL,STATM
CALL PRINT
POP AF
CALL PHEX
LD HL,BYTESM
CALL PRINT
LD HL,(COUNT)
CALL PDEC
CALL NEWLINE
LD HL,SECBUF
LD BC,512
CALL SHOWBLK
JP MAIN
After the line IDSM: DEFB 'IDS: ',0, add:
STATM: DEFB 'STATUS ',0
BYTESM: DEFB ' BYTES ',0
Run it with a copy of SECRET.DSK in drive 1:
H 1 30 W
What you should see
> H 1 30 W
STATUS 80 BYTES 512
0000 54 52 41 43 4B 20 33 30 TRACK 30
0008 3A 20 54 48 49 53 20 53 : THIS S
0010 45 43 54 4F 52 27 53 20 ECTOR'S
0018 49 44 20 49 53 20 27 57 ID IS 'W
0020 27 20 28 35 37 48 29 0D ' (57H).
0028 0A 1A 1A 1A 1A 1A 1A 1A ........
0030 1A 1A 1A 1A 1A 1A 1A 1A ........
0038 1A 1A 1A 1A 1A 1A 1A 1A ........
0040 1A 1A 1A 1A 1A 1A 1A 1A ........
0048 1A 1A 1A 1A 1A 1A 1A 1A ........
0050 1A 1A 1A 1A 1A 1A 1A 1A ........
0058 1A 1A 1A 1A 1A 1A 1A 1A ........
0060 1A 1A 1A 1A 1A 1A 1A 1A ........
0068 1A 1A 1A 1A 1A 1A 1A 1A ........
0070 1A 1A 1A 1A 1A 1A 1A 1A ........
0078 1A 1A 1A 1A 1A 1A 1A 1A ........
(KEY)
512 bytes, status 80h, and the same sector S 1 30 W read through the MOS in S24.
H 1 2 0, then S 1 2 0. Should the two show the same bytes?CALL PUTBACK in CMDH, run H 1 30 W, then S 1 3 0. How many tries will S report (S26)?Read Sector, with the bytes taken one by one at port 1Bh: DISKMON reads a sector with no help from the BDOS or the MOS.
That is the whole of DISKMON. Appendix III has it in full; Appendices I and II gather what the primer measured about the BDOS and the MOS.
This form is protected by reCAPTCHA, and the Google Privacy Policy and Terms of Service apply.