intermezzOS / journey

Supplemental Book to intermezzOS exploring low level concepts like stack vs. heap, assembly language and virtual memory.
7 stars 1 forks source link

Assembly notation #4

Open rylev opened 8 years ago

rylev commented 8 years ago

Which assembly notation should we use?

intermezzOS has used Intel notation so far because that's what nasm expects. However, some books prefer AT&T notation, and this is what objdump disassembles to by default. AT&T is a bit nosier than Intel, but it has (in my opinion) a nicer order of operands. For example, mov %eax, %ebx copies the contents of eax into ebx. The equivalent in Intel notation is mov ebx, eax.

steveklabnik commented 8 years ago

This is a good question. I've always been stuck, because I prefer the order of operands in AT&T, but prefer the non-sigils of Intel.

Rust's inline assembly uses AT&T, IIRC. So that might be a good tiebreaker.