Hi markallyn,
You don't need any other specific library to assemble the code below, the Masm64 additions developed by Hutch is doing all the job. The largest element in the _iobuf structure, QWORD has a size of 8 bytes so they need to be aligned to 8 byte boundary. The DWORD members in the same structure will require attention, so we instruct the assembler to do it for us with _iobuf STRUCT 8. You can see that the first DWORD member will "break" the alignment :
_cnt DWORD ?
Here is a quick example for the Masm64 SDK :
include \masm32\include64\masm64rt.inc
_iobuf STRUCT 8 ; align to 8 byte boundary
_ptr QWORD ?
_cnt DWORD ?
_base QWORD ?
_flag DWORD ?
_file DWORD ?
_charbuf DWORD ?
_bufsiz DWORD ?
_tmpfname QWORD ?
_iobuf ENDS
_FILE TYPEDEF _iobuf
EXTERN __iob_func:PROC
.data?
_stdout dq ?
_stdin dq ?
_stderr dq ?
.data
msg db "Please type your name :",13,10,0
.data?
szName db 16 dup(?)
.code
start PROC
invoke __iob_func
mov _stdin,rax ; #define stdin (&__iob_func()[0])
add rax,SIZEOF(_FILE)
mov _stdout,rax ; #define stdout (&__iob_func()[1])
add rax,SIZEOF(_FILE)
mov _stderr,rax ; #define stderr (&__iob_func()[2])
invoke vc_fputs,ADDR msg,_stdout
invoke vc_fgets,ADDR szName,16,_stdin
invoke vc_printf,"Nice to meet you, %s",ADDR szName
invoke ExitProcess,0
start ENDP
END