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
- x db 45
- y db 50
- n dd 92
- r_1 dw ?
- r_2 dw ?
- ;------------------------------------------------
- ;
- ;
- ; Код программы
- ;
- ;------------------------------------------------
- section '.code' code readable executable
- start: mov eax, 1
- add eax, [n]
- cmp eax, 100
- jz L_03
- jg L_02
- 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
- ;------------------------------------------------
- ;
- ;
- ; Подключение библиотек
- ;
- ;------------------------------------------------
- ; CINVOKE макрос в составе FASM. Позволяет вызывать CDECL-функции.
- 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