Using scanf with x86-64 GAS assembly
问题 I have been having loads of issues trying to get a call the the system function scanf to work in my x86 assembly program. Currently I have got it to read from standard in however, it only will read chars without a segfault (I have no idea why, the specifying string is %d). The examples I've seen of scanf in x86 online use quarky or are written with NASM syntax, thus I have tried to adapt them for my program. f: .string "%d" _main: movq $0, %rax #Clean rax movq $f, %rdi #Load string format