What options are available for 64bit development?

Started by Chip, August 10, 2006, 06:01:00 AM

Previous topic - Next topic

Chip

I have had an AMD FX53 64bit machine for a few years. 
I was encouraged by GoAsm's abilities to generate 64 bit code.

However, my understanding is that if you are not running on a 64bit
operating system, 64 bit development is impossible.  In the Windows
world, this requires WIN64PRo, or the new (and very shaky) Vista
beta.

Am I correct in assuming that I have no options to use my current
system for 64bit programming until I install a 64 bit operating system?

I would really like to use the cpu features available to me,
but it seems impossible at the moment.  (This may be my
error, I am new to the assembler world on PC's,)

Perhaps someone could point me to an article or source that clarifies
the current status and future of 64 bit programming.

Thanks,

Chip

I am on Skype under my email address!

MazeGen

#1
As for the new features, they are really available only in new mode (called 64-bit mode both in Intel and AMD manuals). Only 64-bit OS can use this mode.
This mode is not compatible with 32-bit protected mode. It is analogous to incompatibility between real mode and protected mode. In protected mode, there are features not available from real mode.

BogdanOntanu

well,

I CAN use EAX, EBX, ESI, EDI etc  in real mode on a 32bits CPU ... (with some limitations)

Can I also use RAX, RBX, etc in 32bits mode on a 64bits CPU ?
Ambition is a lame excuse for the ones not brave enough to be lazy.
http://www.oby.ro

MazeGen

Hi Bogdan,

You can't. There is no way how to encode 64-bit general registers in x86-32 machine code.

tofu-sensei

Quote from: Chip on August 10, 2006, 06:01:00 AM
Am I correct in assuming that I have no options to use my current
system for 64bit programming until I install a 64 bit operating system?
Sure you can, you just can't run or debug the resulting executables :wink

Chip

"Sure you can, you just can't run or debug the resulting executables"

That's just the answer I need! Thanks.

(You see, I can never get any of my programs to run anyway,
so what's the use of debugging them!)

Oh well, I guess I well just have to do without 64bit segment registers.

Smiling,

Chip
I am on Skype under my email address!

kflorek

Quote from: MazeGen on August 10, 2006, 10:46:18 AM
Hi Bogdan,

You can't. There is no way how to encode 64-bit general registers in x86-32 machine code.

Back when AMD64 was kind of new, and I was reading up on it, I was annoyed to find this out. However, a little examination shows it would have taken some monstrous encodings to extend to 64 bits what are the basic and most often used "integer" instructions, because all of the short opcodes had already been used up for other things. Using very long encodings, which lengthen the time required to load and decode them, is not much of a penalty for operations that are going to take a while to complete anyway (FP, MMX, SSE), but the integer instructions execute very fast. So instead AMD defined a new operating mode, and, under this mod only, some of the opcodes have been redefined. They redefined what had been a short increment register instruction as a prefix that turns 32 bit instructions into 64 bit instructions, among other things. The x86 instruction set already had a redundent, and fairly short, instruction for incrementing anyway. (And going up by 4 bytes is more normal than 1 nowadays IAC.) If you were to attempt to execute 64 bit code in 32bit mode, it would not mean the same thing at all, and visa versa.

At the time Intel extended the 16 bit 286 instruction set to 32 bits for the 386, they had a short opcode free, and they used it as a prefix that turned 16 bit instructions into 32 bit instructions when the CPU was in 16 bit mode, and 32 bit instructions into old style 16 bit instructions when the CPU was in 32 bit mode. The same opcodes execute differently in 32 mode than in 16 bit mode, but a least you could use 32 bit registers in otherwise 16 bit code.

James Ladd

There is Linux 64 bit that you can use. I do.
I also put a 32bit OS in a virtual machine for 32 bit development.