【发布时间】:2015-02-23 05:53:16
【问题描述】:
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,而它必须是 51
【问题讨论】:
-
largest需要为 4 个字节。