Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- section .data
- mess db 'Podaj dl boku kwadratu: '
- len equ $- mess
- res1 db 'Obwod wynosi: '
- len1 equ $- res1
- res2 db 'Pole wynosi: '
- len2 equ $- res2
- endl db 10,0
- section .bss
- variable resb 1
- result resb 1
- section .text
- global _start
- _start:
- mov eax,4
- mov ebx,1
- mov ecx,mess
- mov edx,len
- int 80h
- mov eax,3
- mov ebx,0
- mov ecx,variable
- mov edx,1
- int 80h
- mov eax,4
- mov ebx,1
- mov ecx,res1
- mov edx,len1
- int 80h
- mov eax,[variable]
- sub eax,'0'
- mov ebx,4
- mul ebx
- add eax,'0'
- mov [result],eax
- mov eax,4
- mov ebx,1
- mov ecx,result
- mov edx,1
- int 80h
- mov eax,4
- mov ebx,1
- mov ecx,endl
- mov edx,1
- int 80h
- mov eax,4
- mov ebx,1
- mov ecx,res2
- mov edx,len2
- int 80h
- mov eax,[variable]
- sub eax,'0'
- mov ebx,[variable]
- sub ebx,'0'
- mul ebx
- add eax,'0'
- mov [result],eax
- mov eax,4
- mov ebx,1
- mov ecx,result
- mov edx,1
- int 80h
- mov eax,4
- mov ebx,1
- mov ecx,endl
- mov edx,1
- int 80h
- exit:
- mov eax,4
- xor ebx,ebx
- int 80h
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement