Live data from Hacker News

Introduction to x64 Assembly

software.intel.com

11–20 of 78 posts

Re: Introduction to x64 Assembly

#12
post #10

Is there a good Windows assembler that doesn't get flagged by anti-virus software? UPDATE: I just ran across JWAsm and haven't encountered any problems so far. http://sourceforge.net/projects/jwasm/

I haven't tried it; but how about Yasm?

http://yasm.tortall.net/

https://github.com/yasm/yasm/

Re: Introduction to x64 Assembly

#13
post #8

I learned by working through the software developers' manuals. Many years ago, they used to ship them as physical copies. Nowadays they just send CDs. PDF copies: http://www.intel.com/content/www/us/en/processors/architectu...

Apparently nowadays they refuse to send CDs and demand that you buy them through Lulu.

Re: Introduction to x64 Assembly

#14
post #9

Why is there no R8H?

There’s also no R9H ... R15H. These “registers", if they existed, would be bits 8-15 of each of R8, R9, etc. Without talking to engineers at AMD, it’s probably impossible to say precisely why they weren’t provided, but there is generally little/no reason to ever want to use the existing *H registers in 64-bit code, so it’s not surprising that they were omitted.

Some combination of low/no demand and added encoding/decode/retirement complexity is an excellent reason to leave things out of an architecture.

Re: Introduction to x64 Assembly

#15
post #7

That 3D "cross" graphic (Figure 1, "General Architecture") might be the worst illustration of a programmer's model for a CPU I've ever seen. I'm sure it makes sense after you've read the accompanying paragraph a sufficient number of times (once didn't cut it, for me), but not so sure it helps in that understanding. I guess it's a funny hint that the x86's architecture is complex, when a figure that's just trying to d…

The ARMv7 VFP/NEON register layout is just as much fun. Maybe more when you add in the constraints that some instruction need to operate on consecutive registers, and some of them are required to begin on an even-numbered register.

Re: Introduction to x64 Assembly

#16
post #8

I learned by working through the software developers' manuals. Many years ago, they used to ship them as physical copies. Nowadays they just send CDs. PDF copies: http://www.intel.com/content/www/us/en/processors/architectu...

Apparently nowadays they refuse to send CDs and demand that you buy them through Lulu.

Hmm that must be recent. I have CDs from January 2012

Re: Introduction to x64 Assembly

#17
post #9

Why is there no R8H?

There’s also no R9H ... R15H. These “registers", if they existed, would be bits 8-15 of each of R8, R9, etc. Without talking to engineers at AMD, it’s probably impossible to say precisely why they weren’t provided, but there is generally little/no reason to ever want to use the existing *H registers in 64-bit code, so it’s not surprising that they were omitted. Some combination of low/no demand and added encoding/dec…

There are also no RAH, RBH, .... You can only access AH by using the old 32-bit encoding.

This happens because in 32-bit x86, you only have access to AL, AH, BL, BH, CL, CH, DL, DH (no lower bytes of EDI, ESP, etc). These are 8 different possibilities, that are encoded by ModR/M's 3 Reg bits.

In amd64, they decided to regularize the instruction set: those 3 bits are now used to encode the lower byte of EAX--EDI (AL, CL, ..., DIL). To get R8L, ..., R15L you use the REX.R prefix, which acts as the 4th bit.

Re: Introduction to x64 Assembly

#18
post #10

Is there a good Windows assembler that doesn't get flagged by anti-virus software? UPDATE: I just ran across JWAsm and haven't encountered any problems so far. http://sourceforge.net/projects/jwasm/

Can you elaborate on what assemblers get flagged by what anti-virus software? I haven't heard that one before.

Re: Introduction to x64 Assembly

#19
For those of you that went through Z80, 6502, 68000, x86 macro assemblers like myself, it is just me or does the AT&T syntax just suck?

I recently had to convert some code from Intel syntax with NASM macros to GAS with AT&T syntax, and boy what a pain.

Re: Introduction to x64 Assembly

#20
post #10

Is there a good Windows assembler that doesn't get flagged by anti-virus software? UPDATE: I just ran across JWAsm and haven't encountered any problems so far. http://sourceforge.net/projects/jwasm/

Can you elaborate on what assemblers get flagged by what anti-virus software? I haven't heard that one before.

I think it's due to heuristic checking. I just got flagged with the WinASM mentioned in the article and McAfee on my work machine deleted the EXE automatically. I've had similar issues in the past, I think with NASM.
Post reply on HN