extern io_get_dec, io_print_dec, io_print_char, io_newline
section .bss
vx resd 1
vy resd 1
ax2 resd 1
ay2 resd 1
t resd 1
t2 resd 1
x resd 1
y resd 1
section .text
global main
main:
mov ebp, esp; for correct debugging
; vx, vy, ax/2, ay/2, t
call io_get_dec
mov [vx], eax
call io_get_dec
mov [vy], eax
call io_get_dec
mov [ax2], eax
call io_get_dec
mov [ay2], eax
call io_get_dec
mov [t], eax
; t * t
mov eax, [t]
imul eax, eax
mov [t2], eax
; x = vx * t + ax2 * t2
mov eax, [vx]
imul eax, [t]
mov ebx, [ax2]
imul ebx, [t2]
add eax, ebx
mov [x], eax
; y = vy * t + ay2 * t2
mov eax, [vy]
imul eax, [t]
mov ebx, [ay2]
imul ebx, [t2]
add eax, ebx
mov [y], eax
; x y
mov eax, [x]
call io_print_dec
mov al, ' '
call io_print_char
mov eax, [y]
call io_print_dec
xor eax, eax
ret