flat assembler
Message board for the users of flat assembler.
Index
> Windows > Win64 registers |
Author |
|
r22 29 Oct 2005, 05:01
I think msdn has a good help page if you search for "64bit registers"
But the registers you use are r0-r15 mm0-mm7 (thanks for the correction maze) xmm0-xmm15 There's also the debug and control registers which you probably wont be using unless your coding a driver. r0-r7 are just another name for the rax,rbx,rcx,rdx,rsi,rdi,rbp,rsp registers. r?d is how you would access the dword componenet of the qword register. Just like eax least signif dword of rax. r?w r?b are the same least significant word and byte access for the registers. PUSH and POP are 64bit pushes and pops, so you have to push and pop qwords not dwords. Using RSP (for the win64 calling convension) is a little funky Because it's fastcall you move data into registers than call but if the function has more than 4 parameters than 5-? are put in RSP+5*8 - RSP+?*8. Because of this using SUB RSP,9*8 to set a stack frame and then filling it for making api calls is an effective way of doing things (as opposed to making the stack frame before EVERY call and removing it after EVERY call). The structures in win64 are picky about alignment so make sure your data section (or if your creating structures on the stack) are aligned to 16bytes (to be on the safe side and to be able to use aligned xmmx movdqa). push RBP mov RBP,RSP sub RSP,StructSize+16 and RSP,-16 ....now you have a 16byte align at RSP ....code mov RSP,RBP pop RBP ret Last edited by r22 on 29 Oct 2005, 23:54; edited 1 time in total |
|||
29 Oct 2005, 05:01 |
|
BoR0 29 Oct 2005, 15:50
That works. Thanks!
|
|||
29 Oct 2005, 15:50 |
|
MazeGen 29 Oct 2005, 20:29
r22 wrote:
You can use just mm0-mm7 and st0-st7, BUT... msdn: Other Calling Convention Process Issues wrote:
|
|||
29 Oct 2005, 20:29 |
|
vid 02 Nov 2005, 11:07
mazegen: does that mean they can change value of STs and MMs anytime? eg. you can't really use them?!?
|
|||
02 Nov 2005, 11:07 |
|
MazeGen 02 Nov 2005, 11:15
exactly
I don't have win64 though so I can't prove it... |
|||
02 Nov 2005, 11:15 |
|
r22 06 Nov 2005, 04:38
I just upgraded
win64xp amd x2 3800+ asus n4 sli geforce 6800gt pci-e 1024mb ddr 3200 80gb hd 36gb 10krpm hd I was talking about it since last july, finally released my grip on the stack of dollar bills. |
|||
06 Nov 2005, 04:38 |
|
Adam Kachwalla 25 May 2007, 06:34
Quote: r?d is how you would access the dword componenet of the qword register. Just like eax least signif dword of rax. Yea, so how do you access the individual bytes of RAX, RBX, RCX, RDX? |
|||
25 May 2007, 06:34 |
|
MazeGen 25 May 2007, 06:59
Same way like we are used to. AL, AH, AX, EAX.
|
|||
25 May 2007, 06:59 |
|
< Last Thread | Next Thread > |
Forum Rules:
|
Copyright © 1999-2025, Tomasz Grysztar. Also on GitHub, YouTube.
Website powered by rwasa.