| 网站首页 | 业界新闻 | 小组 | 威客 | 人才 | 下载频道 | 博客 | 代码贴 | 在线编程 | 编程论坛
欢迎加入我们,一同切磋技术
用户名:   
 
密 码:  
共有 922 人关注过本帖
标题:汇编“高手”进
只看楼主 加入收藏
taoran
Rank: 1
等 级:新手上路
帖 子:1
专家分:0
注 册:2005-12-10
收藏
 问题点数:0 回复次数:1 
汇编“高手”进

不知道哪里出错了, 高手帮我一下。带注解谢谢各位大侠
双击可执行程序RQSZ.exe,在出现的提示信息中输入大写字母“D”,可
显示系统当前日期;输入大写字母“T”,可显示系统当前时间;输入大写字母
“Q”,可结束程序

STACK SEGMENT STACK
DW 200 DUP (?)
STACK ENDS
DATA SEGMENT
SPACE DB 1000 DUP (' ')
PATTERN DB 6 DUP (' '),0C9H,26 DUP (0CDH),0BBH,6 DUP (' ')
DB 6 DUP (' '),0BAH,26 DUP (20H),0BAH,6 DUP (' ')
DB 6 DUP (' '),0C8H,26 DUP (0CDH),0BCH,6 DUP (' ')
DBUFFER DB 8 DUP (':'),12 DUP (' ')
DBUFFER1 DB 20 DUP (' ')
STR DB 0DH,0AH, 'PLEASE INPUT DATE(D) OR TIME(T) OR QUIT(Q): $'
DATA ENDS
CODE SEGMENT
ASSUME CS:CODE,DS:DATA,ES:DATA,SS:STACK
START: MOV AX,0001H
INT 10H
MOV AX,DATA
MOV DS,AX
MOV ES,AX
MOV BP,OFFSET SPACE
MOV DX,0B00H
MOV CX,1000
MOV BX,0040H
MOV AX,1300H
INT 10H
MOV BP,OFFSET PATTERN
MOV DX,0B00H
MOV CX,120
MOV BX,004EH
MOV AX,1301H
INT 10H
LEA DX,STR
MOV AH,9
INT 21H
MOV AH,1
INT 21H
CMP AL,44H
JNE A
CALL DATE
A: CMP AL,54H
JNE B
CALL TIME
B: CMP AL,51H
JNE START
MOV AH,4CH
INT 21H

DATE PROC NEAR
DISPLAY:MOV AH,2AH
INT 21H
MOV SI,0
MOV AX,CX
MOV BX,100
DIV BL
MOV BL,AH
CALL BCDASC1
MOV AL,BL
CALL BCDASC1
INC SI
MOV AL,DH
CALL BCDASC1
INC SI
MOV AL,DL
CALL BCDASC1
MOV BP,OFFSET DBUFFER1
MOV DX,0C0DH
MOV CX,20
MOV BX,004EH
MOV AX,1301H
INT 10H
MOV AH,02H
MOV DX,0300H
MOV BH,0
INT 10H
MOV BX,0018H
REPEA: MOV CX,0FFFFH
REPEAT:LOOP REPEAT
DEC BX
JNZ REPEA
MOV AH,01H
INT 16H
JE DISPLAY
JMP START
MOV AX,4C00H
INT 21H
RET
DATE ENDP

TIME PROC NEAR
DISPLAY1:MOV SI,0
MOV BX,100
DIV BL
MOV AH,2CH
INT 21H
MOV AL,CH
CALL BCDASC
INC SI
MOV AL,CL
CALL BCDASC
INC SI
MOV AL,DH
CALL BCDASC
MOV BP,OFFSET DBUFFER
MOV DX,0C0DH
MOV CX,20
MOV BX,004EH
MOV AX,1301H
INT 10H
MOV AH,02H
MOV DX,0300H
MOV BH,0
INT 10H
MOV BX,0018H
RE: MOV CX,0FFFFH
REA: LOOP REA
DEC BX
JNZ RE
MOV AH,01H
INT 16H
JE DISPLAY1
JMP START
MOV AX,4C00H
INT 21H
RET
TIME ENDP

BCDASC PROC NEAR
PUSH BX
CBW
MOV BL,10
DIV BL
ADD AL,'0'
MOV DBUFFER[SI],AL
INC SI
ADD AH,'0'
MOV DBUFFER[SI],AH
INC SI
POP BX
RET
BCDASC ENDP

BCDASC1 PROC NEAR
PUSH BX
CBW
MOV BL,10
DIV BL
ADD AL,'0'
MOV DBUFFER1[SI],AL
INC SI
ADD AH,'0'
MOV DBUFFER1[SI],AH
INC SI
POP BX
RET
BCDASC1 ENDP
CODE ENDS
END START


搜索更多相关主题的帖子: DUP STACK SEGMENT 
2005-12-10 11:11
dayong98
Rank: 1
等 级:新手上路
帖 子:8
专家分:0
注 册:2005-11-21
收藏
得分:0 

你只测试输入是否大写的D,T,Q了。输入大写D有显示的


汇编~从今天开始
2005-12-22 00:03
快速回复:汇编“高手”进
数据加载中...
 
   



关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.029792 second(s), 9 queries.
Copyright©2004-2024, BCCN.NET, All Rights Reserved