whats the rules with using 32bit registers in 64bit code?

Started by ecube, June 04, 2010, 11:06:47 AM

Previous topic - Next topic

ecube

I could only get some code to work if I use edi,esi etc... using rdi and rsi made it silently exit or crash, so is using 32bit registers safe on all x64 cpus?

qWord

it is save.
However, there are some other changes in 64Bit windows like the required stack alignment and new nonvolatile registers (r12-r15, xmm6-xmm15)
you may want to show the code that fails.

FPU in a trice: SmplMath
It's that simple!

ecube

Ok great, thanks, also I use GoASM, and according to the docs it auto aligns for frames and structs, which is what I was using, so I don't think that's it. I was just concerned it worked fine on my 64bit processor and wouldn't on others. Also you recommend any decent debuggers for 64bit? or none really out, i've searched this section and tried the few mentioned, they tend to crash at random times which isn't acceptable.

qWord

what about WinDbg?
It's not very comfortable, but free. An expensive solution would be IDA Pro.
FPU in a trice: SmplMath
It's that simple!

GregL

What's wrong with the Visual Studio debugger?  It's the best in my opinion.

Alloy

We all used to be something else. Nature has always recycled.