当前位置: 动力学知识库 > 问答 > 编程问答 >

assembly - 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

网友答案:

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.

分享给朋友:
您可能感兴趣的文章:
随机阅读: