汇编程序:将字符串的小写字母a-z变成大写
我的程序哪里有问题呀,用masm没办法看到错在哪里,,,,assumecs:codesgdatasgbegindb'Beginner'sAll-purposeSymbol...
我的程序哪里有问题呀,用masm没办法看到错在哪里,,,,
assume cs:codesg
datasg begin
db 'Beginner's All-purpose Symbolic Instruction code.',0
datasg end
codesg begin
begin:mov ax,datasg
mov ds,ax
mov bx,0
call letterc
mov ax,4c00h
int 21h
letterc:mov al,[bx]
cmp al,0
je letterend
cmp al,'a'
jb next
cmp al,'z'
ja next
and al,11011111B
mov [bx],al
next: inc bx
jmp letterc
letter1: ret
codesg ends
end begin 展开
assume cs:codesg
datasg begin
db 'Beginner's All-purpose Symbolic Instruction code.',0
datasg end
codesg begin
begin:mov ax,datasg
mov ds,ax
mov bx,0
call letterc
mov ax,4c00h
int 21h
letterc:mov al,[bx]
cmp al,0
je letterend
cmp al,'a'
jb next
cmp al,'z'
ja next
and al,11011111B
mov [bx],al
next: inc bx
jmp letterc
letter1: ret
codesg ends
end begin 展开
展开全部
你这个真的是用masm编的吗?错误一堆啊。
assume cs:codesg
datasg segment
db 'Beginners All-purpose Symbolic Instruction code.',0
datasg ends
codesg segment
begin:mov ax,datasg
mov ds,ax
mov bx,0
call letterc
mov ax,4c00h
int 21h
letterc proc
LoopStart:
mov al,[bx]
cmp al,0
je letterend
cmp al,'a'
jb next
cmp al,'z'
ja next
and al,11011111B
mov [bx],al
next: inc bx
jmp LoopStart
letterend: ret
letterc endp
codesg ends
end begin
另外定义字符串那里,我不知道怎么在字符串定义单引号。
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询