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 557818
To read all comments associated with this story, please click here.
64-bit Asm Quiz
by TempleOS on Sat 6th Apr 2013 01:28 UTC
Member since:
RE: 64-bit Asm Quiz
by transputer_guy on Sat 6th Apr 2013 13:34 in reply to "64-bit Asm Quiz"
transputer_guy Member since:

That is not a 64b asm test, it is a test of Intel/AMD x86 knowledge. Having looked at it and the Intel article is enough to not want to bother with this level of detail. Your quiz includes lots of arcane stuff that seems to have little to do with general purpose 64b in general.

For me a 64b asm should look like a flat register space with all registers acting the same (except R0) and all named Ri. As i gets bigger, the opcode may get more prefixed to allow ever more registers. At some point the registers might even spill into memory stack space, from i==64 to some limit. This kind of opcode allows 3 ops, z<=x fn y, a pleasure to code, almost like C with 1 op statements.

Reply Parent Score: 3

RE[2]: 64-bit Asm Quiz
by TempleOS on Sat 6th Apr 2013 22:53 in reply to "RE: 64-bit Asm Quiz"
TempleOS Member since:

You have a valid point, except the implementation is heavily influnced by arcane crap. You have to know this for writing a C compiler. ASM is a stupid thing to do, otherwise.

You have only have very limited access to 64-bit immediates. You have lots of instructions that take 32-bit immediates but you can only load a 64-bit immediate into a register.

One really important fact is that the upper 32-bits get set to zero on any 32-bit size instruction. This is your bread and butter.

You can only branch +/- 32 relative addressing. I put all code in the lowest 2 Gig.

Reply Parent Score: 0

RE[2]: 64-bit Asm Quiz
by dnebdal on Mon 8th Apr 2013 11:43 in reply to "RE: 64-bit Asm Quiz"
dnebdal 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