;AX store the big number
;cx store the small number
datarea segment
 x dw 50H
 y dw 59H
 z dw 51H
 a1 db 'the big number:'
 b1 db 'the samll number:'
datarea ends
prognam segment
main proc far
 assume cs:prognam,ds:datarea
start:
 push ds
 sub ax,ax
 push ax
 mov ax,datarea
 mov ds,ax
 mov bx,0
 mov ax,x[bx]
 cmp ax,y[bx]
 jb above ;x<y
 mov cx,y[bx]
a: cmp ax,z[bx]    ;x>y
 jb  above1  ;y<z
 jae  below
above: mov ax,y[bx]
 mov cx,x[bx]
 jmp a
above1: mov ax,z[bx]
 jmp  printit 
below:  cmp cx,z[bx]
 jb printit
 mov cx,z[bx]
  

printit: 
  
   
   mov bx,ax  
   mov di,cx
   
   mov si,0h
   mov cx,15
   mov ah,02
 l1:
   mov dl,a1[si]
   int 21h
   inc si
   loop l1
   mov ax,bx
   mov dl,al
   mov ah,2
   int 21h
   
   mov dl,0Dh  ;回车
   int 21h
   mov dl,0Ah  ;换行
   int 21h
   
   mov si,0h
   mov cx,17
   mov ah,02
 l2:
   mov dl,b1[si]
   int 21h
   inc si
   loop l2
   
   mov cx,di
   mov dl,cl
   mov ah,2
   int 21h
 ret
main endp
prognam ends
  end start

 

 

相关文章:

  • 2021-10-07
  • 2022-12-23
  • 2021-11-14
  • 2022-12-23
  • 2021-07-20
  • 2021-05-04
  • 2022-12-23
  • 2021-08-16
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-11-05
  • 2022-12-23
  • 2022-02-22
相关资源
相似解决方案