IBM Personal Computer MACRO Assembler
Version 2.00
DSKETTE - -
01 /10/86
0 I SKETTE ADAPTER B I OS
1-20
01-10-86
J28A:
I SSUE RECALl BRATE FOR 80 TRACK 0 I SKETTES
DR I VE I SIN SYNCHRON I ZA TI ON WITH CONTROLLER,
SEEK TO TRACK
I F REQUEST FOR DR I VE
>
2
DO SEEK EVERY T I ME
SAVE NEW CYLI NDER AS PRESENT POS I TI ON
CHECK FOR SEEK TO TRACK 0
HEAD SETTLE, CY
=
0
I F JUMP
CLEAR OUT INVALID STATUS
RECAL I BRATE DR I VE
IF RECAL I BRATE FA I LS TW I CE THEN ERROR
TURN ON THE NO RECAL I BRATE BIT I N FLAG
RECAL I BRATE DR I VE
RECAL I BRATE DONE
BX
=
DRIVE #
LOAD RETURN ADDRESS
ON STACK FOR NEC OUTPUT ERROR
ESTABL I SH MASK FOR RECAL I BRATE TEST
GET DR I VE VALUE INTO CL
SH I FT MASK BY THE DR I VE VALUE
RECOVER TRACK VALUE
TEST FOR RECALIBRATE REQUIRED
JUMP IF RECAL I BRATE NOT REQU I RED
GET BYTE TO OUTPUT
DATA PORT
=
STATUS PORT + 1
OUTPUT THE BYTE
RESTORE REG.
CY
=
0 FROM TEST I NSTRUCT I ON
RESTORE REG.
DISCARD THE RETURN ADDRESS
I NO I CATE ERROR TO CALLER
GET STATUS
KEEP STATUS AND DIRECTION
STATUS 1 AND DIRECTION 0
?
STATUS AND DIRECTION OK
CONT I NUE TILL CX EXHAUSTED
DECREMENT COUNTER
REPEAT TILL DELAY FINISHED, CX
=
0
SAVE REG.
STATUS PORT
HIGH ORDER COUNTER
COUNT FOR T I ME OUT
01,1
R8
ODSK TRK[DI] ,0
CH,CH
DO_WA I T
ODSKETTE STATUS, 0
RECAL
-
RB
OSEEK STATUS, AL
RECAL-
AFT_RECAL
01
=
DR IVE #
CH
=
TRACK #
BX
ENDP
AL,AH
OX
DX,AL
BX
AX
AL,DX
AL, 1 1000000B
AL, 10000000B
J21
J23
BL
J23
CMP
01,1
I F REQUEST FOR DR I VE
>
2
JA
R8
DO SEEK EVERY T I ME
TEST
ODSK_STATE[DI] ,DBL_STEP
CHECK FOR DOUBLE STEP REQU I RED
JZ
R1
SINGLE STEP REQUIRED BYPASS DOUBLE
SHL
CH,I
DOUBLE NUMBER OF STEP TO TAKE
CMP
CH,ODSK_TRK[DI]
SEE I F ALREADY AT THE DES I RED TRACK
JE
RB
I F YES, DO NOT NEED TO SEEK
MOV
ODSK_TRK[DI] ,CH
SAVE NEW CYL I NDER AS PRESENT POS I T I ON
PUSH
CX
SAVE CYL I NDER ,
MOV
AH,OFH
SEEK COMMAND TO NEC
CALL
NEC OUTPUT
MOV
BX,OI
BX
=
DRIVE #
MOV
AH,BL
OUTPUT DR I VE NUMBER
CALL
NEC_OUTPUT
POP
AX
RESTORE CYLI NDER # FOR NEC_OUTPUT
CALL
NEC OUTPUT
CALL
CHK:STAT_2
ENDING INTERRUPT AND SENSE STATUS
OR
CALL
JNC
I
TH I S ROUT I NE WILL MOVE THE HEAD ON THE NAMED DR I VE
I
TO THE NAMED TRACK.
I F THE DR I VE HAS NOT BEEN ACCESSED
I
SINCE THE DR I VE RESET COMMAND WAS
ISSUED, THE DR I VE
I
WILL BE RECALIBRATED.
I
:
I
I
:
ODSKETTE STATUS, CY REFLECT STATUS OF OPERATION.
I
AX, BX, CX-;-DX DESTROYED
I
MOV
INC
OUT
DIRECT I ON AND STATUS OK; OUTPUT BYTE
POP
POP
STC
RET
FALL THRU TO ERROR RETURN
IN
AND
CMP
JZ
LOOP
DEC
JNZ
SEEK
ON EXIT:
ON ENTRY:
MOV
CALL
JC
AFT RECAL:
-
CMP
JA
MOV
OR
JZ
.
-
-
-
-
-
---
-
-- -
-
- - - -
-
-
-
- -
-
- -
- --
-
-
- - -
-
-
- ---
-
- - - -
--
--
-
-
-
-
---
-- - - -
- -
--
SEEK
PROC
NEAR
MOV
BX,DI
MOV
OX, OFFSET NEC ERR
PUSH
OX
-
MOV
AL,I
XCHG
CL,BL
ROL
AL,CL
XCHG
CL,BL
TEST
AL,OSEEK STATUS
JNZ
J28A
-
R1:
TEST I NG FOR CORRECT 0 I RECT I ON AND CONTROLLER READY TH I S
I
ROUT I NE WILL TI ME OUT I F THE BYTE I S NOT ACCEPTED WITH I N
I
A REASONABLE AMOUNT OF T I ME,
SETT I NG THE 0 I SKETTE STATUS
I
ON COMPLET I ON •
I
I
ON ENTRY:
I
AH
=
BYTE TO BE OUTPUT
I
ON EXIT:
:
CY
=
0
SUCCESS
I
CY
=
1
FA I LURE -- 0 I SKETTE STATUS UPDATED
I
I F A FA I LURE HAS OCCURRED, THE RETURN I S MADE
I
ONE LEVEL HIGHER THAN THE CALLER OF NEC OUTPUT.
I
TH I S REMOVES THE REQU I REMENT OF TEST I NG-AFTER
I
EVERY CALL OF NEC OUTPUT.
I
AX, CX, OX DESTROYED
-
I
J21:
R8:
POP
RET
NEC_OUTPUT
J23:
.
- -
-
--
-
-------
-
- -- -
-
- - - -
---
- -- -
--
-
-
-
--
- -
--
- - -- - - - - - - - -
-
- - - -
-
- - ---
NEC OUTPUT
PROC
NEAR
-
PUSH
BX
MOV
OX, 03F4H
MOV
BL,2
XOR
CX ,CX
2114
2115
2116
2111
2118
2119
2120
2121
2122
2123
2124
2125
2126
2121
2128
2129
2130 09FO
2131
09FO 53
2132 09F 1 BA 03F4
2133 09F4 B3 02
2134 09F6 33 C9
2135
2136 09F8 EC
2131 09F9 24 CO
2138 09FB 3C 80
2139 09FD 14 OF
2140 09FF E2 F1
2141
2142 OAOI FE CB
2143 OA03 15 F3
2144
2145
2146
2141 OA05 80 OE 0041
R 80
2148
2149 OAOA 5B
2150
2151
OAOB 58
2152 OAOC F9
2153 OAOD C3
2154
2155
2156
2151 OAOE 8A C4
2158 OA 10 42
2159 OA 11 EE
2160
2161
OA 12 5B
2162 OA 13 C3
2163 OA 14
2164
2165
2166
2161
2168
2169
2110
2111
2112
2113
2114
2115
2116
2111 OA 14
2118 OA 14 8B OF
2119 OA 16 BA OA 1B R
2180 OA 19 52
2181
OAIA BO 01
2182 OA 1C 86 CB
2183 OA 1E 02 CO
2184 OA20 86 CB
2185 OA22 84 06 003E R
2186 OA26 15 21
2181
2188 OA28 08 06 003E R
2189 OA2C E8 OA 1C R
2190 OA2F 13 OA
2191
2192
2193
2194 OA31 C6 06 0041 R 00
2195 OA36 E8 OA 1C R
2196 OA39 12 3F
2191
2198 OA3B
2199 OA3B 83 FF 01
2200 OA3E 11 21
2201
OA40 C6 85 0094 R 00
2202 OA45 OA ED
2203 OA41 14 2C
2204
2205
2206
2201 OA49
2208 OA49 83 FF 01
2209 OA4C 11 13
2210 OA4E F6 85 0090 R 20
2211
OA53 14 02
2212 OA55 DO E5
2213
2214 OA51 3A AD 0094 R
2215 OA5B 14 10
2216
2211 OA5D 88 AD 0094 R
2218 OA61
2219 OA61
51
2220 OA62 B4 OF
2221
OA64 E8 09FO R
2222 OA61 8B OF
2223 OA69 8A E3
2224 OA6B E8 09FO R
2225 OA6E 58
2226 OA6F E8 09FO R
2221 OA 12 E8 OA93 R
5-42
DISKETTE (01/10/86)