PICkit™ 3 Starter Kit User’s Guide
DS41628B-page 36 2012 Microchip Technology Inc.
2.16.3 Numbers in the Assembler
Unless otherwise specified, the assembler assumes any numeric constants in the
program are hexadecimal (base 16). Binary (base 2), octal (base 8), decimal (base 10),
and ASCII coding are also supported.
2.16.4 Numbers in the XC8 Compiler
Unless otherwise specified, the compiler assumes any numeric constants in the
program are decimal (base 10).
2.17 MPASM ASSEMBLER DIRECTIVES
Directives are assembler commands that appear in the source code, but are not usually
translated directly into opcodes. They are used to control the assembler: its input,
output, and data allocation.
Many of the assembler directives have alternate names and formats. These may exist
to provide backward compatibility with previous assemblers from Microchip, and to be
compatible with individual programming practices.
All of the directives for the MPASM assembler can be found inside the IDE under
Help->Help
Contents
2.17.1 Banksel
banksel label
This directive is an instruction to the assembler and linker to generate bank selecting
code to set the bank to the bank containing the designated label. The programmer
should always use this directive instead of setting the BSR directly, to avoid the possi-
bility of human error.
2.17.2 cblock
EXAMPLE 2-5:
This is used to define a block of variables starting at address address.
TABLE 2-1: NUMBERS IN THE ASSEMBLER
Radix Format Example
Hexadecimal # or 0x# or H’#’ 12 or 0x12 or H’12’
Decimal .# or D’#’Octal or O’#’ .12 or D’12’Octal or O’12’
Binary B’#’ B’00010010’
ASCII A’#’ or ‘#’ A’c’ or ‘c’
TABLE 2-2: NUMBERS IN THE COMPILER
Radix Format Example
Hexadecimal 0x# 0x12
Decimal # 12
Binary 0b# 0b00010010
ASCII ‘#’ ‘c’
cblock [address]
Variable
endc