NASM - The Netwide Assembler

NASM Forum => Programming with NASM => Topic started by: assistech on May 05, 2020, 11:18:41 PM

Title: NASMX and scanf
Post by: assistech on May 05, 2020, 11:18:41 PM

How to use "scanf" with NASMX ? 



%include 'nasmx.inc'


IMPORT  cdecl,printf
IMPORT  cdecl,scanf
ENTRY main

[section .text]

%define KEY 26h

PROC main


LOCALS NONE

      mov eax,0
      INVOKE message0,scanf,t
      INVOKE printf, message, KEY
       

ENDPROC


[section .data]

message0: declare(NASMX_TCHAR) NASMX_TEXT('Enter your number by integer %d'),13,10,0
message: declare(NASMX_TCHAR) NASMX_TEXT('Enter your number by hexadecimal %0x'),13,10,0

[section .bss]

 t resb 1