Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- format PE console
- entry s_start
- include 'C:/Users/User Account/Documents/AJ/FASM/INCLUDE/macro/import32.inc'
- section '.data' data readable writeable
- ; local
- _str_title db "X-Board for console 1.0", 0
- _str_guide db "Guide:", 0
- _str_board db "Board:", 0
- _str_play db "play: ", 0
- ; console system
- _scan db "%31s", 0
- _endl db 10, 0
- _c_pause db "pause>nul", 0
- _c_clear db "cls", 0
- section '.code' code readable executable
- s_start:
- ; store base pointer
- mov ebp, esp
- ; print title
- push _str_title
- call [printf]
- add esp, 4
- ; pause
- push _c_pause
- call [system]
- add esp, 4
- ; create board
- ; 2 bytes = board data
- ; 100 bytes = board print
- ; total = 102 bytes
- sub esp, 104
- ; initiate board data
- mov word [ebp-2], 0
- ; paste "Guide:" at the beginning
- mov esp, _str_guide
- ; null terminate
- mov byte [ebp-96], 0
- ; print data
- push esp
- call [printf]
- ; free memory
- pop esp
- add esp, 104
- ; pause
- push _c_pause
- call [system]
- add esp, 4
- ; main loop
- .loc_main:
- ; exit
- push 0
- call [exit]
- section '.idata' import data readable
- library msvcrt, 'msvcrt.dll'
- import msvcrt,\
- printf, 'printf',\
- scanf, 'scanf',\
- system, 'system',\
- exit, 'exit'
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement