Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- format PE console
- entry start
- include 'win32a.inc'
- section '.data' data readable writable
- formatNum db '%d', 0
- a dd ?
- b dd ?
- c dd ?
- d dd ?
- what db "This program calculate ((a-8)*b+c)/d+4 ",0
- strEnterA db 13,10,'Enter A: ',0
- strEnterB db 13,10,'Enter B: ',0
- strEnterC db 13,10,'Enter C: ',0
- strEnterD db 13,10,'Enter D: ',0
- result db 'Result: %d', 0
- NULL = 0
- section '.code' code readable executable
- start:
- push what
- call [printf]
- push strEnterA;;1
- call [printf]
- push a
- push formatNum
- call [scanf] ;
- sub [a], 8
- push strEnterB;;2
- call [printf]
- push b
- push formatNum
- call [scanf] ;
- mov eax, [a]
- mul [b]
- push eax
- push result
- call[printf];;;;;; eax = (à-8)*b
- push strEnterC
- call [printf]
- push c
- push formatNum
- call [scanf] ;
- add eax, [c]
- push eax
- push result
- call[printf];;;;;; eax äîëæåí áûòü = (à-8)*b+c íî ýòî íå òàê (?)
- call[getch]
- push NULL
- call[ExitProcess]
- section '.idata' import data readable
- library kernel, 'kernel32.dll', \
- msvcrt, 'msvcrt.dll'
- import kernel, \
- ExitProcess, 'ExitProcess'
- import msvcrt,\
- printf, 'printf',\
- getch, '_getch',\
- scanf, 'scanf'
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement