ImageCraft Assembly Language Guide, Document # 001-44475 Rev. *B
59
M8C Instruction Set
4.22
Move Indirect, Post-Increment to Memory
MVI
A data pointer in RAM is used to move data between another RAM address and the Accumulator.
The data pointer is incremented after the data transfer has completed.
For PSoC microcontrollers with more than 256 bytes of RAM, special page pointers are used to
allow the
MVI
instructions to access data in remote RAM pages. Two page pointers are available,
one for MVI read (
MVI A, [[expr]++]
) and another for MVI write (
MVI [[expr]++], A
). The
data pointer is always found in the current RAM page. The page pointers determine which RAM
page the data pointer’s address will use. At the end of an
MVI
instruction, user code will be operating
from the same RAM page as before the
MVI
instruction was executed.
Instructions
Operation
Opcode
Cycles Bytes
Mnemonic
Argument
MVI
A, [[expr]++]
0x3E
10
2
MVI
[[expr]++], A
0x3F
10
2
Conditional
Flags:
CF
ZF
Unaffected.
Set if
A
is updated with zero.
Example 1:
mov
[10h], 4
mov
[11h], 3
mov
[EBh], 10h
;initialize MVI read pointer to 10h
mvi
A, [EBh]
;A=4, ram[EBh]=11h
mvi
A, [EBh]
;A=3, ram[EBh]=12h
Example 2:
mov
[EBh], 10h
;initialize MVI write pointer to 10h
mov
A, 8
mvi
[EBh], A
;ram[10h]=8, ram[EBh]=11h
mov
A, 1
mvi
[EBh], A
;ram[11h]=1, ram[EBh]=12h
Multi-Page
Example 3:
mov
reg[CUR_PP], 2
;set Current Page Pointer to 2
mov
[10h], 4
;ram_2[10h]=4
mov
[11h], 3
;ram_2[11h]=3
mov
reg[CUR_PP], 0
;set Current Page Pointer back to 0
mov
reg[MVR_PP], 2
;set MVI read RAM page pointer
mov
[EBh], 10h
;initialize MVI read pointer to 10h
mvi
A, [EBh]
;A=4, ram_0[EBh]=11h
mvi
A, [EBh]
;A=3, ram_0[EBh]=12h
Multi-Page
Example 4:
mov
reg[CUR_PP], 0
;set Current Page Pointer to 0
mov
reg[MVW_PP], 3
;set MVI write RAM page pointer
mov
[EBh], 10h
;initialize MVI read pointer to 10h
mov
A, 8
mvi
[EBh], A
;ram_3[10h]=8, ram_0[EBh]=11h
mov
A, 1
mvi
[EBh], A
;ram_3[11h]=1, ram_0[EBh]=12h
A
ram ram k
ram k
ram k
1
+
ram ram k
A
ram k
ram k
1
+
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 ...