Re:The faker's guide to reading (x86) assembly language
by Donckele on Wednesday January 04, 2023 @01:18AM
(#34242642)
Regarding the book, What would be the difference between 32bit and 64bit? Is it still relevant to read today?
[ Parent
| on HN ]
Re:The faker's guide to reading (x86) assembly language
by harry8 on Wednesday January 04, 2023 @03:12AM
(#34243263)
Yes - it is one way to do it and it will work and be reasonably efficient. Everyone[1] who knows x86-64 asm today learned 32 bit first. You still have 32 bit instructions, and 16 bit, and 8 bit. The instructions will translate. You get more registers. You need to update the function and syscall calling conventions. There's no reason there can't be "learn x64 asm" books but there aren't many last I looked, but maybe someone can link us up to show how wrong I am?
https://wiki.osdev.org/Calling_Conventions
Richard Blum [2] after Dunteman.
[1] At a reasonable level of approximation.
[2] https://www.wiley.com/en-us/Professional+Assembly+Language-p...
Re:The faker's guide to reading (x86) assembly language
by saagarjha on Wednesday January 04, 2023 @05:45AM
(#34244131)
I would doubt that, people haven't been running 32-bit x86 code for years at this point.
Re:The faker's guide to reading (x86) assembly language
by 15155 on Wednesday January 04, 2023 @11:50AM
(#34247965)
How exactly do you get away with not using the 32-bit subset of AMD64 ASM?
"32-bit x86 code" just means "code that does not use any of the AMD64 ISA." (And at this point, probably SSE2+ and a handful of other extensions.)
GP is correct: anyone that "knows" AMD64 assembly inherently must know 32-bit ASM because one must use the original x86 registers, instructions, etc. for the vast majority of tasks.
People are still constantly running what was formerly known as "32-bit x86 code" in their 64-bit applications.
Re:The faker's guide to reading (x86) assembly language
by saagarjha on Thursday January 05, 2023 @05:03AM
(#34257898)
I read “learned 32-bit first” as “learned on i386 machines”, not “learned what the 32-bit instructions do on 64-bit computers”. There’s a big difference between these two, because the way you write code for a machine that doesn’t do 64-bit is quite different, since you have many more registers, the calling convention is pretty different, etc.
Re:The faker's guide to reading (x86) assembly language
by markus_zhang on Wednesday January 04, 2023 @12:49PM
(#34248872)
From my very limited RE experience, one difference is calling convention: 32-bit passes a lot of stuffs on stack while 64-bit passes the first 8 (IIRC) through registers and the rest on stack. I could be wrong but this is one glaring difference. Another one of course is the registers them selves: EAX vs RAX for example.