Linked by Thom Holwerda on Fri 5th Apr 2013 16:04 UTC
General Development "For years, PC programmers used x86 assembly to write performance-critical code. However, 32-bit PCs are being replaced with 64-bit ones, and the underlying assembly code has changed. This white paper is an introduction to x64 assembly. No prior knowledge of x86 code is needed, although it makes the transition easier."
Thread beginning with comment 557939
To view parent comment, click here.
To read all comments associated with this story, please click here.
RE[2]: 64-bit Asm Quiz
by dnebdal on Mon 8th Apr 2013 11:43 UTC in reply to "RE: 64-bit Asm Quiz"
Member since:

At least the new registers on amd64 are named r8 → r15, which is marginally sane. Shame about the first half, of course.

Reply Parent Score: 1

RE[3]: 64-bit Asm Quiz
by Kochise on Mon 8th Apr 2013 14:42 in reply to "RE[2]: 64-bit Asm Quiz"
Kochise Member since:

First half is for legacy reason, just like segmented memory lasted that long. Check for ARM or 68K assembly, you'll touch heaven...


Reply Parent Score: 2

RE[3]: 64-bit Asm Quiz
by transputer_guy on Mon 8th Apr 2013 16:16 in reply to "RE[2]: 64-bit Asm Quiz"
transputer_guy Member since:

Back when I spent some time on the x86 asm in 32b, I just used R0-7 as labels, never used them in their archaic 16/8 bit modes, so it wasn't that bad. If I did use the x64 asm, I would do the same again, no interest in the cruft.

But 16 registers or more is even better and the other ISAs had that decades ago, and even more so when you can have 3 operands per opcode, that just does the same work as 2 or more x86 opcodes.

Reply Parent Score: 2

RE[4]: 64-bit Asm Quiz
by TempleOS on Mon 8th Apr 2013 16:48 in reply to "RE[3]: 64-bit Asm Quiz"
TempleOS Member since:

You have no choice but to use 32-bit because there are only 32-bit immediates, mostly.

The only 64-bit immediate is for any register but only like this

MOV R8,0x1234567890ABCDEF

All other addressing modes have 32-bit immediates.




If you want long call?

MOV RAX,0x123456789ABCDEF

Edited 2013-04-08 16:49 UTC

Reply Parent Score: 1

RE[4]: 64-bit Asm Quiz
by Alfman on Tue 9th Apr 2013 18:29 in reply to "RE[3]: 64-bit Asm Quiz"
Alfman Member since:

transputer guy,

My personal opinion is that it isn't so bad to be able to work with multiple word sizes on x86. It can eliminate shifting/masking bits on other processors.

The other cruft and inconsistencies are more unfortunate though, like instruction prefixes and variably sized op-codes. These basically mandate a CISC processor to recompile x86 code into easier to execute microcode. AMD could have implemented a better 64bit architecture if it weren't for the market demand for "x86" processors. For better or worse, AMD64 has given x86 new life for at least another decade.

Intel's 64bit mistake was designing it's processor for enterprise and failing to produce a 64bit processor for the consumer market. Small developers like me who were interested in developing for itanium's advanced features couldn't afford one. Very little software would get rewritten to make use of it's explicit parallelism. Ultimately, without native software, the architecture was destined to be judged by how well it ran x86, and in this respect it was an abysmal failure. x86 requires insanely complex pipelines and dependency logic to infer parallelism, which the itanium didn't implement.

So for now, we're basically stuck with x86 for a while longer. 64bit ARM processors will be very promising for future general purpose computers but as long as microsoft insists on neutering both the hardware and software (aka win-rt), it's going to seriously hurt any transition in the desktop space.

Edited 2013-04-09 18:31 UTC

Reply Parent Score: 2