回 帖 发 新 帖 刷新版面

主题:请大家帮帮忙啊~~~看看哪里出了问题

.model small
.stack
data segment
string1 db 'please input the strings:',0dh,0ah,'$'
string2 db 'the transerve strings are:',0dh,0ah,'$'
string3 db 34 dup(?)
data ends
.code
start:
      mov ax,data
      mov ds,ax
      mov dx,offset string1
      mov ah,09h
      int 21h
      lea bx,string3
input:mov ah,01h
      int 21h
      cmp al,0dh
      jz output1
      mov [bx],al
      jmp input
output1:lea dx,string3
        mov ah,09h
        int 21h
mov dx,offset string2
mov ah,09h
int 21h
transe:mov al,ds:[bx]
       cmp al,'$'
       jz output2
       cmp al,'A'
       jb next
       cmp al,'Z'
       ja next
       add al,20h
       mov [bx],al
next:inc bx
     jmp transe
output2:mov ah,09
        lea dx,string3
        int 21h
exit:mov ah,4ch
int 21h
end start
end

程序的作用是输入一串字符串,然后将大写转化为小写,并输出,但是它没有输出
小妹乃初学者,有很多不懂的地方,请大家多多指教,不胜感激

回复列表 (共1个回复)

沙发

.model small
.stack
data segment
string1 db 'please input the strings:',0dh,0ah,'$'
string2 db 0dh,0ah,'the transerve strings are:',0dh,0ah,'$'
string3 db 34 dup(?)
    db '$'
data ends
.code
start:
      mov ax,data
      mov ds,ax
      mov dx,offset string1
      mov ah,09h
      int 21h
      lea bx,string3
input:mov ah,01h
      int 21h
      cmp al,0dh
      jz output1
      mov [bx],al
    inc bx
      jmp input
output1:lea dx,string3
        mov ah,09h
        int 21h
mov dx,offset string2
mov ah,09h
int 21h
lea bx,string3
transe:mov al,ds:[bx]
       cmp al,'$'
       jz output2
       cmp al,'A'
       jb next
       cmp al,'Z'
       ja next
       add al,20h
       mov [bx],al
next:inc bx
     jmp transe
output2:
    mov ah,09
        lea dx,string3
        int 21h
exit:mov ah,4ch
int 21h
end start
end

我来回复

您尚未登录,请登录后再回复。点此登录或注册