128 lines
1.6 KiB
NASM
128 lines
1.6 KiB
NASM
|
|
||
|
_getarg:
|
||
|
PUSH EBP
|
||
|
MOV EBP,ESP
|
||
|
ADD ESP,-8
|
||
|
LEA EAX,[EBP+24]
|
||
|
MOV EBX,EAX
|
||
|
MOV EAX, [EBX]
|
||
|
MOV EBX,EAX
|
||
|
XOR EAX,EAX
|
||
|
CALL __lt
|
||
|
PUSH EAX
|
||
|
LEA EAX,[EBP+24]
|
||
|
MOV EBX,EAX
|
||
|
MOV EAX, [EBX]
|
||
|
PUSH EAX
|
||
|
LEA EAX,[EBP+12]
|
||
|
MOV EBX,EAX
|
||
|
MOV EAX, [EBX]
|
||
|
POP EBX
|
||
|
CALL __ge
|
||
|
POP EBX
|
||
|
OR EAX,EBX
|
||
|
OR EAX,EAX
|
||
|
JNE _0_3
|
||
|
JMP _0_2
|
||
|
_0_3:
|
||
|
LEA EAX,[EBP+20]
|
||
|
MOV EBX,EAX
|
||
|
MOV EAX, [EBX]
|
||
|
MOV EBX,EAX
|
||
|
XOR EAX,EAX
|
||
|
MOV [EBX],AL
|
||
|
MOV EAX,-1
|
||
|
MOV ESP,EBP
|
||
|
POP EBP
|
||
|
RET
|
||
|
_0_2:
|
||
|
LEA EAX,[EBP-8]
|
||
|
MOV EBX,EAX
|
||
|
XOR EAX,EAX
|
||
|
MOV [EBX],EAX
|
||
|
LEA EAX,[EBP-4]
|
||
|
PUSH EAX
|
||
|
LEA EAX,[EBP+8]
|
||
|
MOV EBX,EAX
|
||
|
MOV EAX, [EBX]
|
||
|
PUSH EAX
|
||
|
LEA EAX,[EBP+24]
|
||
|
MOV EBX,EAX
|
||
|
MOV EAX, [EBX]
|
||
|
POP EBX
|
||
|
SHL EAX,1
|
||
|
SHL EAX,1
|
||
|
ADD EAX,EBX
|
||
|
MOV EBX,EAX
|
||
|
MOV EAX, [EBX]
|
||
|
POP EBX
|
||
|
MOV [EBX],EAX
|
||
|
_0_4:
|
||
|
LEA EAX,[EBP-8]
|
||
|
MOV EBX,EAX
|
||
|
MOV EAX, [EBX]
|
||
|
PUSH EAX
|
||
|
LEA EAX,[EBP+16]
|
||
|
MOV EBX,EAX
|
||
|
MOV EAX, [EBX]
|
||
|
POP EBX
|
||
|
CALL __lt
|
||
|
OR EAX,EAX
|
||
|
JNE _0_6
|
||
|
JMP _0_5
|
||
|
_0_6:
|
||
|
LEA EAX,[EBP+20]
|
||
|
MOV EBX,EAX
|
||
|
MOV EAX, [EBX]
|
||
|
PUSH EAX
|
||
|
LEA EAX,[EBP-8]
|
||
|
MOV EBX,EAX
|
||
|
MOV EAX, [EBX]
|
||
|
POP EBX
|
||
|
ADD EAX,EBX
|
||
|
PUSH EAX
|
||
|
LEA EAX,[EBP-4]
|
||
|
MOV EBX,EAX
|
||
|
MOV EAX, [EBX]
|
||
|
PUSH EAX
|
||
|
LEA EAX,[EBP-8]
|
||
|
MOV EBX,EAX
|
||
|
MOV EAX, [EBX]
|
||
|
POP EBX
|
||
|
ADD EAX,EBX
|
||
|
MOV EBX,EAX
|
||
|
MOVSX EAX,BYTE [EBX]
|
||
|
POP EBX
|
||
|
MOV [EBX],AL
|
||
|
OR EAX,EAX
|
||
|
JE _0_8
|
||
|
JMP _0_7
|
||
|
_0_8:
|
||
|
JMP _0_5
|
||
|
_0_7:
|
||
|
LEA EAX,[EBP-8]
|
||
|
MOV EBX,EAX
|
||
|
MOV EAX, [EBX]
|
||
|
INC EAX
|
||
|
MOV [EBX],EAX
|
||
|
JMP _0_4
|
||
|
_0_5:
|
||
|
LEA EAX,[EBP+20]
|
||
|
MOV EBX,EAX
|
||
|
MOV EAX, [EBX]
|
||
|
PUSH EAX
|
||
|
LEA EAX,[EBP-8]
|
||
|
MOV EBX,EAX
|
||
|
MOV EAX, [EBX]
|
||
|
POP EBX
|
||
|
ADD EAX,EBX
|
||
|
MOV EBX,EAX
|
||
|
XOR EAX,EAX
|
||
|
MOV [EBX],AL
|
||
|
LEA EAX,[EBP-8]
|
||
|
MOV EBX,EAX
|
||
|
MOV EAX, [EBX]
|
||
|
MOV ESP,EBP
|
||
|
POP EBP
|
||
|
RET
|
||
|
|