section .data
msg db 'Largest number :: '
len equ $ - msg
num1 dd '47'
num2 dd '51'
num3 dd '22'
section .bss
largest resb 2
section .text
global _start
_start:
mov ecx, [num1]
cmp ecx, [num2]
jg check_third
mov ecx, [num2]
check_third:
cmp ecx, [num3]
jg _exit
mov ecx, [num3]
_exit:
mov [largest], ecx
mov edx, len
mov ecx, msg
mov ebx, 1
mov eax, 4
int 0x80
mov edx, 2
mov ecx, largest
mov ebx, 1
mov eax, 4
int 0x80
mov eax, 1
int 0x80
答案出來是47,而它得出來的是51JG不ASM正常工作
'最大'需要4個字節。 – 2015-02-23 06:43:37