Zen of Assembly language

My answer is generally...write a disassembler. You have touched on ARM, perhaps you know all of the ARM instructions, perhaps not, what about thumb? ARM is a good one to learn with this method, both popular and fixed instruction length, so you can disassemble linearly from beginning to end.
I dont mean write a polished sourceforge worthy disassembler, maybe write 5 or 10 lines of assembler at a time, max, maybe the same instruction with different registers, just enough to parse the binary with a bit if-then-else tree or switches.
add r0, r0, #1 add r0, r1, #1 add r0, r2, #2
Your goal is to examine each bit in the opcode, understand why you can only have 8 bit immediates, understand why some processors only let you jump 127 or 128 bytes for a local conditional branch. You dont have to write a disassembler to do this, but for me it works to embed the information into my brain.
In order to create all the possible opcodes/instructions to test the disassembler, you end up learning all the syntax nuances for the assembler you are using. The assembly language in the chip companies book is not necessarily the exact syntax used by every assembler for that processor family. The mrc/mcr instructions (ARM) are a good example of this. gas in particular is known for the horrible job it does changing the syntax, making it more painful than the chip companies syntax and tools. It depends on what you are trying to do, if you just want to code a few lines or modify something, you dont need to know every corner case or assembler feature, but if you really want to learn the instruction set then I recommend this approach.
You might also like


![]() |
Furby (Teal) Toy (Hasbro)
|
![]() |
Inventor Essentials - A Comprehensive Introduction Software (Video-Tutorials.Net)
|
![]() |
Thames & Kosmos Electricity and Magnetism Toy (Thames & Kosmos)
|
![]() |
Melissa & Doug Traffic Signs and Vehicles Toy (Melissa & Doug)
|
![]() |
Furby (Pink) Toy (Hasbro)
|