8051 Instruction Set: Click Here For Happy Ending
8051 Instruction Set: Click Here For Happy Ending
Subject: Fw:8051instruction
From:
sreeramraghu([email protected])
To:
[email protected]@gdrive.com
Date:
Friday,24June20163:20PM
OnWednesday,22August20074:03AM,sreeramraghu<[email protected]>wrote:
Onceuponatimetherewas1GBstorageinyourinbox.Clickhereforhappyending.
8051InstructionSet
Instructionsbyopcode
0x00 0x01 0x02
0x00 NOP AJMP LJMP
0x10 JBC ACALL LCALL
AJMP RET
0x20 JB
0x30 JNB ACALL RETI
AJMP ORL
0x40 JC
0x50 JNC ACALL ANL
AJMP XRL
0x60 JZ
0x70 JNZ ACALL ORL
0x80 SJMP AJMP ANL
0x90 MOV ACALL MOV
0xa0 ORL AJMP MOV
0x03 0x04 0x05 0x06 0x07 0x08 0x09 0x0a 0x0b 0x0c 0x0d 0x0e 0x0f
RR
INC
INC
INC
INC
INC
INC
INC
INC
INC
INC
INC
INC
RRC
DEC
DEC
DEC
DEC
DEC
DEC
DEC
DEC
DEC
DEC
DEC
DEC
RL
ADD
ADD
ADD
ADD
ADD
ADD
ADD
ADD
ADD
ADD
ADD
ADD
RLC
ADDC ADDC ADDC ADDC ADDC ADDC ADDC ADDC ADDC ADDC ADDC ADDC
ORL
ORL
ORL
ORL
ORL
ORL
ORL
ORL
ORL
ORL
ORL
ORL
ORL
ANL
ANL
ANL
ANL
ANL
ANL
ANL
ANL
ANL
ANL
ANL
ANL
ANL
XRL
XRL
XRL
XRL
XRL
XRL
XRL
XRL
XRL
XRL
XRL
XRL
XRL
JMP
MOV
MOV
MOV
MOV
MOV
MOV
MOV
MOV
MOV
MOV
MOV
MOV
MOV
MOV
MOV
MOV
MOV
MOV
MOV
MOV
MOV
MOV
MOV
MOVC DIV
MOVC SUBB SUBB SUBB SUBB SUBB SUBB SUBB SUBB SUBB SUBB SUBB SUBB
INC
MUL
MOV
MOV
MOV
MOV
MOV
MOV
MOV
MOV
MOV
MOV
CJNE CJNE CJNE CJNE CJNE CJNE CJNE CJNE CJNE CJNE CJNE
XCH
XCH
XCH
XCH
XCH
XCH
XCH
XCH
XCH
XCH
XCH
DJNZ XCHD XCHD DJNZ DJNZ DJNZ DJNZ DJNZ DJNZ DJNZ DJNZ
MOV
MOV
MOV
MOV
MOV
MOV
MOV
MOV
MOV
MOV
MOV
MOV
MOV
MOV
MOV
MOV
MOV
MOV
MOV
MOV
MOV
MOV
ACALLAbsoluteCall
ADD,ADDCAddAccumulator(WithCarry)
AJMPAbsoluteJump
ANLBitwiseAND
CJNECompareandJumpifNotEqual
CLRClearRegister
CPLComplementRegister
DADecimalAdjust
DECDecrementRegister
DIVDivideAccumulatorbyB
DJNZDecrementRegisterandJumpifNotZero
INCIncrementRegister
about:blank
1/13
6/25/2016
JBJumpifBitSet
JBCJumpifBitSetandClearBit
JCJumpifCarrySet
JMPJumptoAddress
JNBJumpifBitNotSet
JNCJumpifCarryNotSet
JNZJumpifAccumulatorNotZero
JZJumpifAccumulatorZero
LCALLLongCall
LJMPLongJump
MOVMoveMemory
MOVCMoveCodeMemory
MOVXMoveExtendedMemory
MULMultiplyAccumulatorbyB
NOPNoOperation
ORLBitwiseOR
POPPopValueFromStack
PUSHPushValueOntoStack
RETReturnFromSubroutine
RETIReturnFromInterrupt
RLRotateAccumulatorLeft
RLCRotateAccumulatorLeftThroughCarry
RRRotateAccumulatorRight
RRCRotateAccumulatorRightThroughCarry
SETBSetBit
SJMPShortJump
SUBBSubtractFromAccumulatorWithBorrow
SWAPSwapAccumulatorNibbles
XCHExchangeBytes
XCHDExchangeDigits
XRLBitwiseExclusiveOR
UndefinedUndefinedInstruction
8051InstructionSet:ACALL
Operation: ACALL
Function: AbsoluteCallWithin2KBlock
Syntax:
ACALLcodeaddress
Instructions
ACALLpage0
0x11
None
ACALLpage1
0x31
None
ACALLpage2
0x51
None
ACALLpage3
0x71
None
ACALLpage4
0x91
None
ACALLpage5
0xB1
None
ACALLpage6
0xD1
None
ACALLpage7
0xF1
None
Description:ACALLunconditionallycallsasubroutineattheindicatedcodeaddress.ACALLpushesthe
addressoftheinstructionthatfollowsACALLontothestack,leastsignificantbytefirst,mostsignificantbyte
second.TheProgramCounteristhenupdatedsothatprogramexecutioncontinuesattheindicated
address.
about:blank
2/13
6/25/2016
ThenewvaluefortheProgramCounteriscalculatedbyreplacingtheleastsignificantbyteoftheProgram
CounterwiththesecondbyteoftheACALLinstruction,andreplacingbits02ofthemostsignificantbyteof
theProgramCounterwith3bitsthatindicatethepage.Bits37ofthemostsignificantbyteoftheProgram
Counterremainunchaged.
Sinceonly11bitsoftheProgramCounterareaffectedbyACALL,callsmayonlybemadetoroutines
locatedwithinthesame2kblockasthefirstbytethatfollowsACALL.
SeeAlso:LCALL,RET
8051InstructionSet:ADD
Operation: ADD,ADDC
Function: AddAccumulator,AddAccumulatorWithCarry
Syntax:
ADDA,operand
ADDCA,operand
Instructions
OpCode Bytes
Flags
Instructions
OpCode Bytes
Flags
ADDA,#data
0x24
C,AC,OV
ADDCA,#data
0x34
C,AC,OV
ADDA,iramaddr
0x25
C,AC,OV
ADDCA,iramaddr
0x35
C,AC,OV
ADDA,@R0
0x26
C,AC,OV
ADDCA,@R0
0x36
C,AC,OV
ADDA,@R1
0x27
C,AC,OV
ADDCA,@R1
0x37
C,AC,OV
ADDA,R0
0x28
C,AC,OV
ADDCA,R0
0x38
C,AC,OV
ADDA,R1
0x29
C,AC,OV
ADDCA,R1
0x39
C,AC,OV
ADDA,R2
0x2A
C,AC,OV
ADDCA,R2
0x3A
C,AC,OV
ADDA,R3
0x2B
C,AC,OV
ADDCA,R3
0x3B
C,AC,OV
ADDA,R4
0x2C
C,AC,OV
ADDCA,R4
0x3C
C,AC,OV
ADDA,R5
0x2D
C,AC,OV
ADDCA,R5
0x3D
C,AC,OV
ADDA,R6
0x2E
C,AC,OV
ADDCA,R6
0x3E
C,AC,OV
ADDA,R7
0x2F
C,AC,OV
ADDCA,R7
0x3F
C,AC,OV
Description:Description:ADDandADDCbothaddthevalueoperandtothevalueoftheAccumulator,
leavingtheresultingvalueintheAccumulator.Thevalueoperandisnotaffected.ADDandADDCfunction
identicallyexceptthatADDCaddsthevalueofoperandaswellasthevalueoftheCarryflagwhereasADD
doesnotaddtheCarryflagtotheresult.
TheCarrybit(C)issetifthereisacarryoutofbit7.Inotherwords,iftheunsignedsummedvalueofthe
Accumulator,operandand(inthecaseofADDC)theCarryflagexceeds255Carryisset.Otherwise,the
Carrybitiscleared.
TheAuxillaryCarry(AC)bitissetifthereisacarryoutofbit3.Inotherwords,iftheunsignedsummed
valueofthelownibbleoftheAccumulator,operandand(inthecaseofADDC)theCarryflagexceeds15
theAuxillaryCarryflagisset.Otherwise,theAuxillaryCarryflagiscleared.
TheOverflow(OV)bitissetifthereisacarryoutofbit6oroutofbit7,butnotboth.Inotherwords,ifthe
additionoftheAccumulator,operandand(inthecaseofADDC)theCarryflagtreatedassignedvalues
resultsinavaluethatisoutoftherangeofasignedbyte(128through+127)theOverflowflagisset.
Otherwise,theOverflowflagiscleared.
SeeAlso:SUBB,DA,INC,DEC
8051InstructionSet:AJMP
Operation: AJMP
about:blank
3/13
6/25/2016
Function: AbsoluteJumpWithin2KBlock
Syntax:
AJMPcodeaddress
Instructions OpCode Bytes Flags
AJMPpage0
0x01
None
AJMPpage1
0x21
None
AJMPpage2
0x41
None
AJMPpage3
0x61
None
AJMPpage4
0x81
None
AJMPpage5
0xA1
None
AJMPpage6
0xC1
None
AJMPpage7
0xE1
None
Description:AJMPunconditionallyjumpstotheindicatedcodeaddress.ThenewvaluefortheProgram
CounteriscalculatedbyreplacingtheleastsignificantbyteoftheProgramCounterwiththesecondbyteof
theAJMPinstruction,andreplacingbits02ofthemostsignificantbyteoftheProgramCounterwith3bits
thatindicatethepageofthebytefollowingtheAJMPinstruction.Bits37ofthemostsignificantbyteofthe
ProgramCounterremainunchaged.
Sinceonly11bitsoftheProgramCounterareaffectedbyAJMP,jumpsmayonlybemadetocodelocated
withinthesame2kblockasthefirstbytethatfollowsAJMP.
SeeAlso:LJMP,SJMP
8051InstructionSet:ANL
Operation: ANL
Function: BitwiseAND
Syntax:
ANLoperand1,operand2
Instructions
ANLiramaddr,A
0x52
None
ANLiramaddr,#data
0x53
None
ANLA,#data
0x54
None
ANLA,iramaddr
0x55
None
ANLA,@R0
0x56
None
ANLA,@R1
0x57
None
ANLA,R0
0x58
None
ANLA,R1
0x59
None
ANLA,R2
0x5A
None
ANLA,R3
0x5B
None
ANLA,R4
0x5C
None
ANLA,R5
0x5D
None
ANLA,R6
0x5E
None
ANLA,R7
0x5F
None
ANLC,bitaddr
0x82
about:blank
4/13
6/25/2016
ANLC,/bitaddr
0xB0
Description:ANLdoesabitwise"AND"operationbetweenoperand1andoperand2,leavingtheresulting
valueinoperand1.Thevalueofoperand2isnotaffected.Alogical"AND"comparesthebitsofeach
operandandsetsthecorrespondingbitintheresultingbyteonlyifthebitwassetinbothoftheoriginal
operands,otherwisetheresultingbitiscleared.
SeeAlso:ORL,XRL
8051InstructionSet:CJNE
Operation: CJNE
Function: CompareandJumpIfNotEqual
Syntax:
CJNEoperand1,operand2,reladdr
Instructions
CJNEA,#data,reladdr
0xB4
CJNEA,iramaddr,reladdr
0xB5
CJNE@R0,#data,reladdr
0xB6
CJNE@R1,#data,reladdr
0xB7
CJNER0,#data,reladdr
0xB8
CJNER1,#data,reladdr
0xB9
CJNER2,#data,reladdr
0xBA
CJNER3,#data,reladdr
0xBB
CJNER4,#data,reladdr
0xBC
CJNER5,#data,reladdr
0xBD
CJNER6,#data,reladdr
0xBE
CJNER7,#data,reladdr
0xBF
Description:CJNEcomparesthevalueofoperand1andoperand2andbranchestotheindicatedrelative
addressifoperand1andoperand2arenotequal.Ifthetwooperandsareequalprogramflowcontinueswith
theinstructionfollowingtheCJNEinstruction.
TheCarrybit(C)issetifoperand1islessthanoperand2,otherwiseitiscleared.
SeeAlso:DJNZ
8051InstructionSet:CLR
Operation: CLR
Function: ClearRegister
Syntax:
CLRregister
Instructions OpCode Bytes Flags
CLRbitaddr
0xC2
None
CLRC
0xC3
CLRA
0xE4
None
Description:CLRclears(setsto0)allthebit(s)oftheindicatedregister.Iftheregisterisabit(includingthe
carrybit),onlythespecifiedbitisaffected.ClearingtheAccumulatorsetstheAccumulator'svalueto0.
SeeAlso:SETB
about:blank
5/13
6/25/2016
8051InstructionSet:CPL
Operation: CPL
Function: ComplementRegister
Syntax:
CPLoperand
Instructions OpCode Bytes Flags
CPLA
0xF4
None
CPLC
0xB3
CPLbitaddr
0xB2
None
Description:CPLcomplementsoperand,leavingtheresultinoperand.Ifoperandisasinglebitthenthe
stateofthebitwillbereversed.IfoperandistheAccumulatorthenallthebitsintheAccumulatorwillbe
reversed.Thiscanbethoughtofas"AccumulatorLogicalExclusiveOR255"oras"255Accumulator."Ifthe
operandreferstoabitofanoutputPort,thevaluethatwillbecomplementedisbasedonthelastvalue
writtentothatbit,notthelastvaluereadfromit.
SeeAlso:CLR,SETB
8051InstructionSet:DA
Operation: DA
Function: DecimalAdjustAccumulator
Syntax:
DAA
Instructions OpCode Bytes Flags
DA
0xD4
Description:DAadjuststhecontentsoftheAccumulatortocorrespondtoaBCD(BinaryCodedDecimal)
numberaftertwoBCDnumbershavebeenaddedbytheADDorADDCinstruction.Ifthecarrybitissetorif
thevalueofbits03exceed9,0x06isaddedtotheaccumulator.Ifthecarrybitwassetwhentheinstruction
began,orif0x06wasaddedtotheaccumulatorinthefirststep,0x60isaddedtotheaccumulator.
TheCarrybit(C)issetiftheresultingvalueisgreaterthan0x99,otherwiseitiscleared.
SeeAlso:ADD,ADDC
8051InstructionSet:DEC
Operation: DEC
Function: DecrementRegister
Syntax:
DECregister
Instructions
DECA
0x14
None
DECiramaddr
0x15
None
DEC@R0
0x16
None
DEC@R1
0x17
None
DECR0
0x18
None
DECR1
0x19
None
DECR2
0x1A
None
about:blank
6/13
6/25/2016
DECR3
0x1B
None
DECR4
0x1C
None
DECR5
0x1D
None
DECR6
0x1E
None
DECR7
0x1F
None
Description:DECdecrementsthevalueofregisterby1.Iftheinitialvalueofregisteris0,decrementingthe
valuewillcauseittoresetto255(0xFFHex).Note:TheCarryFlagisNOTsetwhenthevalue"rollsover"
from0to255.
SeeAlso:INC,SUBB
8051InstructionSet:DIV
Operation: DIV
Function: DivideAccumulatorbyB
Syntax:
DIVAB
Instructions OpCode Bytes Flags
DIVAB
0x84
C,OV
Description:DividestheunsignedvalueoftheAccumulatorbytheunsignedvalueofthe"B"register.The
resultingquotientisplacedintheAccumulatorandtheremainderisplacedinthe"B"register.
TheCarryflag(C)isalwayscleared.
TheOverflowflag(OV)issetifdivisionby0wasattempted,otherwiseitiscleared.
SeeAlso:MULAB
8051InstructionSet:DJNZ
Operation: DJNZ
Function: DecrementandJumpifNotZero
Syntax:
DJNZregister,reladdr
Instructions
DJNZiramaddr,reladdr
0xD5
None
DJNZR0,reladdr
0xD8
None
DJNZR1,reladdr
0xD9
None
DJNZR2,reladdr
0xDA
None
DJNZR3,reladdr
0xDB
None
DJNZR4,reladdr
0xDC
None
DJNZR5,reladdr
0xDD
None
DJNZR6,reladdr
0xDE
None
DJNZR7,reladdr
0xDF
None
Description:DJNZdecrementsthevalueofregisterby1.Iftheinitialvalueofregisteris0,decrementing
thevaluewillcauseittoresetto255(0xFFHex).Ifthenewvalueofregisterisnot0theprogramwill
branchtotheaddressindicatedbyrelativeaddr.Ifthenewvalueofregisteris0programflowcontinues
withtheinstructionfollowingtheDJNZinstruction.
SeeAlso:DEC,JZ,JNZ
about:blank
7/13
6/25/2016
8051InstructionSet:INC
Operation: INC
Function: IncrementRegister
Syntax:
INCregister
Instructions
INCA
0x04
None
INCiramaddr
0x05
None
INC@R0
0x06
None
INC@R1
0x07
None
INCR0
0x08
None
INCR1
0x09
None
INCR2
0x0A
None
INCR3
0x0B
None
INCR4
0x0C
None
INCR5
0x0D
None
INCR6
0x0E
None
INCR7
0x0F
None
INCDPTR
0xA3
None
Description:INCincrementsthevalueofregisterby1.Iftheinitialvalueofregisteris255(0xFFHex),
incrementingthevaluewillcauseittoresetto0.Note:TheCarryFlagisNOTsetwhenthevalue"rolls
over"from255to0.
Inthecaseof"INCDPTR",thevaluetwobyteunsignedintegervalueofDPTRisincremented.Iftheinitial
valueofDPTRis65535(0xFFFFHex),incrementingthevaluewillcauseittoresetto0.Again,theCarry
FlagisNOTsetwhenthevalueofDPTR"rollsover"from65535to0.
SeeAlso:ADD,ADDC,DEC
8051InstructionSet:JB
Operation: JB
Function: JumpifBitSet
Syntax:
JBbitaddr,reladdr
Instructions
JBbitaddr,reladdr
None
Description:JBbranchestotheaddressindicatedbyreladdrifthebitindicatedbybitaddrisset.Ifthebit
isnotsetprogramexecutioncontinueswiththeinstructionfollowingtheJBinstruction.
SeeAlso:JBC,JNB
8051InstructionSet:JBC
Operation: JBC
Function: JumpifBitSetandClearBit
Syntax:
JBbitaddr,reladdr
about:blank
8/13
6/25/2016
Instructions
JBCbitaddr,reladdr
0x10
None
Description:JBCwillbranchtotheaddressindicatedbyreladdrifthebitindicatedbybitaddrisset.Before
branchingtoreladdrtheinstructionwillcleartheindicatedbit.Ifthebitisnotsetprogramexecution
continueswiththeinstructionfollowingtheJBCinstruction.
SeeAlso:JB,JNB
8051InstructionSet:JC
Operation: JC
Function: JumpifCarrySet
Syntax:
JCreladdr
Instructions OpCode Bytes Flags
JCreladdr
0x40
None
Description:JCwillbranchtotheaddressindicatedbyreladdriftheCarryBitisset.IftheCarryBitisnot
setprogramexecutioncontinueswiththeinstructionfollowingtheJCinstruction.
SeeAlso:JNC
8051InstructionSet:JMP
Operation: JMP
Function: JumptoDataPointer+Accumulator
Syntax:
JMP@A+DPTR
Instructions
JMP@A+DPTR
0x73
None
Description:JMPjumpsunconditionallytotheaddressrepresentedbythesumofthevalueofDPTRand
thevalueoftheAccumulator.
SeeAlso:LJMP,AJMP,SJMP
8051InstructionSet:JNB
Operation: JNB
Function: JumpifBitNotSet
Syntax:
JNBbitaddr,reladdr
Instructions
JNBbitaddr,reladdr
None
Description:JNBwillbranchtotheaddressindicatedbyreladdressiftheindicatedbitisnotset.Ifthebitis
setprogramexecutioncontinueswiththeinstructionfollowingtheJNBinstruction.
SeeAlso:JB,JBC
8051InstructionSet:JNC
Operation: JNC
Function: JumpifCarryNotSet
Syntax:
JNCreladdr
about:blank
9/13
6/25/2016
0x50
None
Description:JNCbranchestotheaddressindicatedbyreladdrifthecarrybitisnotset.Ifthecarrybitis
setprogramexecutioncontinueswiththeinstructionfollowingtheJNBinstruction.
SeeAlso:JC
8051InstructionSet:JNZ
Operation: JNZ
Function: JumpifAccumulatorNotZero
Syntax:
JNZreladdr
Instructions OpCode Bytes Flags
JNZreladdr
0x70
None
Description:JNZwillbranchtotheaddressindicatedbyreladdriftheAccumulatorcontainsanyvalue
except0.IfthevalueoftheAccumulatoriszeroprogramexecutioncontinueswiththeinstructionfollowing
theJNZinstruction.
SeeAlso:JZ
8051InstructionSet:JZ
Operation: JZ
Function: JumpifAccumulatorZero
Syntax:
JNZreladdr
Instructions OpCode Bytes Flags
JZreladdr
0x60
None
Description:JZbranchestotheaddressindicatedbyreladdriftheAccumulatorcontainsthevalue0.Ifthe
valueoftheAccumulatorisnonzeroprogramexecutioncontinueswiththeinstructionfollowingtheJNZ
instruction.
SeeAlso:JNZ
8051InstructionSet:LCALL
Operation: LCALL
Function: LongCall
Syntax:
LCALLcodeaddr
Instructions
LCALLcodeaddr
None
Description:LCALLcallsaprogramsubroutine.LCALLincrementstheprogramcounterby3(topointto
theinstructionfollowingLCALL)andpushesthatvalueontothestack(lowbytefirst,highbytesecond).The
ProgramCounteristhensettothe16bitvaluewhichfollowstheLCALLopcode,causingprogram
executiontocontinueatthataddress.
SeeAlso:ACALL,RET
8051InstructionSet:LJMP
Operation: LJMP
about:blank
10/13
6/25/2016
Function: LongJump
Syntax:
LJMPcodeaddr
Instructions
LJMPcodeaddr
0x02
None
Description:LJMPjumpsunconditionallytothespecifiedcodeaddr.
SeeAlso:AJMP,SJMP,JMP
8051InstructionSet:MOV
Operation: MOV
Function: MoveMemory
Syntax:
MOVoperand1,operand2
Instructions
about:blank
MOV@R0,#data
0x76
None
MOV@R1,#data
0x77
None
MOV@R0,A
0xF6
None
MOV@R1,A
0xF7
None
MOV@R0,iramaddr
0xA6
None
MOV@R1,iramaddr
0xA7
None
MOVA,#data
0x74
None
MOVA,@R0
0xE6
None
MOVA,@R1
0xE7
None
MOVA,R0
0xE8
None
MOVA,R1
0xE9
None
MOVA,R2
0xEA
None
MOVA,R3
0xEB
None
MOVA,R4
0xEC
None
MOVA,R5
0xED
None
MOVA,R6
0xEE
None
MOVA,R7
0xEF
None
MOVA,iramaddr
0xE5
None
MOVC,bitaddr
0xA2
MOVDPTR,#data16
0x90
None
MOVR0,#data
0x78
None
MOVR1,#data
0x79
None
MOVR2,#data
0x7A
None
MOVR3,#data
0x7B
None
MOVR4,#data
0x7C
None
11/13
6/25/2016
MOVR5,#data
0x7D
None
MOVR6,#data
0x7E
None
MOVR7,#data
0x7F
None
MOVR0,A
0xF8
None
MOVR1,A
0xF9
None
MOVR2,A
0xFA
None
MOVR3,A
0xFB
None
MOVR4,A
0xFC
None
MOVR5,A
0xFD
None
MOVR6,A
0xFE
None
MOVR7,A
0xFF
None
MOVR0,iramaddr
0xA8
None
MOVR1,iramaddr
0xA9
None
MOVR2,iramaddr
0xAA
None
MOVR3,iramaddr
0xAB
None
MOVR4,iramaddr
0xAC
None
MOVR5,iramaddr
0xAD
None
MOVR6,iramaddr
0xAE
None
MOVR7,iramaddr
0xAF
None
MOVbitaddr,C
0x92
None
MOViramaddr,#data
0x75
None
MOViramaddr,@R0
0x86
None
MOViramaddr,@R1
0x87
None
MOViramaddr,R0
0x88
None
MOViramaddr,R1
0x89
None
MOViramaddr,R2
0x8A
None
MOViramaddr,R3
0x8B
None
MOViramaddr,R4
0x8C
None
MOViramaddr,R5
0x8D
None
MOViramaddr,R6
0x8E
None
MOViramaddr,R7
0x8F
None
MOViramaddr,A
0xF5
None
MOViramaddr,iramaddr
0x85
None
Description:MOVcopiesthevalueofoperand2intooperand1.Thevalueofoperand2isnotaffected.Both
operand1andoperand2mustbeinInternalRAM.Noflagsareaffectedunlesstheinstructionismovingthe
valueofabitintothecarrybitinwhichcasethecarrybitisaffectedorunlesstheinstructionismovinga
valueintothePSWregister(whichcontainsalltheprogramflags).
**Note:Inthecaseof"MOViramaddr,iramaddr",theoperandbytesoftheinstructionarestoredinreverse
about:blank
12/13
6/25/2016
order.Thatis,theinstructionconsistingofthebytes0x85,0x20,0x50means"MovethecontentsofInternal
RAMlocation0x20toInternalRAMlocation0x50"whereastheoppositewouldbegenerallypresumed.
SeeAlso:MOVC,MOVX,XCH,XCHD,PUSH,POP
8051InstructionSet:MOVC
Operation: MOVC
Function: MoveCodeBytetoAccumulator
Syntax:
MOVCA,@A+register
Instructions
MOVCA,@A+DPTR
0x93
None
MOVCA,@A+PC
0x83
None
Description:MOVCmovesabytefromCodeMemoryintotheAccumulator.TheCodeMemoryaddress
fromwhichthebytewillbemovediscalculatedbysummingthevalueoftheAccumulatorwitheitherDPTR
ortheProgramCounter(PC).InthecaseoftheProgramCounter,PCisfirstincrementedby1beforebeing
summedwiththeAccumulator.
SeeAlso:MOV,MOVX
8051InstructionSet:MOVX
Operation: MOVX
Function: MoveDataTo/FromExternalMemory(XRAM)
Syntax:
MOVXoperand1,operand2
Instructions
MOVX@DPTR,A
0xF0
MOVX@R0,A
0xF2
about:blank
None
13/13