Author Topic: NASMX and scanf  (Read 9779 times)

Offline assistech

  • Jr. Member
  • *
  • Posts: 27
NASMX and scanf
« 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