global main
extern scanf
extern printf
section .data
in_fmt db " %c%c %c%c", 0
out_fmt db "%d", 10, 0
section .bss
x1 resd 1
y1 resd 1
x2 resd 1
y2 resd 1
section .text
main:
push y2
push x2
push y1
push x1
push in_fmt
call scanf
add esp,20
movzx eax, byte [x1]
sub eax,'A'
add eax,1
mov [x1],eax
movzx eax, byte [y1]
sub eax,'0'
mov [y1],eax
movzx eax, byte [x2]
sub eax,'A'
add eax,1
mov [x2],eax
movzx eax, byte [y2]
sub eax,'0'
mov [y2],eax
mov eax,[x1]
sub eax,[x2]
mov edx,eax
sar edx,31
xor eax,edx
sub eax,edx
mov ebx,[y1]
sub ebx,[y2]
mov edx,ebx
sar edx,31
xor ebx,edx
sub ebx,edx
add eax,ebx
push eax
push out_fmt
call printf
add esp,8
xor eax,eax
ret