跪求:汇编 编程

来源:百度知道 编辑:UC知道 时间:2024/05/24 08:11:46
比较AX,BX,CX中带符号数的大小,将最大的数放在AX中,并将
此数存入字单元MAX中。(借助MOV指令给AX,BX,CX中分别传送
数据-8,10,20)

; 本程序在MASMPlus 1.2集成环境下通过编译,经过调试,运行正确。
Code Segment
Assume CS:Code,DS:Code
MAX dw ?
Press_Key db 13,10,13,10,'The complated. Press any key to exit...$'
Start: push cs
pop ds
mov ax,-8
mov bx,10
mov cx,20
cmp ax,bx ;ax>=bx?
jge $+4 ;是
mov ax,bx ;小于,更新ax的值
cmp ax,cx ;ax>=cx?
jge $+4 ;是
mov ax,cx ;小于,更新ax的值
mov MAX,ax ;存入MAX单元
; -------------------------------------
Exit_Proc: lea dx,Press_Key ;提示操作完成,按任意键结束程序
mov ah,9
int 21h
mov ah,1
int 21h
mov ah,4ch ;结束程序
int 21h
Code ENDS
END Start ;编译到此结束