a5: Addition oder Substraktion
This commit is contained in:
parent
590d4e18e7
commit
4c63a67fa9
|
@ -12,11 +12,26 @@ addsub:
|
||||||
|
|
||||||
mov [ebp-4], word 1
|
mov [ebp-4], word 1
|
||||||
|
|
||||||
mov eax,0
|
mov eax, 0
|
||||||
add ax, word [foo]
|
|
||||||
|
mov operation, word [ebp+16]
|
||||||
|
|
||||||
add ax, word [ebp+8]
|
add ax, word [ebp+8]
|
||||||
add ax, word [ebp-4]
|
|
||||||
|
cmp operation, 0x2b
|
||||||
|
jne substract
|
||||||
|
|
||||||
|
add ax, word [ebp-12]
|
||||||
|
jmp return
|
||||||
|
|
||||||
|
substract: sub ax, word [ebp-12]
|
||||||
|
|
||||||
|
return:
|
||||||
|
|
||||||
mov esp, ebp
|
mov esp, ebp
|
||||||
pop ebp
|
pop ebp
|
||||||
ret
|
ret
|
||||||
|
|
||||||
|
section .data
|
||||||
|
|
||||||
|
operation dw 2
|
Loading…
Reference in New Issue