Result

WA

Duration

526ms

Code [DL]

global _start
section .data
a:times 4 db 0
b:times 4 db 0
c:times 4 db 0
d:times 4 db 0
e:times 4 db 0
f:times 4 db 0
g:times 4 db 0
h:times 4 db 0
i:times 4 db 0
j:times 4 db 0
k:times 4 db 0
l:times 4 db 0
%macro o 1
pushad
mov eax,%1
call print
popad
%endmacro
%macro outputd 1
dtoa buf,%1
o buf
%endmacro
%macro input 2
pushad
push %1
push %2
call input_
popad
%endmacro
%macro z 0-1 eax
input buf,11
atod buf,%1
%endmacro
%macro atod 1-2 eax
push eax
push ebx
push ecx
push edx
push edi
push %1
call convert_ascii
add esp,4
mov [dbuf],ecx
pop edi
pop edx
pop ecx
pop ebx
pop eax
mov %2,[dbuf]
%endmacro
section .data
sign: db 0
section .bss
buf: resb 11
dbuf: resd 1
section .text
new_line: db 10,0
print:
mov edi,-1
call get_string
mov ecx,eax
mov edx,edi
mov eax,4
mov ebx,1
int 80h
ret
get_string:
inc edi
cmp byte [eax+edi],0
jne get_string
ret
input_:
mov ecx,[esp+8]
mov edx,[esp+4]
mov eax,3
mov ebx,0
int 80h
ret 8
convert_ascii:
mov edx,[esp+4]
mov edi,-1
mov ecx,0
mov eax,0
mov byte [sign],0
jmp determine_sign
convert_continue:
call determine_decimal
cmp byte [sign],1
je negate
ret
determine_sign:
cmp byte [edx],2dh
jne convert_continue
determine_decimal:
mov ebx,0
inc edi
cmp byte [edx+edi],30h
jl return
cmp byte [edx+edi],39h
jg return
mov ebx,0
mov bl,[edx+edi]
sub bl,30h
push edx
mov eax,ecx
mov ecx,10
mul dword ecx
mov ecx,eax
add ecx,ebx
pop edx
jmp determine_decimal
return:
ret
section .text
_start:
z
mov dword[j],eax
z
mov dword[k],eax
z
mov dword[l],eax
z
mov dword[a],eax
z
mov dword[b],eax
z
mov dword[c],eax
z
mov dword[d],eax
z
mov dword[e],eax
z
mov dword[f],eax
z
mov dword[g],eax
z
mov dword[h],eax
z
mov dword[i],eax
sub dword[d],dword[i]
sub dword[e],dword[j]
sub dword[f],dword[k]
sub dword[g],dword[i]
sub dword[h],dword[j]
sub dword[i],dword[k]
sub dword[j],dword[i]
sub dword[k],dword[j]
sub dword[l],dword[k]
mov eax,dword[a]
mul eax,dword[e]
mul eax,dword[i]
mov ebx,dword[b]
mul ebx,dword[f]
mul ebx,dword[g]
add eax,ebx
mov ebx,dword[c]
mul ebx,dword[d]
mul ebx,dword[h]
add eax,ebx
mov ebx,dword[a]
mul ebx,dword[h]
mul ebx,dword[f]
sub eax,ebx
mov ebx,dword[b]
mul ebx,dword[i]
mul ebx,dword[d]
sub eax,ebx
mov ebx,dword[c]
mul ebx,dword[g]
mul ebx,dword[e]
sub eax,ebx
div eax,6
outputd eax

stdin

47 71 98
87 85 73
39 42 67
23 08 08

stdout

stderr

/tmp/code.asm:175: error: parser: instruction expected
gcc: error: /tmp/code.o: No such file or directory
gcc: fatal error: no input files
compilation terminated.
/bin/script: 16: /bin/script: /tmp/code: not found
rm: cannot remove '/tmp/code.o': No such file or directory
rm: cannot remove '/tmp/code': No such file or directory

strace