extern scanf
extern printf
section .data
fmt_in db "%u %u %u %u %u %u", 0
fmt_out db "%u %u", 10, 0
section .bss
a11 resd 1
a12 resd 1
a21 resd 1
a22 resd 1
b1 resd 1
b2 resd 1
D resd 1
nD resd 1
xc resd 1
yc resd 1
A resd 1
B resd 1
C resd 1
xf resd 1
yf resd 1
rx resd 1
ry resd 1
section .text
global main
main:
push ebp
mov ebp, esp
push b2
push b1
push a22
push a21
push a12
push a11
push fmt_in
call scanf
add esp, 28
mov eax, [a11]
and eax, [a22]
mov ebx, [a12]
and ebx, [a21]
xor eax, ebx
mov [D], eax
mov ebx, eax
not ebx
mov [nD], ebx
mov eax, [b1]
and eax, [a22]
mov ebx, [b2]
and ebx, [a12]
xor eax, ebx
mov [xc], eax
mov eax, [b1]
and eax, [a21]
mov ebx, [b2]
and ebx, [a11]
xor eax, ebx
mov [yc], eax
mov eax, [a11]
or eax, [a21]
mov [A], eax
mov eax, [a12]
or eax, [a22]
mov [B], eax
mov eax, [b1]
or eax, [b2]
mov [C], eax
mov eax, [A]
and eax, [C]
mov [xf], eax
mov eax, [A]
not eax
and eax, [B]
and eax, [C]
mov [yf], eax
mov eax, [D]
and eax, [xc]
mov ebx, [nD]
and ebx, [xf]
or eax, ebx
mov [rx], eax
mov eax, [D]
and eax, [yc]
mov ebx, [nD]
and ebx, [yf]
or eax, ebx
mov [ry], eax
push dword [ry]
push dword [rx]
push fmt_out
call printf
add esp, 12
xor eax, eax
mov esp, ebp
pop ebp
ret