w.asm

来自「求一堆数里面的最大值」· 汇编 代码 · 共 39 行

ASM
39
字号
data  segment
buf   db 20,?,20 dup(?)
      
max  db ?
data ends
code  segment
      assume  cs:code,ds:data
start: mov  ax,data
       mov  ds,ax
       mov  dx,offset buf
       mov  ah,10
       int  21h
       mov  si,offset buf+2

       mov  al,[si]
       mov  cl,buf+1
       mov  ch,0
       dec  cx

scans: cmp  al,[si+1]
       jae  next
       mov  al,[si+1]
next:  inc  si
       loop  scans
       mov  max,al
       mov  dl,0ah
       mov  ah,2
       int  21h
       mov dl,max
       mov  ah,2
       int  21h
       mov  ah,4ch
       int  21h
       code ends
       end start



⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?