Semiconductor Group
4-53
1998-04-01
Instruction Set
C500 Family
MOVC
A, @A + <base-reg>
Function:
Move code byte
Description:
The MOVC instructions load the accumulator with a code byte, or constant from
program memory. The address of the byte fetched is the sum of the original
unsigned eight-bit accumulator contents and the contents of a sixteen-bit base
register, which may be either the data pointer or the PC. In the latter case, the PC
is incremented to the address of the following instruction before being added to the
accumulator; otherwise the base register is not altered. Sixteen-bit addition is
performed so a carry-out from the low-order eight bits may propagate through
higher-order bits. No flags are affected.
Example:
A value between 0 and 3 is in the accumulator. The following instructions will
translate the value in the accumulator to one of four values defined by the DB
(define byte) directive.
REL_PC: INC
A
MOVC
A, @A + PC
RET
DB
66H
DB
77H
DB
88H
DB
99H
If the subroutine is called with the accumulator equal to 01H, it will return with 77H
in the accumulator. The INC A before the MOVC instruction is needed to Òget
aroundÓ the RET instruction above the table. If several bytes of code separated the
MOVC from the table, the corresponding number would be added to the
accumulator instead.
MOVC
A, @A + DPTR
Operation:
MOVC
(A)
¬
((A) + (DPTR))
Bytes:
1
Cycles:
2
Encoding:
1 0 0 1
0 0 1 1