Answer the question
In order to leave comments, you need to log in
Why does scanf not work correctly in FASM?
The scanf function crashes the program
format PE console
entry start
include 'win32a.inc'
section '.code' code readable executable
strC db 'Col-vo numder: ', 0
strN db 'Number: ', 0
colvo db ' %d', 0
number db '%d', 0
numderA rd 1
section '.data' code readable writable
start:
push strC
call [printf]
push numderA
push colvo
call [scanf]
push numderA
call [printf]
call [getch]
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'
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question