PROGRAMMING
USING 8085
THE INSTRUCTION SET
IT HAS 74 INSTRUCTIONS CLASSIFIED IN FIVE CATEGORIES DATA TRANSFER GROUP ARITHMETIC GROUP LOGICAL GROUP BRANCH GROUP MACHINE CONTROL GROUP
OVERVIEW OF 8085 INSTRUCTION SET
R =8085 8-Bit Register (A,B,C,D,E,H,L) M =Memory Register (location) Rs =Register source (A,B,C,D,E,H,L) Rd =Register Destination (BC,DE,HL,SP) Rp =Register Pair ( ) =Contents Of
1. Data transfer (copy) instructions:
From register to register. Load an 8-bit number in a register. Between memory and register. Between I/O and accumulator. Load 16-bit number in a register pair. Tasks Copy Data From Source Register Rs into Destination Register Rd. Load 8-bit Data in a Register. Send (Write ) data byte from the accumulator to an output device. Accept (read ) data byte from an input device and place it in the accumulator. Load 16 bit in a Register Pair. Copy the Data byte from a memory location (source ) into a register.
Mnemonics MOV Rd,Rs MVI,8-bit OUT8-bit (Port Address) IN 8-bit (port address) LXI Rp,16-bit MOV R,M
LDAX Rp LDA 16-bit MOV M,R STAX Rp STA 16-bit
Copy the data byte into the accumulator from the memory location indicated by a register pair. Copy the data byte into the accumulator from the memory location specified by 16-bit address. Copy the data byte from register into memory location . Copy the data byte from the accumulator into the memory location indicated by the register pair. Copy the data byte from the accumulator in the memory location specified by 16-bit address.
[Link] instructions:
Add Subtract Increment (Add 1) Decrement (Subtract 1)
ADD R ADI 8-bit SUB R SUI 8-bit INR R
Add the contents of a register to the contents of the accumulator. Add 8-bit data to the contents of the accumulator. Subtract the contents of a register from the contents of a accumulator. Subtract the 8-bit data from the contents of the accumulator. Increment the contents of a register.
DCR R
Decrement the contents of a register
INX Rp DCX Rp ADD M SUB M INR M DCR M
Increment the contents of a register pair. Decrement the contents of register pair. Add the contents of a memory location to the contents of the accumulator. Subtract the contents of a memory location from the contents of the accumulator. Increment the contents of a memory location. Decrement the contents of a memory location.
3. Logical Instructions :
AND OR X-OR Compare Rotate Logically AND the contents of register/memory with the contents of the accumulator. Logically AND the 8-bit data with the contents of the accumulator. Logically OR the contents of register/memory with the contents of the accumulator. Logically OR the 8-bit data with the contents of the accumulator. Exclusive OR the contents of register / memory with the contents of the accumulator.
ANA R/M ANI 8-bit ORA R/M ORI 8-bit XRA R/M
XRI 8-bit CMA RLC RAL RRC RAR CMP R/M CPI 8 bit
Exclusive OR the 8-bit data with the contents of the accumulator. Complement the contents of the accumulator. Rotate each bit in the accumulator to the left position. Rotate each bit in the accumulator including the carry to the left position. Rotate each bit in the accumulator to the right position. Rotate each bit in the accumulator including the carry to the right position. Compare the contents of register/memory with the contents of the accumulator for less than , equal to, or more than. Compare 8-bit data with the contents of the accumulator for less than, equal to, or more than.
4. Branch Instructions:
Change the program sequence unconditionally. Change the program sequence if specified data conditions are met.
JMP 16-bit address JZ 16-bit address JNZ 16-bit address
Change the program sequence to the location specified by the 16-bit address. Change the program sequence to the location specified by the 16-bit address if the Zero flag is set. Change the program sequence to the location specified by the 16-bit address if the Zero flag is unset.
JC 16-bit address JNC 16-bit address CALL 16-bit address RET
Change the program sequence to the location specified by the 16-bit address if the carry flag is set. Change the program sequence to the location specified by the 16-bit address if the carry flag is reset. Change the program sequence to the location of a subroutine. Return of the calling program after completing the subroutine sequence.
5. Machine Control instructions: HLT NOP Stop processing and wait. Do not Perform any Operation.