.386
include io32.inc
;include kernel32.inc
;includelib kernel32.lib
;include msvcrt.inc
;includelib msvcrt.lib
.data
in_msg1 byte 'Please enter number:',0
in_msg2 byte 'Please enter another number:',0
out_msg1 byte 'Two numbers is equal:',0
out_msg2 byte 'The less number is:',0
out_msg3 byte 13,10, 'The great number is:',0
.code
start:
mov eax,offset in_msg1 ;提示輸入第一個數據
call dispmsg
call readsid ;保存第一個數據
mov ebx,eax
mov eax,offset in_msg2 ;提示輸入第二個數據
call dispmsg
call readsid
mov ecx,eax
cmp ebx,ecx
jne nequal ;兩數不相等,轉移到nequal
mov eax,offset out_msg1 ;兩數相等輸出相等
call dispmsg
mov eax,ebx
call dispsid ;顯示相等數據
jmp done
nequal:
jl first
xchg ebx,ecx
first:
mov eax,offset out_msg2
call dispmsg
mov eax,ebx
call dispsid
mov eax,offset out_msg3
call dispmsg
mov eax,ecx
call dispsid
done:
exit 0
end start
彙編語言 數據比較程序
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.