Microchip Technology XC8 Standard Compiler (Workstation) SW006021-1 SW006021-1 ユーザーズマニュアル

製品コード
SW006021-1
ページ / 518
Macro Assembler
 2012 Microchip Technology Inc.
DS52053B-page 261
6.4.9.11
DABS
This directive allows one or more bytes of memory to be reserved at the specified 
address. The general form of the directive is:
DABS memorySpaceaddressbytes
where memorySpace is a number representing the memory space in which the reser-
vation will take place, address is the address at which the reservation will take place, 
and bytes is the number of bytes that is to be reserved.
This directive differs to the DS directive in that it can be used to reserve memory at any 
location, not just within the current psect. Indeed, these directives can be placed any-
where in the assembly code and do not contribute to the currently selected psect in any 
way.
The memory space number is the same as the number specified with the space flag 
option to psects (see Section 6.4.9.3.13 “Space”).
The code generator issues a DABS directive for every user-defined absolute C variable, 
or for any variables that have been allocated an address by the code generator.
The linker reads this DABS-related information from object files and will ensure that the 
reserved address are not used for other memory placement.
6.4.9.12
IF, ELSIF, ELSE AND ENDIF
These directives implement conditional assembly. The argument to IF and ELSIF 
should be an absolute expression. If it is non-zero, then the code following it up to the 
next matching ELSE, ELSIF or ENDIF will be assembled. If the expression is zero then 
the code up to the next matching ELSE or ENDIF will be skipped. These directives do 
not implement a runtime conditional statement in the same way that the C statement 
if()
 does; they are evaluated at compile time.
At an ELSE the sense of the conditional compilation will be inverted, while an ENDIF 
will terminate the conditional assembly block.
For example:
IF ABC
    GOTO aardvark
ELSIF DEF
    GOTO denver
ELSE
    GOTO grapes
ENDIF
In this example, if ABC is non-zero, the first GOTO instruction will be assembled but not 
the second or third. If ABC is zero and DEF is non-zero, the second GOTO instruction will 
be assembled but the first and third will not. If both ABC and DEF are zero, the third 
GOTO
 instruction will be assembled. Note in the above example, only one GOTO instruc-
tion will appear in the output; which one will be determined by the values assigned to 
ABC
 and DEF.
Conditional assembly blocks may be nested.