
CYRF69103
Document #: 001-07611 Rev *B
Page 11 of 73
Stack Pointer Register
CPU Program Counter High Register
CPU Program Counter Low Register
Addressing Modes
Examples of the different addressing modes are discussed in
this section and example code is given.
Source Immediate
The result of an instruction using this addressing mode is
placed in the A register, the F register, the SP register, or the
X register, which is specified as part of the instruction opcode.
Operand 1 is an immediate value that serves as a source for
the instruction. Arithmetic instructions require two sources.
Instructions using this addressing mode are two bytes in
length.
Examples
ADD
Source Direct
The result of an instruction using this addressing mode is
placed in either the A register or the X register, which is
specified as part of the instruction opcode. Operand 1 is an
address that points to a location in either the RAM memory
space or the register space that is the source for the
instruction. Arithmetic instructions require two sources; the
second source is the A register or X register specified in the
opcode. Instructions using this addressing mode are two bytes
in length.
Table 6. CPU Stack Pointer Register (CPU_SP)
Bit #
7
6
5
4
3
2
1
0
Field
Stack Pointer [7:0]
Read/Write
–
–
–
–
–
–
–
–
Default
0
0
0
0
0
0
0
0
Bits 7:0
8-bit data value holds a pointer to the current top-of-stack
Stack Pointer [7:0]
Table 7. CPU Program Counter High Register (CPU_PCH)
Bit #
7
6
5
4
3
2
1
0
Field
Program Counter [15:8]
Read/Write
–
–
–
–
–
–
–
–
Default
0
0
0
0
0
0
0
0
Bits 7:0
8-bit data value holds the higher byte of the program counter
Program Counter [15:8]
Table 8. CPU Program Counter Low Register (CPU_PCL)
Bit #
7
6
5
4
3
2
1
0
Field
Program Counter [7:0]
Read/Write
–
–
–
–
–
–
–
–
Default
0
0
0
0
0
0
0
0
Bit 7:0
8-bit data value holds the lower byte of the program counter
Program Counter [7:0]
Table 9. Source Immediate
Opcode
Operand 1
Instruction
Immediate Value
A,
7
;In this case, the immediate value
;of 7 is added with the Accumulator,
;and the result is placed in the
;Accumulator.
MOV
X,
8
;In this case, the immediate value
;of 8 is moved to the X register.
AND
F,
9
;In this case, the immediate value
;of 9 is logically ANDed with the F
;register and the result is placed
;in the F register.
[+] Feedback