The MASM Forum Archive 2004 to 2012

General Forums => The Campus => Topic started by: vandelay on January 18, 2006, 12:10:21 AM

Title: 64 bit regs in 32 bit mode
Post by: vandelay on January 18, 2006, 12:10:21 AM
Accesses to 32 bit regs are supposed to clear the upper 32 bits of a 64 bit reg, right? e.g. writing EAX would clear the upper 32 bits of RAX. Does this apply to implicit writes too? e.g. if you do a SCAS or MOVS which modifies EDI or ESI, does that clear out the upper 32 bits of RDI or RSI?
Title: Re: 64 bit regs in 32 bit mode
Post by: Tedd on January 18, 2006, 12:52:35 PM
Test it and let us know :wink
Title: Re: 64 bit regs in 32 bit mode
Post by: vandelay on January 18, 2006, 05:22:53 PM
Sure. So when I can expect the 64 bit chip you're mailing me? :p
Title: Re: 64 bit regs in 32 bit mode
Post by: P1 on January 18, 2006, 06:41:01 PM
That's like saying, mov ax, 0 then eax the upper 16 bits is cleared.

It does not works that way.

Regards,  P1  :8)
Title: Re: 64 bit regs in 32 bit mode
Post by: Ian_B on January 18, 2006, 10:32:45 PM
Quote from: vandelay on January 18, 2006, 05:22:53 PM
Sure. So when I can expect the 64 bit chip you're mailing me? :p

If you only owned and maintained a Ford coupĂ©, would you normally ask a mechanic how to change the turbocharger on a Lamborghini?  ::)

IanB
Title: Re: 64 bit regs in 32 bit mode
Post by: manhattan on January 19, 2006, 03:41:04 AM
According to the documentation the full register is updated.

http://developer.amd.com/documentation.aspx

AMD also has a forum on 64-bit

http://devforums.amd.com/index.php
Title: Re: 64 bit regs in 32 bit mode
Post by: PBrennick on January 19, 2006, 04:25:37 AM
I prefer my Lamborghini with clam sauce, how about you?

Paul
Title: Re: 64 bit regs in 32 bit mode
Post by: P1 on January 19, 2006, 03:42:13 PM
Quote from: manhattan on January 19, 2006, 03:41:04 AM
According to the documentation the full register is updated.
Op Code utilization is preserved.  IOW, Opcode is the same for mov eax & rax.  That's AMD's way of doing it.   Intel would not have done it that way.

Regards,  P1  :8)
Title: Re: 64 bit regs in 32 bit mode
Post by: MazeGen on January 20, 2006, 12:58:54 PM
Opcodes are not the same. MOV RAX needs REX.W prefix.
Title: Re: 64 bit regs in 32 bit mode
Post by: vandelay on January 20, 2006, 05:11:07 PM
I have to buy a $200k car before I'm allowed to be curious about how a turbo works? Tough crowd.