ImageCraft Assembly Language Guide, Document # 001-44475 Rev. *B
29
ImageCraft Assembler
Registers.
These have two forms in PSoC devices. The first type are those that exist in the two
banks of user-accessible registers. The second type are those that exist in the microcontroller.
contains examples for all types of register operands.
RAM.
These references are made by enclosing the address or expression in square brackets. The
Assembler will evaluate the expression to create the actual RAM address.
Expressions.
These may be constructed using any combination of labels, constants, the dot opera-
tor, and the arithmetic and logical operations defined in
.
Only the Addition expression (+) may apply to a re-locatable symbol (i.e., an external symbol). All
other expressions must be applied to constants or symbols resolvable by the Assembler (i.e., a sym-
bol defined in the file).
3.1.4
Comments
A comment starts with a semicolon (
;
) or a double slash (
//
) and goes to the end of a line. It is usu-
ally used to explain the assembly code and may be placed anywhere in the source file. The Assem-
bler ignores comments; however, they are written to the listing file for reference.
Table 3-3. Register Formats
Type
Formats
Example
User-Accessible Registers
reg[expr]
MOV
A, reg[0x08] ;register at address 8
MOV
A reg[OU+8] ;address = label OU + 8
M8C Registers
A
MOV
A, 8
;move 8 into the accumulator
F
OR
F, 1
;set bit 0 of the flags
SP
MOV
SP, 8
;set the stack pointer to 8
X
MOV
X, 8
;set the M8C’s X reg to 8
Table 3-4. RAM Format
Type
Formats
Example
Current RAM Page
[expr]
MOV
A, [0x08]
;RAM at address 8
MOV
A, [OU+8]
;address = label OU + 8
Table 3-5. Expressions
Precedence
Expression
Symbol
Form
1
Bitwise Complement
~
(~ a)
2
Multiplication
Division
Modulo
*
/
%
(a * b)
(a / b)
(a % b)
3
Addition
Subtraction
+
-
(a + b)
(a – b)
4
Bitwise AND
&
(a & b)
5
Bitwise XOR
^
(a ^ b)
6
Bitwise OR
|
(a | b)
7
High Byte of an Address
>
(>a)
8
Low Byte of an Address
<
(< a)
Summary of Contents for PSoC DESIGNER ImageCraft M8C
Page 6: ...6 ImageCraft Assembly Language Guide Document 001 44475 Rev B Contents Feedback ...
Page 10: ...10 ImageCraft Assembly Language Guide Document 001 44475 Rev B Introduction Feedback ...
Page 24: ...24 ImageCraft Assembly Language Guide Document 001 44475 Rev B M8C Microprocessor Feedback ...
Page 95: ...ImageCraft Assembly Language Guide Document 001 44475 Rev B 95 Assembler Directives Feedback ...
Page 96: ...96 ImageCraft Assembly Language Guide Document 001 44475 Rev B Assembler Directives Feedback ...
Page 104: ...104 ImageCraft Assembly Language Guide Document 001 44475 Rev B Feedback ...
Page 108: ...108 ImageCraft Assembly Language Guide Document 001 44475 Rev B Index Feedback ...