Assembler







. ,
, ,
().
,
.
 
IBM
FDC (Floppy Disk Controller)
PD765 NEC. Intel
8272. FDC
. FDC -,
, .
3F4H, 3F5H. -
, ..
, .
. ,
.
 
2 ,
. 6 - - (DIO -
Data Input/Output). ,
. DIO
1, FDC . DIO
0, FDC . 7 -
(RQM - Request For Master).
"" . RQM
1, FDC ,
. RQM,
FDC ,
.
 
.
6845,
. 6845,
. ,
, . ,
,
.
 
,
.
FDC,
. , -
. . 8.19
, . 8.20 ,
.
 
----------------------------------
...................04H
.......00H
...........ST3 . 8.19
----------------------------------
A
Microsoft (R) Macro Assembler Version 5.00 1/1/80 04:06:03
. 8.20 Page 1-1
 
PAGE ,132
TITLE . 8.20
 
0000 STACK SEGMENT STACK
0000 0040[ DW 64 DUP (?)
????
]
0080 STACK ENDS
 
FDC_STATUS RECORD RQM:1, DIO:1, OTHER:6
 
0000 CODE SEGMENT
ASSUME CS:CODE
0000 SENSE PROC FAR
0000 1E PUSH DS ;
0001 2B C0 SUB AX, AX
0003 50 PUSH AX
 
0004 BA 03F4 MOV DX, 3F4H ;
0007 B4 04 MOV AH, 04H ;
0009 E8 001E R CALL OUTPUT ;
000C B4 00 MOV AH, 0 ;
000E E8 001E R CALL OUTPUT
 
;-----
 
0011 IN_DIO:
0011 EC IN AL, DX ; , DIO
0012 A8 80 TEST AL, MASK RQM ;
0014 74 FB JZ IN_DIO
0016 IN_RQM:
0016 EC IN AL, DX ; , RQM ,
0017 A8 80 TEST AL, MASK RQM ;
0019 74 FB JZ IN_RQM
 
001B 42 INC DX ;
001C EC IN AL, DX ;
001D CB RET ;
001E SENSE ENDP
 
;-----
 
001E OUTPUT PROC NEAR
001E EC IN AL, DX ; DIO
001F A8 40 TEST AL, MASK DIO ;
0021 75 FB JNZ OUTPUT
0023 OUT_RQM:
0023 EC IN AL, DX ; RQM ,
0024 A8 80 TEST AL, MASK RQM ;
0026 74 FB JZ OUT_RQM
 
0028 42 INC DX ;
0029 8A C4 MOV AL, AH ;
002B EE OUT DX, AL ;
002C 4A DEC DX ;
002D C3 RET
002E OUTPUT ENDP
002E CODE ENDS
END SENSEA
. 8.20
, ,
: , .
FDC , DIO.
FDC RQM,
,
. ,
FDC . , 04H,
. ,
. DIO ,
FDC , RQM
, .
 
.
.
. RQM
, .
DIO 1, ,
. RQM
.
DIO
0, .
 
,
- .
.
,
. ,
,
, .
 
- 3F2H
.
.
- .
5 1/4 , IBM PC,
.
- .
,
. ,
.
 

. .
FDC,
,
. -
.