by@__Hyoga
WA
493ms
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 p popad %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 p: mov edi,-1 call g_s mov ecx,eax mov edx,edi mov eax,4 mov ebx,1 int 80h ret g_s: inc edi cmp byte [eax+edi],0 jne g_s 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 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 convert_double: mov ebx,[esp+8] mov eax,[esp+4] sub ecx,ecx mov esi,10 mov byte [sign],0 cmp eax,0 jmp gn gn: cmp eax,0 je pn cdq div esi add edx, 30h push edx inc ecx jmp gn pn: cmp byte [sign],0 je an an: pop edx mov byte[ebx],dl inc ebx loop an mov byte[ebx],0 ret 8 _start: z [j] z dword[k] z mov [l],eax z mov [a],eax z mov [b],eax z mov [c],eax z mov [d],eax z mov [e],eax z mov [f],eax z mov [g],eax z mov [h],eax z sub [a],dword[j] sub dword[b],[k] sub dword[c],dword[l] sub [d],[j] sub dword[e],dword[k] sub dword[f],dword[l] sub dword[g],dword[j] sub dword[h],dword[k] sub dword[i],dword[l] mov eax,[a] mul eax,[e] mul eax,[i] mov ebx,[b] mul ebx,[f] mul ebx,[g] add eax,ebx mov ebx,[c] mul ebx,[d] mul ebx,[h] add eax,ebx mov ebx,[a] mul ebx,[h] mul ebx,[f] sub eax,ebx mov ebx,[b] mul ebx,[i] mul ebx,[d] sub eax,ebx mov ebx,[c] mul ebx,[g] mul ebx,[e] sub eax,ebx div eax,6 pushad push buf push eax call convert_double o buf
67 50 47 15 87 11 09 43 27 01 48 39
/tmp/code.asm:139: error: invalid combination of opcode and operands /tmp/code.asm:140: error: invalid combination of opcode and operands /tmp/code.asm:160: error: invalid combination of opcode and operands /tmp/code.asm:161: error: invalid combination of opcode and operands /tmp/code.asm:162: error: invalid combination of opcode and operands /tmp/code.asm:163: error: invalid combination of opcode and operands /tmp/code.asm:164: error: invalid combination of opcode and operands /tmp/code.asm:165: error: invalid combination of opcode and operands /tmp/code.asm:166: error: invalid combination of opcode and operands /tmp/code.asm:167: error: invalid combination of opcode and operands /tmp/code.asm:168: error: invalid combination of opcode and operands /tmp/code.asm:170: error: invalid combination of opcode and operands /tmp/code.asm:171: error: invalid combination of opcode and operands /tmp/code.asm:173: error: invalid combination of opcode and operands /tmp/code.asm:174: error: invalid combination of opcode and operands /tmp/code.asm:177: error: invalid combination of opcode and operands /tmp/code.asm:178: error: invalid combination of opcode and operands /tmp/code.asm:181: error: invalid combination of opcode and operands /tmp/code.asm:182: error: invalid combination of opcode and operands /tmp/code.asm:185: error: invalid combination of opcode and operands /tmp/code.asm:186: error: invalid combination of opcode and operands /tmp/code.asm:189: error: invalid combination of opcode and operands /tmp/code.asm:190: error: invalid combination of opcode and operands /tmp/code.asm:192: error: invalid combination of opcode and operands 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