汽车速度控制系统(框图+电路图+流程图+源程序) 第6页
附录:附录1:程序清单
DATA SEGMENT
NO1 DB 2,5
NO2 DB 5,7
NO3 DB 10,20
SCAN1 DB ?
SCAN2 DB ?
SCAN3 DB ?
TABLE DB 0C0H,0F9H,0A4H,0B0H,099H,92H,82H
DB 0F8H,080H,90H,88H,83H,0C6H,0A1H
DB 86H,8EH,0FFH,8CH,89H,8EH,0BFH,0F7H ;;;LED显示码
P8255_A DW 0020H
P8255_B DW 0021H
P8255_C DW 0022H
P8255_CR DW 0023H
DATA ENDS
STACK SEGMENT
DW 100 DUP (?)
STACK ENDS
CODE SEGMENT
ASSUME CS:CODE,DS:DATA
START:MOV AX,DATA
MOV DS,AX
MOV DX,P8255_CR
MOV AL,82H
OUT DX,AL
PUSH DS
MOV AX,0000h
MOV DS,AX
MOV BX,0008H
LEA AX,INTPROC
MOV [BX],AX
MOV AX,SEG INTPROC
MOV [BX+2],AX
POP DS 本文源自辣文论文网 ;中断初始化
A1: MOV DX,P8255_B
IN AL,DX
CMP AL,0FEH
JNE A2
MOV PC5,0 ;发光二极管亮
LEA BX,NO1
MOV SCAN1,5
MOV DX,P8255_C
MOV AL,20H
OUT DX,AL
CALL DISPLAY
CALL FUNCTION
A2: MOV DX,P8255_B
IN AL,DX
CMP AL,0FDH
JNE A3
MOV PC6,0 ;发光二极管亮
LEA BX,NO2
MOV SCAN1,5
MOV SCAN2,2
MOV DX,P8255_C
MOV AL,40H
OUT DX,AL
CALL DISPLAY
CALL FUNCTION
A3: MOV DX,P8255_B
IN AL,DX
CMP AL,0FBH
JNE A1
MOV PC7,0 ;发光二极管亮
LEA BX,NO3
MOV SCAN1,0
MOV SCAN2,6
MOV DX,P8255_C
MOV AL,80H
OUT DX,AL
CALL DISPLAY
CALL FUNCTION
MOV AH,4CH
INT 21H
DISPLAY PROC FAR
PUSH DX
PUSH CX
PUSH BX
PUSH AX ;保护现场
MOV DX,P8255_C
MOV AL,04H
OUT DX,AL ;KL1位选择
毕业论文
http://www.751com.cn/LOOP $
MOV DX,P8255_C
MOV AL,02H
OUT DX,AL ;KL2位选择
MOV DX,P8255_A
MOV AL,SCAN2
XLAT
OUT DX,AL ;显示字段
MOV CX,000H
LOOP $
MOV DX,P8255_C
MOV AL,01H
OUT DX,AL ;KL3位选择
MOV DX,P8255_A
MOV AL,SCAN3
XLAT
OUT DX,AL ;显示字段
MOV CX,000H
LOOP $
POP AX
POP BX
POP CX
POP DX ;出栈
RET
DISPLAY ENDP
FUNCTION PROC FAR
A4: CALL DISPLAY
MOV DX,P8255_B
IN AL,DX
CMP AL,0F7H
JE MJ1
上一页 [1] [2] [3] [4] [5] [6]
汽车速度控制系统(框图+电路图+流程图+源程序) 第6页下载如图片无法显示或论文不完整,请联系qq752018766