汇编语言笔记1 基础数据,定义,语令

本文介绍了汇编语言的基础知识,包括整数常量与进制表达、表达式运算符与优先级、实数和字符常量、标示符、伪指令与指令。还讲解了数据定义如变量、字符串、数组的初始化,以及如何计算数组长度和使用EQU、TEXTEQU等伪指令。
摘要由CSDN通过智能技术生成

汇编语言基础:

整数常量与进制表达(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:“

 

下面的例子帮助我们区分伪指令和真正的指令

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值