wowpatrick
wowpatrick

Reputation: 5180

What are the IA-32 Keywords?

What are the IA-32 Keywords? What are the restrictions for label names? I'm currently writing assembly code in the AT&T Syntax - Bonus: I'm not even sure what the difference between Intel and AT&T Syntax is.

Edit: I'd mostly like to know which restrictions there are no labels, for example, is print a allowed label name?

print:
pushl %eax
pushl $str
call printf     # output contents of stack according to out string
popl %eax       # Clean up the stack, remove the parameters of print
jmp end 

Upvotes: 0

Views: 107

Answers (1)

Devolus
Devolus

Reputation: 22084

The restrictions you are talking about are assembler parser specific, so without telling which assembler you are using, you can not answer this question in a meaningfull way. For masm a general guide is that you use @@ for local labels and a label may not start with a number. Other assemblers use similar rules, but not neccessarily or they may vary in details.

The main difference between Intel and AT&T Syntax is that the assignment is reversed. Intel uses

 mov    eax, value   ;  eax = value

and AT&T uses

mov    value, %eax   ; Move value to eax.

Obviously there are more to it, but this is way to broad for answering here, so I recommend reading the manuals or google.

For a start you can look here: http://en.wikipedia.org/wiki/X86_assembly_language#Syntax to find a bit more.

Upvotes: 1

Related Questions