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,80H ;PA、 PB、 PC 为方式 0 输出
OUT DX,AL
MOV DX,PA_8255;
MOV AL,0FEH
START1: OUT DX,AL
CALL Delay
ROR AL,1
JMP START1
Delay PROC NEAR ;延时
Delay1: XOR CX,CX
LOOP $
RET
Delay ENDP
START ENDP
CODE ENDS
END START
实验原理图