EasyManuals Logo

Intel MCS 51 User Manual

Intel MCS 51
334 pages
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Page #87 background imageLoading...
Page #87 background image
intd.
MCS@-51PROGRAMMER’SGUIDEAND INSTRUCTION SET
MOVC A,@A+<baas-reg>
Function:
Description:
Example:
MoveCodebyte
The MOVCinatmctionsload the Accumulatorwith a oodebyte, or constantfrom program
memory.Theaddressofthe bytefetchedisthesumofthe originalunsignedeight-bitAccumu-
lator contents and the contentsof a sixteen-bitbase register, whichmay be either the Data
Pointeror the PC. In the latter case, the PC is incrementedto the addressof the following
instructionbeforebeingadded with the Accumulator;otherwis
e the base register is not al-
tered. Sixteen-bitaddition is performedso a carry-out from the low-ordereight bits may
propagatethroughhigha-order bits. No flagsare affected.
A valuebetweenOand 3 is in the Accumulator.The followinginstructionswilltranslate the
valuein the Accumulatorto one of fourvaluesdefimedby the DB (definebyte)directive.
REL-PC: INC A
MOVC A,@A+PC
RET
DB
66H
DB 77H
DB
88H
DB
99H
If the subroutineis calledwith the Accumulatorequalto OIH,it willreturn with 77Hin the
Auxmmlator.The INCA beforethe MOVCinstructionis neededto “get around” the RET
instructionabovethe table. If severalbytesof codeseparated the MOVCfrom the table, the
correspondingnumberwouldbe addedto the Accumulatorinstead.
MOVC ~@A+
DPTR
Bytes:
Cycles:
Encoding:
Operation:
MOVC A,@A +
Bytes:
Cycles:
Encoding:
Operation:
1
2
11001 10011 I
MOVC
(A)+ ((A) + (D~))
Pc
1
2
1000
0011
MOVC
(PC)+ (PC) + 1
(A)- ((A) + (PC))
2-57

Table of Contents

Questions and Answers:

Question and Answer IconNeed help?

Do you have a question about the Intel MCS 51 and is the answer not in the manual?

Intel MCS 51 Specifications

General IconGeneral
BrandIntel
ModelMCS 51
CategoryMicrocontrollers
LanguageEnglish

Related product manuals