Advertisement
Rtyrewyger123

Untitled

Apr 24th, 2020
284
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.15 KB | None | 0 0
  1. .686P
  2. .MODEL FLAT, STDCALL
  3. .STACK 4096
  4. .DATA
  5. MB_OK EQU 1
  6. str_format DB "X = %d", 0
  7. str_buffer DB 256 dup (0)
  8. m_title DB "LR_2", 0
  9. A db 4; a=4
  10. B db 2; b=2
  11. C1 db 3; c=3
  12. D db -71; d=-71
  13. X dd ?
  14.  
  15. extern MessageBoxA@16:NEAR
  16. extern wsprintfA:NEAR
  17. .CODE
  18. START:
  19. movsx eax, A
  20. mov ebx, eax
  21. imul eax, eax ;eax = a^2
  22. imul ebx, eax ;ebx = a^3
  23.  
  24. movsx ecx, C1
  25. imul ebx, ecx ;ebx = a^3*c
  26. imul ecx, ecx
  27.  
  28. imul ecx, ecx ;ecx = c^4
  29. movsx edx, B
  30.  
  31. imul edx, edx ;edx = b^2
  32. add eax, edx ;eax = a^2+b^2
  33.  
  34. movsx edx, D
  35. add ecx, edx ;ecx = c^4+d
  36. cdq ;расширяем eax в edx:eax перед делением
  37. idiv ecx ;eax = (a^2+b^2)/(c^4+d)
  38.  
  39. add eax, ebx ;eax = a^3*c + (a^2+b^2)/(c^4+d)
  40. sub eax, 190 ;eax = a^3*c + (a^2+b^2)/(c^4+d) - 190
  41. push eax
  42.  
  43. PUSH OFFSET str_format
  44. PUSH OFFSET str_buffer
  45. CALL wsprintfA
  46. ADD esp, 12
  47. PUSH MB_OK
  48. PUSH OFFSET m_title
  49. PUSH OFFSET str_buffer
  50. PUSH 0
  51. CALL MessageBoxA@16
  52. RET
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement