extern io_get_udec
extern io_print_udec
extern io_print_char
section .bss
a11: resd 1
a12: resd 1
a21: resd 1
a22: resd 1
b1: resd 1
b2: resd 1
sureqa: resd 1
sureqb: resd 1
xorab: resd 1
xfact: resd 1
section .text
global main
main:
; Scanning data
call io_get_udec
mov [a11], eax
call io_get_udec
mov [a12], eax
call io_get_udec
mov [a21], eax
call io_get_udec
mov [a22], eax
call io_get_udec
mov [b1], eax
call io_get_udec
mov [b2], eax
; Computing sureqa
mov eax, dword [a12]
not eax
mov ebx, dword [a11]
or eax, ebx
mov [sureqa], eax
; Comouting sureqb
mov eax, dword [a22]
not eax
mov ebx, dword [a21]
or eax, ebx
mov [sureqb], eax
; Computing xorab and xfact
mov eax, dword [a11]
and eax, dword [a12]
mov [xorab], eax
and eax, dword [b1]
mov [xfact], eax
mov eax, dword [a21]
and eax, dword [a22]
mov ebx, dword [b2]
and ebx, eax
or ebx, dword [xfact]
mov [xfact], ebx
or eax, dword [xorab]
mov [xorab], eax
; Computing a (x) (now in a11)
mov eax, dword [a11]
and eax, [b1]
mov ebx, eax
mov eax, dword [a21]
and eax, [b2]
or eax, ebx
and eax, dword [sureqa]
mov [a11], eax
; Computing b (y) (now in a21)
mov eax, dword [a12]
and eax, [b1]
mov ebx, eax
mov eax, dword [a22]
and eax, [b2]
or eax, ebx
and eax, dword [sureqb]
mov [a21], eax
; Computing real a11
mov eax, dword [xorab]
not eax
and eax, dword [sureqa]
and eax, dword [a11]
mov ebx, eax
mov eax, dword [sureqa]
not eax
and eax, dword [xorab]
and eax, dword [xfact]
or eax, ebx
mov [a11], eax
; Computing real a21
mov eax, dword [xorab]
not eax
and eax, dword [sureqb]
and eax, dword [a21]
mov ebx, eax
mov eax, dword [sureqb]
not eax
and eax, dword [xorab]
and eax, dword [xfact]
xor eax, dword [a11]
or eax, ebx
mov [a21], eax
; Computing REAL a11
mov eax, dword [xorab]
not eax
and eax, dword [sureqa]
and eax, dword [a11]
mov ebx, eax
mov eax, dword [sureqa]
not eax
and eax, dword [xorab]
and eax, dword [xfact]
xor eax, dword [a21]
or eax, ebx
mov [a21], eax
; PRINT DATA
mov eax, dword [a11]
call io_print_udec
mov eax, ' '
call io_print_char
mov eax, dword [a21]
call io_print_udec
xor eax, eax
ret