写的书上的一个案例,代码和图都是按照书上写的,但是功能实现不了,8253A没有输出
代码:
DATAS SEGMENT
CTR EQU 203H
T0 EQU 82H
DATAS ENDS
STACKS SEGMENT STACK
DW 128 DUP(?)
STACKS ENDS
CODE SEGMENT PUBLIC 'CODE'
ASSUME CS:CODE,DS:DATAS
START:
MOV AX,DATAS
MOV DS,AX
MOV AL,T0
MOV DX,CTR
OUT DX,AL
K1:
MOV DX,201H
IN AL,DX
TEST AL,01H
JNZ K2
MOV AX,2273
JMP DDD
K2:
IN AL,DX
TEST AL,02H
JNZ K3
MOV AX,2024
JMP DDD
K3:
IN AL,DX
TEST AL,04H
JNZ K4
MOV AX,1805
JMP DDD
K4:
IN AL,DX
TEST AL,08H
JNZ K5
MOV AX,1704
JMP DDD
K5:
IN AL,DX
TEST AL,10H
JNZ K6
MOV AX,1517
JMP DDD
K6:
IN AL,DX
TEST AL,20H
JNZ K3
MOV AX,1353
JMP DDD
K7:
IN AL,DX
TEST AL,40H
JNZ K3
MOV AX,1205
JMP DDD
K8:
IN AL,DX
TEST AL,80H
JNZ K3
MOV AX,1136
JMP DDD
DDD:
CALL OUTTONE
CALL DELAY
MOV AX,2
CALL OUTTONE
JMP K1
OUTTONE PROC NEAR
PUSH AX
MOV DX,20BH
OUT DX,AL
POP AX
MOV DX,209H
OUT DX,AL
MOV AL,AH
OUT DX,AL
RET
OUTTONE ENDP
DELAY PROC NEAR
MOV CX,60000
LOOP $
RET
DELAY ENDP
ENDLESS:
JMP ENDLESS
CODE ENDS
END START
文件都发了附件
-
-
-
Documents.rar
下载积分: 积分 -1 分
48.43 KB, 下载次数: 25, 下载积分: 积分 -1 分
白白花了积分和时间,下载到的附件中没有 HEX 程序文件!
真DAODAN!
一周热门 更多>