本帖最后由 一只耳朵怪 于 2018-6-27 08:45 编辑
运行图是修改前截的,RD非等错误以修正,运行只显示23,另两位不显示也不会动 本人学生 不太会使用,求前辈大佬们帮帮忙
以下是程序
P85A_ADD EQU 01000000B ;
P85B_ADD EQU 01000010B ;
P85C_ADD EQU 01000100B ;
COM85_ADD EQU 01000110B ;
P83A_ADD EQU 01001000B ;
P83B_ADD EQU 01001010B ;
P83C_ADD EQU 01001100B ;
COM83_ADD EQU 01001110B ;
DATA SEGMENT
LED DB 0C0H,0F9H,0A4H,0B0H,99H,92H,82H,0F8H,80H,90H
X DW ?
Y DW ?
Z DW ?
DATA ENDS
CODE SEGMENT
ASSUME CS:CODE,DS:DATA
START: MOV AX,DATA
MOV DS,AX
MOV DX,COM85_ADD
MOV AL,10001001B ;
OUT DX,AL ;
NEXT: MOV X,50 ;
MOV Y,23
LEA SI,LED
MOV DX,COM83_ADD
MOV AL,00110001B ;
OUT DX,AL ;
REPEAT0:
MOV AL,00H ;
MOV DX,P83A_ADD ;
OUT DX,AL
MOV AL,10H ;
MOV DX,P83A_ADD ;
OUT DX,AL
REPEAT1: CALL CONVER ;
MOV DX,P85C_ADD
IN AL,DX ;
CMP AL,0FEH
JZ NEXT
TEST AL,80H ;
JNZ REPEAT1
REPEAT2: CALL CONVER
MOV DX,P85C_ADD
IN AL,DX
CMP AL,7EH
JZ NEXT
TEST AL,80H
JZ REPEAT2
CALL
tiME_JIA
JMP REPEAT0 ;
TIME_JIA PROC
INC X ;
CMP X,60
JNZ NEXT1
MOV X,0
INC Y
NEXT1: CMP Y,60
JNZ NEXT2
MOV Y,0
NEXT2: CALL CONVER ;
RET
TIME_JIA ENDP;
CONVER PROC ;
PUSH AX
PUSH BX
PUSH CX
PUSH DX
PUSH SI
PUSH BP
PUSHF
LEA SI,LED
MOV AX,Z
MOV CL,10
DIV CL ;
MOV BX,AX ;AH:BH AL:BL
MOV AL,20H
MOV DX,P85B_ADD
OUT DX, AL ;
MOV BP,BX
AND BP,0FFH ;
MOV AL,[SI+BP] ;
MOV DX,P85A_ADD
OUT DX,AL ;
CALL DELY
MOV AL, 10H ;
MOV DX,P85B_ADD
OUT DX,AL
XCHG BH,BL ;
MOV BP,BX
AND BP,0FFH ;
MOV AL,[SI+BP]
MOV DX,P85A_ADD
OUT DX,AL ;
CALL DELY
MOV AX,Y
MOV CL,10
DIV CL ;
MOV BX,AX ;AH:BH AL:BL
MOV AL,08H ;
MOV DX,P85B_ADD
OUT DX, AL
MOV BP,BX
AND BP,0FFH ;
MOV AL,[SI+BP] ;
MOV DX,P85A_ADD
OUT DX,AL ;
CALL DELY
MOV AL,04H ;
MOV DX,P85B_ADD
OUT DX,AL
XCHG BH,BL ;
MOV BP,BX
AND BP,0FFH ;
MOV AL,[SI+BP]
MOV DX,P85A_ADD
OUT DX,AL ;
CALL DELY
POPF ;
POP BP
POP SI
POP DX
POP CX
POP BX
POP AX
RET
CONVER ENDP
DELY PROC
PUSH CX
MOV CX,500
L: LOOP L
POP CX
RET
DELY ENDP
CODE ENDS
END START
-
-
一周热门 更多>