Hi every body!
I wrote this following code to read informations et print it on the console but I don't understand why but when i enter an integer for age my prog didn't write the good result :
for example :
name: hi
age:45
Hello, hi! What are you having today?Sorry kid, you're only 4202522!
Can you explain to me why this is not working well please?
format PE CONSOLE
include 'include/win32ax.inc'
entry start ;label d'entrée dans le programme
;================
;section data
;================
section '.data' data readable writeable
%d db "%d",0
section '.bss' data readable writeable
namem: dt ?
age dw ?
;================
;section code
;================
section '.code' code readable executable
start:
invoke printf, "Name: "
invoke scanf, "%s", namem
invoke printf, "Age: "
invoke scanf, "%d", age
invoke printf, "Hello, %s! What are you having today?", namem
invoke printf, "Sorry kid, you're only %d!", age
invoke ExitProcess,0
;================
;section import (win32)
;================
section '.idata' import data readable writeable
library kernel,'KERNEL32.DLL', msvcrt, 'msvcrt.dll'
import kernel, ExitProcess,'ExitProcess'
import msvcrt,\
printf,'printf',\
scanf, 'scanf'
;======FIN=======
[/quote]