Microprocessors and Interfacing
Instruction Categories; Data Transfer Instructions; Arithmetic Instructions
C-CAT
Instruction Categories
8085 instructions are classified into five major groups:
| Category | Affects flags? | Purpose |
|---|---|---|
| Data Transfer | No | Copy data without modifying source |
| Arithmetic | Yes | Add, subtract, increment, decrement |
| Logical | Yes | AND OR, XOR, compare, rotate |
| Branch | No | Change program sequence (conditional/unconditional) |
| Machine Control | No | Halt, interrupt enable/disable, NOP |
Data Transfer Instructions
Data transfer instructions copy data — they do NOT modify the source and do NOT affect flags.
| Mnemonic | Format | Description | Example |
|---|---|---|---|
| MVI | MVI Rd, data | Move immediate 8-bit to register | MVI A, 50H |
| MOV | MOV Rd, Rs | Copy register to register | MOV B, A |
| MOV | MOV Rd, M / MOV M, Rs | Via memory pointer HL | MOV A, M |
| LXI | LXI Rp, 16-bit | Load immediate to register pair | LXI H, 2050H |
| LDA | LDA addr | Load accumulator direct | LDA 2005H |
| STA | STA addr | Store accumulator direct | STA 3000H |
| LDAX | LDAX B/D | Load A indirect via BC/DE | LDAX B |
| STAX | STAX B/D | Store A indirect via BC/DE | STAX D |
| LHLD | LHLD addr | Load HL pair direct from memory | LHLD 2050H |
| SHLD | SHLD addr | Store HL pair direct to memory | SHLD 2050H |
| XCHG | XCHG | Exchange DE and HL contents | XCHG |
| IN | IN port | Read from I/O port to A | IN 10H |
| OUT | OUT port | Write A to I/O port | OUT 05H |
Arithmetic Instructions
| Mnemonic | Description | Example |
|---|---|---|
| ADD | Add register/M to A | ADD B |
| ADI | Add immediate to A | ADI 50H |
| ADC | Add with carry | ADC C |
| SUB | Subtract register/M from A | SUB B |
| SUI | Subtract immediate from A | SUI 34H |
| SBB | Subtract with borrow | SBB D |
| INR | Increment register/M by 1 | INR C |
| DCR | Decrement register/M by 1 | DCR C |
| INX | Increment register pair by 1 | INX H |
| DCX | Decrement register pair by 1 | DCX B |
| DAD | Add register pair to HL | DAD D |
Note: INR and DCR do NOT affect the carry flag — an important exam point.
Data Transfer Details
Data-transfer instructions copy data without conceptually changing the source. Register transfers use MOV. Immediate instructions such as MVI place a constant in a register or memory. LXI loads a 16-bit constant into a register pair. Direct instructions include LDA and STA. LDAX and STAX use the address in BC or DE. LHLD and SHLD transfer two consecutive memory bytes with the low byte at the lower address.
Most data-transfer instructions do not change flags. This distinction matters because a later conditional branch may still test flags produced by an earlier arithmetic or logical instruction.
Arithmetic Details
ADD and ADC add a register or memory value to the accumulator, with ADC including carry. ADI and ACI use immediate data. Subtraction instructions set carry to represent borrow according to 8085 convention. INR and DCR change an 8-bit operand without changing carry. INX and DCX change a register pair and do not affect flags.
DAD adds a register pair to HL and affects carry. DAA adjusts the accumulator after adding packed BCD digits by applying corrections to the lower and upper nibbles according to auxiliary carry, carry and digit values. Signed overflow is not represented by a dedicated 8085 flag and must be inferred when signed arithmetic is required.
Continue learning
Related notes
Put this topic into timed practice
Open mock tests when you want full-exam pacing, or keep drilling in practice mode.