Microchip Technology XC8 Standard Compiler (Workstation) SW006021-1 SW006021-1 User Manual

Product codes
SW006021-1
Page of 518
MPLAB
®
 XC8 C Compiler User’s Guide
DS52053B-page 264
 2012 Microchip Technology Inc.
6.4.9.17
IRP AND IRPC
The IRP and IRPC directives operate in a similar way to REPT; however, instead of 
repeating the block a fixed number of times, it is repeated once for each member of an 
argument list.
In the case of IRP, the list is a conventional macro argument list; in the case or IRPC, 
it is each character in one argument. For each repetition the argument is substituted for 
one formal parameter.
For example:
IRP number,4865h,6C6Ch,6F00h
    DW number
ENDM
would expand to:
    DW 4865h
    DW 6C6Ch
    DW 6F00h
Note that you can use local labels and angle brackets in the same manner as with 
conventional macros.
The IRPC directive is similar, except it substitutes one character at a time from a string 
of non-space characters.
For example:
IRPC char,ABC
    DB ’char’
ENDM
will expand to:
    DB ’A’
    DB ’B’
    DB ’C’
6.4.9.18
BANKSEL
This directive can be used to generate code to select the bank of the operand. The 
operand should be the symbol or address of an object that resides in the data memory. 
SeSection 6.4.1.2 “Bank and Page Selection”.
6.4.9.19
PAGESEL
This directive can be used to generate code to select the page of the address operand. 
SeSection 6.4.1.2 “Bank and Page Selection”.
6.4.9.20
PROCESSOR
The output of the assembler may vary depending on the target device. The device 
name is typically set using the --CHIP option to the command-line driver xc8, see 
Section 4.8.20 “--CHIP: Define Device”, or using the assembler’s --CHIP option, 
see Section 6.3.14 “--CHIP: Specify Device Name”, but can also be set with this 
directive, for example:
PROCESSOR 16F877
This directive will override any device selected by any command-line option.