Assembly scanf a string with newline

时间:2018-09-18 20:09:48

标签: assembly x86 scanf

I try to get a string with scanf in assembly. I set up a buffer in .bss and the format in .data.

section .bss
    input resb 1000
section .data
    fmt db "%s", 0x0 

Then i get the input using

push input
push fmt
call _scanf
add esp, 8

but how can i add a newline? I tried using

    fmt db "%s", 0xA, 0x0
    fmt db "%s\n", 0x0
    fmt db "%s\x0a", 0x0

0 个答案:

没有答案