LOC OB-JECT
LI NE
SOURCE
(B I OS FOR THE I BM PERSONAL COMPUTER XT)
I 1/08/82
INT
13 -------------------------------------------------------------
DISKETTE I/O
TH I S INTERFACE PROV I DES ACCESS TO THE 5
I /4 0 I SKETTE DR I YES
AH=5
AH=3
TEST _D I SK_ VERF
TEST 0 I SK VERF
AH=4-
-
BAD COMMAND
ERROR CODE,
NO SECTORS TRANSFERRED
UNDEF I NED OPERA T ION
SAVE
#
SECTORS
IN DH
INDICATE A READ OPERATION
AH=O
RESET THE STATUS
INDICATOR
TEST FOR DRIVE
IN 0-3 RANGE
ERROR
I F ABOVE
AH=2
SET UP PO I NTER TO HEAD PARM
SAVE SEGMENT REG IS TER VALUE
SAVE ALL REGISTERS DURING OPERATION
RECOVER ADDRESS
THROW AWAY SAVED FLAGS
I NTERRUPTS BACK ON
SAVE ADDRESS
CALL THE REST TO ENSURE DS RESTORED
GET THE MOTOR WA I T PARAMETER
SET THE T I MER COUNT FOR THE MOTOR
GET STATUS OF OPERATION
SET THE CARRY FLAG TO I ND I CATE
SUCCESS OR FAILURE
RESTORE ALL REG I STERS
FAR
NEAR
DH,AL
MOTOR STATUS, 07FH
AH,AH-
DISK RESET
AH
-
DISK STATUS
DISKETTE STATUS,O
DL,4
-
-J3
AH
DI SK READ
AH
-
-J2
DISK_WRITE
AH
DI SK VERF
AH
-
DISK _FORMA T
DISKETTE_STATUS ,BAD_CMD
DX
BP
DI
S I
DS
CX
BX
2
ENDP
BX
CX
OS
S I
01
BP
OX
BP,SP
DDS
-Jl
BX,4
GET PARM
MOTOR COUNT, AH
AH,DISKETTE STATUS
AH, I
-
CS :CODE ,OS :DATA ,ES :DATA
OEC59H
PROC
READ THE DES I RED SECTORS
I NTO MEMORY
WR I TE THE DES I RED SECTORS FROM MEMORY
VER I FY THE DES I RED SECTORS
FORMAT THE DES I RED TRACK
FOR THE FORMAT OPERAT I ON,
THE BUFFER PO INTER
(ES, BX)
MUST PO I NT TO THE COLLECT I ON OF DES I RED ADDRESS FIELDS
FOR THE TRACK.
EACH FIELD
I S COMPOSED OF 4 BYTES,
(C, H, R, N), WHERE C = TRACK NUMBER, H=HEAD NUMBER,
R = SECTOR NUMBER, N= NUMBER OF BYTES PER SECTOR
(00=128,
01=256,
02=512,
03=1024).
THERE MUST BE ONE
ENTRY FOR EVERY SECTOR ON THE TRACK.
TH I S I NFORMAT I ON
IS USED TO FIND THE REQUESTED SECTOR DURING READ/WRITE
ACCESS.
RESET 01 SKETTE SYSTEM
HARD RESET TO NEC, PREPARE COMMAND,
RECAL REQU I RED
ON ALL DR I YES
READ THE STATUS OF THE SYSTEM
INTO
(ALl
DISKETTE_STATUS FROM LAST OPERATION IS USED
MOV
RET
ENDP
DEC
-JZ
DEC
-JZ
PROC
MOV
AND
OR
-JZ
DEC
-JZ
MOV
CMP
-JAE
DEC
-JZ
DEC
-JNZ
-JMP
(AH) =2
(AH) =3
(AH) =4
(AH) =5
(AH) =1
(AH) =0
DA T A VAR I ABLE - -
0 I SK PO INTER
DOUBLE WORD PO I NTER TO THE CURRENT SET OF DISKETTE PARAMETERS
OUTPUT
AH = STATUS OF OPERATION
STATUS BITS ARE DEFINED
IN THE EQUATES FOR
DISKETTE STATUS VAR I ABLE
I N THE DATA SEGMENT OF TH IS
MODULE. -
CY = 0
SUCCESSFUL OPERATION
(AH=O ON RETURN)
CY =
1
FAILED OPERATION
(AH HAS ERROR REASON)
FOR READ/WRITE/VERIFY
DS,BX,DX,CH,CL PRESERVED
AL = NUMBER OF SECTORS ACTUALLY READ
• • • •• AL MA Y NOT BE CORRECT 1FT I ME OUT ERROR OCCUR S
NOTE:
I F AN ERROR
I S REPORTED BY THE DISKETTE CODE, THE
APPROPR I ATE ACT I ON I S TO RESET THE DISKETTE,
THEN RETRY
THE OPERATION. ON READ ACCESSES, NO MOTOR START DELAY
1STAKEN ,
SO THAT THREE RETR IE S ARE REQU I RED ON READ S
TO ENSURE THAT THE PROBLEM I S NOT DUE TO MOTOR
START-UP.
INPUT
REGISTERS FOR READ/WRITE/VERIFY/FORMAT
( DL )
-
DR I VE NUMBER
(0 - 3 ALLOWED,
VALUE CHECKED)
(DH)
-
HEAD NUMBER
(0 - I
ALLOWED, NOT VALUE CHECKED)
(CH)
-
TRACK NUMBER
(0-39, NOT VALUE CHECKED)
(CLl
-
SECTOR NUMBER
(1-8, NOT VALUE CHECKED,
NOT USED FOR FORMAT)
(ALl
-
NUMBER OF SECTORS
( MAX = 8, NOT VALUE CHECKED, NOT USED
FOR FORMAT)
(ES: BX)
-
ADDRESS OF BUFFER
( NOT REQU I RED FOR VER I FY)
ASSUME
ORG
DISKETTE 10
STI
PUSH
PUSH
PUSH
PUSH
PUSH
PUSH
PUSH
MOV
CALL
CALL
MOV
CALL
MOV
MOV
CMP
CMC
POP
POP
POP
POP
POP
POP
POP
RET
DISKETTE_IO
2302
2303
2304
2305
2306
2307
2308
2309
2310
231 I
2312
2313
2314
2315
2316
2317
2318
2319
2320
2321
2322
2323
2324
2325
2326
2327
2328
2329
2330
2331
2332
2333
2334
2335
2336
2337
2338
2339
2340
2341
2342
2343
2344
2345
2346
2347
2348
2349
2350
2351
2352
2353
2354
2355
2356
2357
2358
2359
2360
2361
2362
2363
2364
2365
2366
2367
2368
2369
2370
2371
2372
2373
2374
2375
2376
2377
2378
2379
2380
2381
2382
2383
2384
2385
2386
2387
2388
2389
2390
2391
2392
2393
2394
2395
2396
2397
2398
2399
2400
240 I
2402
-J2:
2403
2404
2405
2406
2407
-J3:
2408
2409
2410
2411
EC85
EC85 8AFO
EC87 80263F007F
EC8C OAE4
EC8E 7427
EC90 FECC
EC92 7473
EC94 C606410000
EC99 80FA04
EC9C 7313
EC9E FECC
ECAO 7469
ECA2 FECC
ECA4 7503
ECA6 E99500
ECA9
ECA9 FECC
ECAB 7467
ECAD FECC
ECAF 7467
ECBl
ECB 1 C60641 000 I
ECB6 C3
EC59
EC59
EC59 FB
EC5A 53
EC5B 51
EC5C
IE
EC5D 56
EC5E 57
EC5F 55
EC60 52
EC61
8BEC
EC63 E8F30D
EC66 E81 COO
EC69 BB0400
EC6C E8FDO I
EC6F 88264000
EC73 8A264100
EC77 80FCOI
EC7A F5
EC7B 5A
EC7C 5D
EC7D 5F
EC7E 5E
EC7F
IF
EC80 59
EC81
5B
EC82 CA0200
5-138
PC-XT System BIOS (11/08/82)