在汇编程序AMD64中,我调用fprintf,但它保持无限循环

我对fprintf有一个问题,我无法掌握。 也许你可以找到解决这个问题的方法。

你看,当我调用fprintf它开始无限循环,没有充分的理由。 我不知道这里发生了什么,所以也许你可以帮我一臂之力。

String_int: db 91; "[" db 37; "%" db 115;"i" db 93; "]" db 0; "end_string" w_IN_ASCII: db 119; "w" db 0; "end_string"  mov rdi, FILE_LOCATION; mov rsi, w_IN_ASCII; call fopen; mov r15, rax; cmp r15, 0; (with this I can be sure it is not a NULL) je .endProgram; mov rdi, r15; mov rsi, String_int; mov rdx, TO_PRINT_LOCATION; call fprintf; this is where my code dies mov rdi, r15; call fclose; .endProgram: ret 

在System V AMD64 ABI中,可变参数函数期望al的可变参数的实际数量。 我没有看到你设置它。