0

I would like to print data in a file separated with an endline. I imagined like this:

segment data use32 class=data
 format db "/n %d",0
segment code use32 class=code
   start:
       push dword mod_acces
       push dword filename
       call [fopen]
       add esp,4*2
       
       mov [descriptor], eax

       push dword 10
       push dword format
       push dword [descriptor]
       call [fprintf]
       add esp,4*3
        
      ;fclose()

But it's not working.

  • The character code for a newly is 10. Try a string like `db 10, 0` or `db "%d", 10, 0`. – fuz Jan 09 '22 at 23:00
  • 1
    Is that forward slash and `n` supposed to be `\n`? That has to be inside backticks, not single or double quotes, for C-style escapes to work. – Peter Cordes Jan 09 '22 at 23:02

0 Answers0