标题:[求助]这里AL的值怎么变化的?
取消只看楼主
hero2007
Rank: 1
来 自:湖北武汉
等 级:新手上路
威 望:1
帖 子:130
专家分:0
注 册:2007-3-22
 问题点数:0 回复次数:0 
[求助]这里AL的值怎么变化的?

DATAS SEGMENT
TAB DB 12H,83H,00H,0ABH,3AH,2CH,98H,0BEH,0B1H,0B2H,45H,65H,0DCH,88H,0DCH,88H,0DCH,88H
RESULT DB 100 DUP(?)
COUNT =RESULT-TAB
DATAS ENDS

STACKS SEGMENT
DB 200 DUP(?)
STACKS ENDS

CODES SEGMENT
ASSUME CS:CODES,DS:DATAS,SS:STACKS
START:
MOV AX,DATAS
MOV DS,AX

MOV AL,0
MOV CX,COUNT
LEA SI,TAB
LEA DI,RESULT

AGAIN: TEST BYTE PTR[SI],80H
JNZ A
MOV DL,BYTE PTR[SI]
MOV [DI],DL
INC SI
INC DI
LOOP AGAIN
JMP OUTA

A: INC AL
NEG BYTE PTR[SI]
MOV DL,BYTE PTR[SI]
MOV [DI],DL
INC SI
INC DI
LOOP AGAIN

OUTA: ADD AL,30H
CMP AL,39H
JA B
MOV AH,2
MOV DL,AL
INT 21H
JMP EXIT
B: ADD AL,07H

MOV DL,'0'
MOV AH,2
INT 21H

MOV AH,0
MOV DL,0
MOV AH,2
MOV DL,AL
INT 21H

MOV AH,2
MOV DL,'H'
INT 21H



EXIT: MOV AH,4CH
INT 21H
CODES ENDS
END START

为什么输出结果是00H,而不是0CH ?

如果改成:

B: ADD AL,07H
MOV BL,AL
MOV DL,'0'
MOV AH,2
INT 21H

MOV AH,0
MOV DL,0
MOV AH,2
MOV DL,BL
INT 21H

MOV AH,2
MOV DL,'H'
INT 21H

就能输出0CH

这里的AL的值怎么受到
MOV DL,'0'
MOV AH,2
INT 21H
影响而变为30H的?





搜索更多相关主题的帖子: STACKS SEGMENT MOV DATAS RESULT 
2007-10-09 09:17



参与讨论请移步原网站贴子:https://bbs.bccn.net/thread-176017-1-1.html




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

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