Assembler

.






IBM PC .
, ,
.
,
IBM PC.
 

.
ACE (Asynchronous Communication Element) 8250

. ACE
, ,
.
( -
).
 
ACE
. ,
, .
, .
, ,
,
. ,
ACE .
 
,
ACE 8250.
.
ACE .

. east-font-family:"MS Mincho"'>
. 8.16 ,
ACE,
. - 3F8H,
ACE 3F8H 3FEH.
IBM ,
- 2F8H
2FEH.

. ,
, .
:
, .
 
- ACE
. , , 3F8H,
- ,
, ,
, ACE.
- . ,
,
-. ACE ,
,
50 9600 . 3F8H
.

Microsoft (R) Macro Assembler Version 5.00 1/1/80 04:05:45
. 8.16 Page 1-1
 
 
PAGE ,132
TITLE . 8.16
 
0000 STACK SEGMENT STACK
0000 0040[ DW 64 DUP (?)
????
]
0080 STACK ENDS
 
= 03F8 SERIAL EQU 03F8H
 
0000 CODE SEGMENT
ASSUME CS:CODE
0000 ASYNC PROC FAR
0000 1E PUSH DS ;
0001 2B C0 SUB AX,AX
0003 50 PUSH AX
0004 BA 03FB MOV DX,SERIAL+3 ;
0007 B0 80 MOV AL,80H
0009 EE OUT DX,AL ;
000A B8 0180 MOV AX,384 ; 300
000D BA 03F8 MOV DX,SERIAL
0010 EE OUT DX,AL ;
0011 8A C4 MOV AL,AH
 
. 8.16 ()
0013 42 INC DX
0014 EE OUT DX,AL ;
0015 BA 03FB MOV DX,SERIAL+3 ;
0018 B0 03 MOV AL,00000011b ; ,8
001A EE OUT DX,AL
 
;-----
 
001B BA 03FD MOV DX,SERIAL+5 ;
001E SEND:
001E EC IN AL,DX
001F A8 20 TEST AL,20H
0021 74 FB JZ SEND
0023 B0 41 MOV AL,'A'
0025 BA 03F8 MOV DX,SERIAL
0028 EE OUT DX,AL
 
;-----
 
0029 BA 03FD MOV DX,SERIAL+5 ;
002C RECV:
002C EC IN AL,DX
002D A8 02 TEST AL,2
002F 74 FB JZ RECV
0031 BA 03F8 MOV DX,SERIAL
0034 EC IN AL,DX
 
0035 CB RET
0036 ASYNC ENDP
0036 CODE ENDS
END ASYNC
 
.8.16 ,
()
 
ACE
8250. .
, 384, 300 .
,
1 7 3FBH.
3FBH .

Microsoft (R) Macro Assembler Version 5.00 1/1/80 04:05:50
. 8.17 Page 1-1
 
 
PAGE ,132
TITLE . 8.17
 
0000 ABS0 SEGMENT AT 0
002C ORG 0BH*4
002C ASYNC_INTERRUPT LABEL WORD
002C ABS0 ENDS
 
0000 STACK SEGMENT STACK
 
. 8.17 ()
0000 0040[ DW 64 DUP (?)
????
]
0080 STACK ENDS
 
0000 CODE SEGMENT
ASSUME CS:CODE
0000 0049 R BUFFER_POINTER DW BUFFER
 
0002 SET_INTERRUPT PROC FAR
0002 2B C0 SUB AX,AX
0004 8E D8 MOV DS,AX
ASSUME DS:ABS0 ; DS
;
;-----
0006 C7 06 002C R 0024 R MOV ASYNC_INTERRUPT,offset INT_HANDLER
000C 8C 0E 002C R MOV ASYNC_INTERRUPT,CS ;
 
0010 BA 03F9 MOV DX,03F9H ;
0013 B0 04 MOV AL,04H ;
0015 EE OUT DX,AL
 
0016 E4 21 IN AL,21H ; 8259
0018 24 F7 AND AL,0F7H ; 0 3
001A E6 21 OUT 21H,AL ;
 
001C BA 03FC MOV DX,3FCH ;
001F B0 08 MOV AL,08H ; OUT2
0021 EE OUT DX,AL
 
0022 EB FE HERE: JMP HERE ; -
0024 SET_INTERRUPT ENDP ; ,
 
;-----
 
0024 INT_HANDLER PROC FAR
0024 50 PUSH AX ;
0025 53 PUSH BX
0026 52 PUSH DX
0027 BA 03FD MOV DX,3FDH ;
002A EC IN AL,DX
002B A8 01 TEST AL,01H ; ?
002D 74 12 JZ INT_RETURN ; ,
002F BA 03F8 MOV DX,3F8H ;
0032 EC IN AL,DX ;
0033 2E: 8B 1E 0000 R MOV BX,BUFFER_POINTER
0038 2E: 88 07 MOV CS:[BX],AL ;
003B 43 INC BX
003C 2E: 89 1E 0000 R MOV BUFFER_POINTER,BX
0041 INT_RETURN:
0041 5A POP DX ;
0042 5B POP BX
0043 B0 20 MOV AL,20H ;
 
. 8.17 ()
0045 E6 20 OUT 20H,AL
0047 58 POP AX
0048 CF IRET ;
0049 INT_HANDLER ENDP
0049 0080[ BUFFER DB 128 DUP (?)
??
]
 
 
00C9 CODE ENDS
END SET_INTERRUPT
 
. 8.17 ()
 
.
- 3FDH
. ,
, ; ,
, .
 
.
OUT2
ACE .
ACE ,
.
3 8259.
 
,
, . . 8.17
,
. ,
, 3
8259 ( 0BH 58H),
. ,
. ACE 8250
,
. ,
OUT2,
. ,
. .
8.17 ,
.