求大神帮忙(汇编)
用汇编编一程序实现以下功能:输入一个字符,输出这个字符的ASCLL我编写的程序:我编写的:
d segment
d1 db "the ascall code of $"
d2 db " is $"
d3 db "H$"
d4 db 10 DUP(?)
d ends
s segment stack
db 100 dup(0)
s ends
c segment
assume cs:c,ds:d,ss:s
start:mov ax,d
mov ds,ax
mov dx,offset d1
mov ah,9
int 21h
mov ah,1
mov d4,al
mov dx,offset d4
int 21h
mov dx,offset d2
mov ah,9
int 21h
movah,4ch ;返回
int 21h
c ends
end start
求大神指点!!
本帖最后由 wjb8love_9c7c9c 于 2013-4-19 10:29 编辑
data segment
d1 db "the Ascall code of $"
d2 db " is $"
d4 db 2 DUP(?)
d3 db "H$"
data ends
stack segment stack
db 100 dup(0)
stack ends
code segment
assume cs:code,ds:data,ss:stack
start:mov ax,data
mov ds,ax
mov dx,offset d1
mov ah,9
int 21h
mov ah,1
int 21h
mov bl,al ;ascii码变换 高4位和低4位分别加上30h
mov cl,4
shr al,cl
add al,30h
mov d4,al
and bl,00001111b
add bl,30h
mov d4+1,bl
mov dx,offset d2
mov ah,9
int 21h
mov dx,offset d4
mov ah,9
int 21h
movah,4ch ;返回
int 21h
code ends
end start 楼主加油,鱼C加油!我们都看好你哦! 问题说清楚点 wjb8love_9c7c9c 发表于 2013-4-19 10:26 static/image/common/back.gif
data segment
d1 db "the Ascall code of $"
d2 db " is $"
美中不足的是,该有的提示信息没用全部显示啊。哈哈 1971827035 发表于 2013-4-19 16:51 static/image/common/back.gif
美中不足的是,该有的提示信息没用全部显示啊。哈哈
。。。应该是显示了吧 我在我自己的机器上通过了。 强烈支持楼主ing……
页:
[1]