I have a question regarding how to use/call the c function fprintf in NASM assembly. I have looked up the documentation of fprintf and pushed the parameters to the stack in the correct order. When I run my code I am getting and output file that is empty and the name is "Project4_int.outw". It is clearly just appending the write string to the end and not opening the file correctly. What am I doing wrong?
section .data
write_char: db 'w', 0
intFilename: db "Project4_int.txt"
intfdes: dd 0
format: db "%d", 10, 0
section .text
push dword write_char
push dword intFilename
call fopen
add esp, 8
mov [intfdes], eax
push dword [intArray + 4]
push dword format
push dword [intfdes]
call fprintf
add esp, 12