The MASM Forum Archive 2004 to 2012

General Forums => The Campus => Topic started by: vid on November 10, 2007, 04:59:00 PM

Title: qword argument
Post by: vid on November 10, 2007, 04:59:00 PM
hi, if i wrote procedure that takes qword argument, should i declare it as qword:


writeq PROTO value:QWORD


or as two dwords?


writeq PROTO valuelow:DWORD, valuehigh:DWORD


First one seem more natural, but i don't know how to use registers in invoke.


value dq ?
...
invoke writeq, [value]
...
mov eax, dword ptr [value]
mov edx, dword ptr [value+4]
invoke writeq, edx:eax   ;  <--- how to do this???


If i use second version (two dwords), then i can do it:

value dq ?
...
invoke writeq, dword ptr [value], dword ptr [value+4]
...
mov eax, dword ptr [value]
mov edx, dword ptr [value+4]
invoke writeq, eax, edx


So, is there any way to use registers with first version of declaration, or should i stick to second version?
Title: Re: qword argument
Post by: drizz on November 10, 2007, 05:32:28 PM
Quote from: vid on November 10, 2007, 04:59:00 PMSo, is there any way to use registers with first version of declaration, or should i stick to second version?
yes there is. use edx::eax
Title: Re: qword argument
Post by: vid on November 10, 2007, 06:23:52 PM
thanks again