section .data
vx dd 0
section .text
extern io_get_dec, io_print_dec, io_print_char, io_newline
global main
main:
push ebp
mov ebp, esp
;ввод
call io_get_dec
push eax
call io_get_dec
push eax
call io_get_dec
push eax
call io_get_dec
push eax
call io_get_dec
push eax
call io_get_dec
push eax
mov edi, [ebp - 4]
mov esi, [ebp - 8]
mov edx, [ebp - 12]
mov ecx, [ebp - 16]
mov ebx, [ebp - 20]
mov eax, [ebp - 24]
;eax = x1
;ebx = y1
;ecx = x2
;edx = y2
;esi = x3
;edi = y3
;площадь
sub edx, edi
imul eax, edx
;edx = y2 - y3
;eax = x1 * (y2 - y3)
sub edi, ebx
imul ecx, edi
;edi = y3 - y1
;ecx = x2 * (y3 - y1)
sub ebx, edx
imul esi, ebx
;ebx = y1 - y2
;esi = x3 * (y1 - y2)
add eax, ecx
add eax, esi
;модуль
cdq
xor eax, edx
sub eax, edx
mov edi, eax
call io_print_dec
call io_newline
xor eax, eax
ret