Ax51的控制语法

Ax51User's Guide

http://www.keil.com/support/man/docs/a51/a51_controls.htm

 

Control Statements

Home » Control Statements

The Ax51 Assembler provides a number of control statements that permit you to define symbol values, reserve and initialize storage, and control the placement of your code.

These statements should not be confused with processor instructions or with assembler directives. They do not produce executable code and, with the exception of the DB, DD, and DW statements, they have no direct effect on the contents of code memory. These controls change the state of the assembler, define user symbols, and add information to the object file.

Control statements may be divided into the following categories:

Address Control

 

StatementDescription
EVEN1Forces the location counter to the next even address.
ORGSets the location counter to a specifies offset or address.
USINGSpecifies which register bank to use.

Conditional Assembly

 

StatementDescription
IFBegins an IF-ELSE-ENDIF block.
ELSEIFBegins an alternate IF block.
ELSEBegins an ELSE block.
ENDIFTerminates an IF block.

Memory Initialization

 

StatementDescription
DBAllocates memory for one or more defined byte values.
DD1Allocates memory for one or more defined double word values.
DWAllocates memory for one or more defined word values.

Memory Reservation

 

StatementDescription
DBITReserves space for one or more bits.
DSReserves space for one or more bytes.
DSB1Reserves space for one or more bytes.
DSD1Reserves space for one or more double words.
DSW1Reserves space for one or more words.

Procedure Declaration

 

StatementDescription
ENDP1Defines the end of a function.
LABEL1Assigns an address to a symbolic name.
PROC1Defines the beginning of a function.

Program Linkage

 

StatementDescription
EXTERN1Defines external symbols.
EXTRNDefines external symbols.
NAMESpecifies the name of the current module.
PUBLICDefines symbols which may be used in other modules.

Segment Control

 

StatementDescription
BSEGDefines an absolute bit segment.
CSEGDefines an absolute code segment.
DSEGDefines an absolute data segment.
ISEGDefines an absolute idata segment.
RSEGSelects a relocatable segment.
SEGMENTDefines a relocatable segment.
XSEGDefines an absolute xdata segment.

Symbol Definition

 

StatementDescription
BITDefines an address in bit space.
CODEDefines an address in code space.
DATADefines an address in data space.
EQUSets a permanent symbol value.
IDATADefines an address in idata space.
LIT1Assigns a text string to a symbol name.
SBITDefines a bit SFR.
SETSets or resets a symbol value.
SFRDefines a byte SFR.
SFR16Defines a word SFR.
XDATADefines an address in xdata space.

Miscellaneous

 

StatementDescription
__ERROR__Generates an error message.
END

Signals the end of the assembly module.

 

Note

  1. This directive is available in the AX51 Assembler only.

 

 

 

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值