汇编语言基础:
整数常量与进制表达(integer constants)
Synopsis:[{+| −}]digits[radix]
正或者符号 数字 基数
基数(进制)表达表
h Hexadecimal 十六进制
b Binary 二进制
d Decimal 十进制
q/o Octal 八进制
r Encoded real
t Decimal(alternate)
y Binary (alternate)
例子:
26 Decimal 42o Octal
26d Decimal 1Ah Hexadecimal
11010011b Binary 0A3hHexadecimal
42q Octal
表达式运算符与优先级:
实数常量:
[sign]integer.[integer][exponent]
例子:
2.
+3.0
-44.2E+05
26.E5
字符常量:
是用单引号或者双引号括起来的单个字符常量
例子:
'A'
"d"
字符串常量:
是以单引号或者双引号括起来的多个字符(字符串)的常量
例子:
'ABC'
'X'
"Good night,Gracie"
'4096'
如果显示字符串时需要显示双引号 为了不让编译器歧义 可以:
"This isn't atest"
'Say "Goodnight," Gracie'
标示符(identifier):
大小写随意
可以是任意从1-247的字符
第一个字符必须是字母后面可以跟字母或者数字
所有标示符不能跟keyword重名(ex:mov,sub,byte)
伪指令(directives)->这个翻译很怪异的说
“A Directive is a command embeddedin the source code that is recognized and acted upon by the
assembler.Directives do not execute at runtime. Directives can define variables, macros,and
procedures.They can assign names to memory segments and perform many other housekeeping
tasksrelated to the assembler.”
伪指令内嵌在源代码中,且被汇编器执行和认可。伪指令不在运行时执行… 伪指令可以定义变量 宏和过程
大小写不明感.data.DATA和.Data是一样的
“Thefollowing example helps to show the difference between directives andinstructions. The
DWORDdirective tells the assembler to reserve space in the program for a doublewordvariable.
TheMOV instruction, on the other hand, executes at runtime, copying the contentsofmyVar tothe EAXregister:“
下面的例子帮助我们区分伪指令和真正的指令