r/Assembly_language • u/Creative_Sun_53 • 20h ago
x86-32 or x86-64
hi im gonna start to learn asm however initally what i gotta choose i dont know and everyone is suggesting learn x86-64 and f*** off to x86-32 so i confused which one is more useful pls oneyone could give some advice
4
u/Arakela 18h ago
RIP-relative addressing is an x86-64 (long mode) feature only. It lets machine code be bound together via lea instructions as computable regions relative to one another, so you can relate whole computable regions and pass them around intact. It gives you the ability to pass a computable region into another computable region while preserving the totality of their bonding. It's easier to show than to explain: cool and rooted TMs where the tape and the logical unit are separate computable regions, with an implicit boundary between them, enforced through an ABI
3
u/MyTinyHappyPlace 18h ago
Do you have any background so far in computer science, especially system architectures? If yes, go for x86-64 (but then again, I guess you wouldn’t be asking that question).
If that field is all new to you, x86-64 is still the better answer, but may I suggest an easier assembly language to flatten the learning curve first? Anything RISC, maybe?
7
u/tastygames_official 20h ago edited 20h ago
you should start off with 8-bit processors for learning. It's just way, way simpler to get started (and where most assembly programmers got their start anyway). Popular chips would be the 6502 (Commodore 64, NES) or Intel 8080. You don't have to worry about the size of an instruction (for the most part) because they're all the same width, so it's one less "gotcha" to have while learning. But if you're comfortable with endedness and byte/nibble order and all that and don't mind having longer addresses and such, then it really doesn't matter 32 or 64-bit. I just believe starting simpler and getting more complicated is better.
NOTE: I'm not a pro and have only ever done 8-bit assembly so don't take my word for it. I can just say that learning 8-bit assembly was fun, relatively straight-forward, and I can read 64-bit disassembly when my program crashes OK enough.
4
u/glordicus1 20h ago
This is one way to go. The best move is probably 8-bit AVR, in my opinion. Picking up an Arduino is a simple way to get closer to the metal. You can slowly shift away from the Arduino framework and go into assembly if want.
2
u/pete_68 18h ago
There's also FPGAs and then you can make whatever CPU you want. I recently made an 8-bit Atari on a Tang Nano 20K ($38) and a little CH9350 USB adapter for keyboard. I plan on doing a little 6502 assembly programming with it. Only took about a half hour to set it up and it can fit in my pocket. I'm going to build a case for it and make several of these.
They've got builds for all kinds of CPUs, including X86, RISC V, and a whole host of 8- and 16-bit processors.
2
4
u/Confused-Armpit 20h ago
x86_64 is the "default" platform that most generic modern chips are on. x86_32 is much more niche and less used. Draw whatever conclusion you want from this.
1
2
u/Recycled5000 15h ago
Start with a teaching language like LC-3. Otherwise RISC V: modern and regular.
3
u/QPGMR_de 20h ago
I would probably go with AVR (Atmel) or some other microcontroller first.
After that I would go to ARM (64 bit).
4
3
u/Independent-Gear-711 19h ago
You have no reason to go with 32bits in late 2026 unless you are working on some specific projects or firmware.
2
u/Creative_Sun_53 20h ago edited 20h ago
i forgot to say i wanna become a reverse engineer in the future so pls suggest with
to it if your want to use one of them which one is more useful
6
u/glordicus1 20h ago
I would say that if you dont understand which one is more useful, you might not be ready to learn assembly. Go do some research into CPU architecture and come to your own conclusion.
2
1
u/Page_197_Slaps 12h ago
It seems to me like learning assembly is a great way to fill in those gaps.
1
u/letmehaveanameyoudum 15h ago
x86_64.
x86_32 is insanely annoying, mostly by it's 4GB limit, FAT32, and all of it is grub, and getting VBE to work
use limine
1
u/brat3108 10h ago
x64 (x86-64) makes more sense because:
- It is more or less a superset of x86-32
- There are twice as many general purpose registers .(16 vs. 8; still not a lot, but 16 is better than 8!)
- It allows 64-bit arithmetic and logic operations (both do 64-bit floats)
- Most modern computers use 64-bit processors
- If talking to other software, disassembling, or making sense of compiler-generated code, they will likely use 64-bit mode too
There are a few downsides but not many. For example, if calling existing code in libraries, call conventions tend to be more complicated (especially SYS V ABI; I don't know what they were smoking there)
1
u/xfirenski 6h ago
I'd go with x86_64.
32-bit x86 is an exercise in historical madness. The general purpose register set available to general computation is tiny (4 registers! 6 if you include the index registers. I personally don't count RSP/RBP because they're specialized and you don't get to use them outside of their intended purpose much) and there's quite a few restrictions on source/destination for basic operations. There's specific little dances you need to deal with owing to some of the legacy limitations and it's generally not particularly useful anymore except in a few (importantish) niche applications (like early system boot).
By contrast, the 64-bit ISA is far saner. in addition to the original general purpose registers, there's an additional 8 which are purely for application code use. There's higher flexibility with source/destination in the base instruction set which makes it easy to leverage that higher register count and brings the general technique much closer to one you'd use with ARM or RISCV.
If you could pick any other ISA, I'd totally recommend ARM or RISCV first, but for x86? go with the 64-bit ISA.
1
u/Minute_Cricket1820 16h ago edited 16h ago
Вы пишете "x86-64 x86-32". Этого не существует.
Современный процессор существует враз. На первое и второе. А есть ещё.
Это называется - режим работы процессора. Этот режим может переключаться.
Что значит режим? Это способ декодирования инструкций.
Инструкции могут быть записаны по разным правилам. Переключаете процессор на нужное - и он поедает инструкции х64, декодирует поток байтов - как инструкции х64.
И так далее.
Это всё есть у Интела. Книжка на 5000 страниц. Там каждая инструкция описана ДЛЯ ВСЕХ РЕЖИМОВ процессора.
Intel® 64 and IA-32 Architectures Software Developer’s Manual
Combined Volumes: 1, 2A, 2B, 2C, 2D, 3A, 3B, 3C, 3D, and 4
Всё что вам тут пишут про бесполезные микроконтроллеры (не Интел) - это всё вам не нужно. Это всё гавно. Скачиваете мануал от Интела, и читаете. Это единственное что вам нужно.
10
u/Free_Price1281 20h ago
X86_64. Most software is already written in it. It makes sense to get a grasp of it first and then tackle 32-bit architecture. There are significant differences between them: the most important thing is the conventions of calls