a5: es kann gerechnet werden, nur noch nicht richtig
This commit is contained in:
parent
4c0acc96ee
commit
2dd692df86
|
@ -7,27 +7,23 @@ addsub:
|
|||
push ebp
|
||||
mov ebp, esp
|
||||
|
||||
mov eax, 0
|
||||
sub esp, 4
|
||||
|
||||
mov [ebp-4], word 1
|
||||
push bx
|
||||
|
||||
mov eax, 0
|
||||
|
||||
mov [operation], word [ebp+16]
|
||||
mov bx, word [ebp+16];Operation
|
||||
mov ax, word [ebp+8];op1
|
||||
|
||||
add ax, word [ebp+8]
|
||||
|
||||
cmp [operation], 0x2b
|
||||
cmp bx, 0x2b
|
||||
jne substract
|
||||
|
||||
add ax, word [ebp-12]
|
||||
add ax, word [ebp+12];op2
|
||||
jmp return
|
||||
|
||||
substract: sub ax, word [ebp-12]
|
||||
substract: sub ax, word [ebp+12];op2
|
||||
|
||||
return:
|
||||
|
||||
pop bx
|
||||
mov esp, ebp
|
||||
pop ebp
|
||||
ret
|
||||
|
|
|
@ -18,7 +18,9 @@ int main(int argc, char **argv) {
|
|||
|
||||
int result = addsub(op1, op2, what, flags);
|
||||
|
||||
|
||||
printf("%d\n", result);
|
||||
printf("%u\n", result);
|
||||
|
||||
return 0;
|
||||
}
|
Loading…
Reference in New Issue