I would like to call the printf function from C with two integers. My format string is:
LC0:
db "odd bits: %d, even bits: %d", 10, 0
I have the integer ob and eb:
ob: DD 0
eb: DD 0
and then I do at the end:
push dword [ob]
push dword [eb]
push LC0
call printf
add esp,8
However, this gives me the result Odd bits: [ob], Even bits: [ob, repeated]
then gives me a segmentation fault.
Am I calling the printf
function wrong?
EDIT:
I added LC1
as db "even bits: %d", 10 0
, then redid:
push dword [ob]
push LC0
call printf
push dword [eb]
push LC1
call printf
add esp, 8
This gives me a REVERSED result, giving the eb to the LC0 string, and ob to the LC1 string, and, it gives a segmentation fault at the end. Any clue?