Implicit or Implied Addressing
•Wedon’tgivethedataoraddressintheinstruction.
•Instructionitselfspecifiesthedatatobeoperated
upon.
•Doesn’trequiredanyoperand.
•Usedonparticularoperand.
•Advantage:
▫Simple
▫Small
•Disadvantage:
▫Rigid
•Eg:CMA,XCHG,SPHL,XTHL etc.
CMA:
11
SSP/EC-403/2021
A01HFFH
Quick Overview
•Immediate:
▫Data in the instruction.
▫MVI B, 40H B 40H
▫LXIB, 4000H BC 4000H
•Register:
▫Data is in the register.
▫MOV A,B [A] [B]
▫INR B [B] [B+1]
▫INX B [BC] [BC+1]
•Direct:
▫Address is in the instruction.
▫LDA 8000H [A] [8000]
▫STA 9000H [A] [9000]
•Indirect:
▫Address is in the register.
▫LDAX B [A] [BC]
▫STAX B [A] [BC]
•Implied:
▫Implied
▫STC CY 1
▫CMC CY CY
SSP/EC-403/2021
12
Instruction Set of 8085
•Intel8085processorhasitsownsetofinstructionslisted
bothinmnemonicsandmachinecode,alsocalledas
objectcode.
•As8085isan8-bitprocessor.
•Themachinecodesfortheinstructionsarealso8-bits
wide.
•Ithas246instructions.
Eachinstructionisrepresentedbyan8-bitbinaryvalue.
These8-bitsofbinaryvalueiscalledOp-Codeor
InstructionByte
SSP/EC-403/2021
14
Classification of Instruction Set
Instruction set
Based on functionality Based on length
DataTransferInstruction
ArithmeticInstructions
LogicalInstructions
BranchingInstructions
Stack/IOandMcControlInstructions
One –byte
instruction
Two-byte
instruction
Three-byte
instruction
15
SSP/EC-403/2021
Classification of Instruction Set
•Basedonlength
▫One-ByteInstructions
▫Two-ByteInstructions
▫Three-ByteInstructions
16
SSP/EC-403/2021
Three-Byte Instructions
•Instructionrequirethreebytesinmachinecode.
•1
st
byte:Op-code,whichspecifiestheoperation
tobeperformed.
•2
nd
and3
rd
byte:16-bitoperand,whichiseither
an16-bitnumberoranaddress.
•Eg:LXIH8500H;JMP6900H,STA7900Hetc.
▫ STA79 00H
19
SSP/EC-403/2021
Opcode Higher order
8-bit operand
Lower order
8-bit operand
Three Byte
Classification of Instruction Set
•BasedonFunctionality:
▫DataTransferInstruction
▫ArithmeticInstructions
▫LogicalInstructions
▫BranchingInstructions
▫Stack/IOandM/CControlInstructions
20
SSP/EC-403/2021
Data Transfer Instructions
•These instructions move data between registers,
or between memory and registers.
•These instructions copy data from source to
destination.
•Sometime data stored directly in designated
location.
•While copying, the contents of source are not
modified.
21
SSP/EC-403/2021
Data Transfer Instructions
•MOV B,C: Copy from source to destination.
•MVIC,05H: Load register C with the data 05H.
•LXI H,9000H: Load 9000H in HL register pair.
SSP/EC-403/2021
22
SourceDestination 88H88H
[C] 05H05H
[B] [C]
[H] [L]
90 00H9000
Data Transfer Instructions
•MVI M,25H: Put the data in memory location.
•MOV M,C: Copy the value of C to memory
location.
•MOV C,M:
SSP/EC-403/2021
23
[M]25H 25H
[M]
C80H
80H
Data Transfer Instructions
Op-codeOperand Description
MOV Rd, Rs
M, Rs
Rd, M
Copy from source to destination.
MVI R,8 bit dataLoad register with 8bit data.
LDA 16-bit
address
Load the content of memory location in
the Accumulator.
STA 16 bit
address
The contents of accumulator are copied
into the memory location specified by
the operand.
STAX Rp The contents of accumulator are copied
into the memory location specified by
the contents of the register pair.
LXI Rp,16 bit
data
Load the register pair immediate.
25
SSP/EC-403/2021
Addition
•Any8-bitnumber,orthecontentsofregister,orthecontentsof
memorylocationcanbeaddedtothecontentsofaccumulator.
•Theresult(sum)isstoredintheaccumulator.
•Notwoother8-bitregisterscanbeaddeddirectly.
Op-code Operand Description
ADD R
M
Thecontentsofregisterormemoryareaddedto
thecontentsofaccumulator.
ADC R
M
Addwithcarry.Thecarrygeneratedfromthe
previousoperationisincorporatedinthis
addition.
ADI 05H The8-bitdataisaddedtothecontentsof
accumulator.
DAD B The16-bitcontentsoftheregisterpairareadded
tothecontentsofH-Lpair.Theresultisstoredin
H-Lpair.Iftheresultislargerthan16bits,then
CYisset.
DAA Decimaladjustafteraddition.Itonlyusedafter
addition.Thisinstructiondoesn'thaveany
operand.ItisonlyimpliedonAcc.
27
SSP/EC-403/2021
Subtraction
•Any 8-bit number, or the contents of register, or the
contents of memory location can be subtracted from
the contents of accumulator.
•The result is stored in the accumulator.
•Subtraction is performed in 2’s complement form.
•If the result is negative, it is stored in 2’s
complement form.
•No two other 8-bit registers can be subtracted
directly.
•Example:SUB B, SUB M, SUI data
28
SSP/EC-403/2021
Increment / Decrement
•The8-bitcontentsofaregisteroramemorylocationcan
beincrementedordecrementedby1.
•The16-bitcontentsofaregisterpaircanbeincremented
ordecrementedby1.
•Incrementordecrementcanbeperformedonany
registeroramemorylocation.
Op-codeOperand Description
INR R
M
Thecontentsofregisterormemory
locationareincrementedby1..The
resultisstoredinthesameplace.
INX R Thecontentsofregisterpairare
incrementedby1.Theresultis
storedinthesameplace.
29
SSP/EC-403/2021
AND, OR, XOR
Op-codeOperand Description
ANA R
M
Thecontentsoftheaccumulatorarelogically
ANDedwiththecontentsofregisterormemory.
Theresultisplacedintheaccumulator.
ANI 8-bit dataThecontentsoftheaccumulatorarelogically
ANDedwiththe8-bitdata.Theresultisplaced
intheaccumulator.
ORA R
M
ThecontentsoftheaccumulatorarelogicallyOR
edwiththecontentsoftheregisterormemory.
Theresultisplacedintheaccumulator.
XRI 8-bit dataThecontentsoftheaccumulatorareXORed
withthe8-bitdata.Theresultisplacedinthe
accumulator.
31
SSP/EC-403/2021
Rotate
•Each bit in the accumulator can be shifted either left or
right to the next position.
•RLC: Each binary bit of the accumulator is rotated left by
one position.
•RAL:Each binary bit of the accumulator is rotated left by
one position through the Carry flag.
SSP/EC-403/2021
32
76543210
C
Accumulator
76543210
C
Accumulator
Rotate Cont..
▫RRC:Eachbinarybitoftheaccumulatorisrotated
rightbyoneposition.
•RAR:Eachbinarybitoftheaccumulatorisrotatedright
byonepositionthroughtheCarryflag.
SSP/EC-403/2021
33
76543210
Accumulator
76543210
Accumulator
C
C
Compare
•Any 8-bit data, or the contents of register, or
memory location can be compares for:
▫Equality
▫Greater Than
▫Less Than
with the contents of accumulator.
•The result is reflected in status flags.
35
SSP/EC-403/2021
Compare
Op-codeOperand Description
CMP R
M
Thecontentsoftheoperand(registeror
memory)arecomparedwiththecontents
oftheaccumulator.Bothcontentsare
preserved.
Theresultofthecomparisonisshownbysettingtheflags
ofthePSWasfollows:
if(A)<(reg/mem):carryflagisset
if(A)=(reg/mem):zeroflagisset
if(A)>(reg/mem):carryandzeroflagsarereset.
36
SSP/EC-403/2021
Control Instructions
•The control instructions control the operation of
microprocessor.
OpcodeDescription Status Flags
NOP None Nooperationisperformed.The
instructionisfetchedanddecoded
butnooperationisexecuted.
HLT None TheCPUfinishesexecutingthecurrent
instructionandhaltsanyfurther
execution.Aninterruptorresetis
necessarytoexitfromthehaltstate.
DI None Disableinterrupt.Theinterruptenable
flip-flopisresetandalltheinterrupts
excepttheTRAParedisabled.
41
SSP/EC-403/2021
Jump Conditionally
Opcode Description Status Flags
JC Jump if Carry CY = 1
JNC Jump if No Carry CY = 0
JP Jump if Positive S = 0
JM Jump if Minus S = 1
JZ Jump if Zero Z = 1
JNZ Jump if No Zero Z = 0
JPE Jump if Parity
Even
P = 1
JPO Jump if Parity
Odd
P = 0
43
SSP/EC-403/2021