汇编
时间:2010-12-11
来源:互联网
data segment
table db 30h,31h,32h,33h,34h,35h,36h,37h
db 38h,39h,41h,42h,43h,44h,45h,46h
hex db 9
asci db ?
data ends
code segment
assume cs:code, ds:data
start: mov ax, data
mov ds, ax
mov bx, 0
mov bl,hex
mov al,table[bx]
mov asci,al
mov dl, asci
mov ah, 2 ;调用2号功能将asci的内容对应的字符输出到屏幕上
int 21h
mov ah,4ch
int 21h
code ends
end start
修改程序,使之实现的功能为:将DL中的内容(2位16进制数)转换成ASCII码,并输出到屏幕上。这里DL的值在程序中用mov指令给定。如mov dl, 56h 使(DL)=56H,则屏幕上应输出56。(提示:应对2位16进制数依次处理,每次处理一位,转换成ASCII码并输出。)
table db 30h,31h,32h,33h,34h,35h,36h,37h
db 38h,39h,41h,42h,43h,44h,45h,46h
hex db 9
asci db ?
data ends
code segment
assume cs:code, ds:data
start: mov ax, data
mov ds, ax
mov bx, 0
mov bl,hex
mov al,table[bx]
mov asci,al
mov dl, asci
mov ah, 2 ;调用2号功能将asci的内容对应的字符输出到屏幕上
int 21h
mov ah,4ch
int 21h
code ends
end start
修改程序,使之实现的功能为:将DL中的内容(2位16进制数)转换成ASCII码,并输出到屏幕上。这里DL的值在程序中用mov指令给定。如mov dl, 56h 使(DL)=56H,则屏幕上应输出56。(提示:应对2位16进制数依次处理,每次处理一位,转换成ASCII码并输出。)
作者: wccmfc123 发布时间: 2010-12-11
d:\MASM>debug
-a
1472:0100 mov dl,56
1472:0102 mov ah,2
1472:0104 mov cl,4
1472:0106 push dx
1472:0107 rol dl,cl
1472:0109 and dl,f
1472:010C add dl,30
1472:010F int 21
1472:0111 pop dx
1472:0112 and dl,f
1472:0115 add dl,30
1472:0118 int 21
1472:011A
-g=100 11a
56
AX=0236 BX=0000 CX=0004 DX=0036 SP=FFEE BP=0000 SI=0000 DI=0000
DS=1472 ES=1472 SS=1472 CS=1472 IP=011A NV UP EI PL NZ NA PE NC
1472:011A DEC7 FADDP ST(7),ST
-q
d:\MASM>
作者: masmaster 发布时间: 2010-12-11
相关阅读 更多
热门阅读
-
office 2019专业增强版最新2021版激活秘钥/序列号/激活码推荐 附激活工具
阅读:74
-
如何安装mysql8.0
阅读:31
-
Word快速设置标题样式步骤详解
阅读:28
-
20+道必知必会的Vue面试题(附答案解析)
阅读:37
-
HTML如何制作表单
阅读:22
-
百词斩可以改天数吗?当然可以,4个步骤轻松修改天数!
阅读:31
-
ET文件格式和XLS格式文件之间如何转化?
阅读:24
-
react和vue的区别及优缺点是什么
阅读:121
-
支付宝人脸识别如何关闭?
阅读:21
-
腾讯微云怎么修改照片或视频备份路径?
阅读:28