汇编语言 编写一个程序,从一个字符串查找ASCII码最大的字符,并将其显示出来

如题所述

第1个回答  2015-11-24
code  segment
      assume cs:code
      org 100h
start:
      jmp bbb
str1  db 250 dup(' ')
num   db ?
char  db ' ','$'
msg1  db 10,13,'please input string:','$'
lfcr  db 10,13,'$'

bbb:
      push cs
      pop ds
      lea dx,msg1
      mov ah,9
      int 21h

      MOV cx,0
      lea di,str1
again1:
      mov ah,1
      int 21h
      cmp al,13
      je line1
      mov byte ptr[di],al
      inc cx
      inc di
      jmp again1
line1:
      mov byte ptr[num],cl
      lea si,str1
      dec cx

      mov al,byte ptr[si]
again2:
      inc si
      cmp al,byte ptr[si]
      jge line2
      mov al,byte ptr[si]
line2:
      loop again2
      mov byte ptr[char],al
      
      lea dx,lfcr
      mov ah,9
      int 21h
      lea dx,char
      mov ah,9
      int 21h
      
      mov ah,4ch
      int 21h
code  ends
      end start

本回答被网友采纳
相似回答