Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- format PE console
- entry start
- include 'win32ax.inc'
- include 'api\kernel32.inc'
- ;------------------------------------------------ Создание переменных:
- section '.data' data readable writeable
- n dd 99 ; Переменная n (4 байта)
- sz_Hello db 'Hello world ! n = %d', 10, 10, 0
- ;------------------------------------------------ Код программы:
- section '.code' code readable executable
- start: push [n]
- push sz_Hello
- call [printf]
- mov eax, 15
- add eax, [n]
- cmp eax, 100
- jz L_03 ; Если eax == 100
- jg L_02 ; Если eax > 100
- cinvoke printf, <"eax = %3d < 100", 10, 0>, eax
- jmp L_04
- L_02: cinvoke printf, <"eax = %3d > 100", 10, 0>, eax
- jmp L_04
- L_03: cinvoke printf, <"eax = %3d = 100", 10, 0>, eax
- L_04: cinvoke scanf, <"%d", 10, 0>, n
- invoke ExitProcess, 0
- ;------------------------------------------------ Подключение библиотек:
- section '.idata' import data readable
- library kernel32, 'kernel32.dll',\
- msvcrt, 'msvcrt.dll'
- import msvcrt,\
- printf, 'printf',\
- scanf, 'scanf'
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement