Advertisement
Kamila1999N

pio

Mar 25th, 2019
82
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.02 KB | None | 0 0
  1. section .data
  2. mess db 'Podaj dl boku kwadratu: '
  3. len equ $- mess
  4.  
  5. res1 db 'Obwod wynosi: '
  6. len1 equ $- res1
  7.  
  8. res2 db 'Pole wynosi: '
  9. len2 equ $- res2
  10.  
  11. endl db 10,0
  12.  
  13. section .bss
  14. variable resb 1
  15. result resb 1
  16.  
  17. section .text
  18. global _start
  19.  
  20. _start:
  21. mov eax,4
  22. mov ebx,1
  23. mov ecx,mess
  24. mov edx,len
  25. int 80h
  26.  
  27. mov eax,3
  28. mov ebx,0
  29. mov ecx,variable
  30. mov edx,1
  31. int 80h
  32.  
  33. mov eax,4
  34. mov ebx,1
  35. mov ecx,res1
  36. mov edx,len1
  37. int 80h
  38.  
  39. mov eax,[variable]
  40. sub eax,'0'
  41. mov ebx,4
  42. mul ebx
  43. add eax,'0'
  44. mov [result],eax
  45.  
  46. mov eax,4
  47. mov ebx,1
  48. mov ecx,result
  49. mov edx,1
  50. int 80h
  51.  
  52. mov eax,4
  53. mov ebx,1
  54. mov ecx,endl
  55. mov edx,1
  56. int 80h
  57.  
  58. mov eax,4
  59. mov ebx,1
  60. mov ecx,res2
  61. mov edx,len2
  62. int 80h
  63.  
  64. mov eax,[variable]
  65. sub eax,'0'
  66. mov ebx,[variable]
  67. sub ebx,'0'
  68. mul ebx
  69. add eax,'0'
  70. mov [result],eax
  71.  
  72. mov eax,4
  73. mov ebx,1
  74. mov ecx,result
  75. mov edx,1
  76. int 80h
  77.  
  78. mov eax,4
  79. mov ebx,1
  80. mov ecx,endl
  81. mov edx,1
  82. int 80h
  83.  
  84. exit:
  85. mov eax,4
  86. xor ebx,ebx
  87. int 80h
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement