COM_8255 EQU 0273H ;8255 控制口
PA_8255 EQU 0270H
PB_8255 EQU 0271H
PC_8255 EQU 0272H
_STACK SEGMENT STACK
DW 100 DUP(?)
_STACK ENDS
DATA SEGMENT WORD PUBLIC 'DATA'
DATA ENDS
CODE SEGMENT
START PROC NEAR
ASSUME CS:CODE, DS:DATA, SS:_STACK
MOV AX,DATA
MOV DS,AX
NOP
MOV DX,COM_8255
MOV AL,82H ;PB 方式 0 输入, PA 方式 0 输出,
OUT DX,AL
START1: MOV DX,PB_8255 ;
IN AL,DX
MOV DX,PA_8255
OUT DX,AL
CALL Delay
JMP START1
Delay PROC NEAR ;延时
Delay1: XOR CX,CX
LOOP $
RET
Delay ENDP
START ENDP
CODE ENDS
END START
实验原理图
标签:8255,上机,汇编语言,EQU,MOV,DX,DATA,STACK,调试 From: https://blog.51cto.com/u_16147979/7279141