汇编语言的基本知识

来源:互联网 发布:木油漆哪个品牌好 知乎 编辑:程序博客网 时间:2024/06/17 08:29

1)instruction和directive

中文翻译都叫“指令”,但是instruction才是最终被翻译成机器码的,directive是用来告诉汇编器怎么去处理汇编程序的(就像C语言的define、include等一样)。


2)

Statement format:
[label:] mnemonic [operands][;comments]
Label:
Cannot exceed 31 characters.
Consists:
Alphabetic characters both upper and lowercase.
Digits 0 through 9.
Special characters ( ? ), ( . ), ( @ ), ( _ ),and ( $ ).
The first character cannot be a digit.
The period can only be used as the firstcharacter, but its use is not recommended. Several reserved words begin with itin later versions of MASM.


3)注释

用;


4)

Label:
Must end with a colon when it refers to anopcode generating instruction.
Do not need to end with a colon when it refers to adirective.
Mnemonicand operands:
Instructions are translated into machine code.
Directives do not generate machine code. They are used by theassembler to organize the program and direct the assembly process.

原创粉丝点击