---
title: "Short note: INX, XTHL, MUL, JG"
subject: "Microprocessor"
chapter: 2
key: "semester_4/microprocessor:short-note-inx-xthl-mul-jg"
source: https://www.bctengineer.com/q/semester_4/microprocessor/short-note-inx-xthl-mul-jg
site: BCT Engineering
---

# Short note: INX, XTHL, MUL, JG

Microprocessor · Chapter 2: Programming with 8085 Microprocessor

- Asked in: 2072 Asoj, 4 marks
- Video: [Special instructions in microprocessor 8085 (SPHL, PCHL, SHLD, LHLD, XTHL, STC & NOP)](https://www.youtube.com/watch?v=4lyCq-O6Mug) — Engineering Funda
- Answer checked by Claude Opus 5.5 (high effort) on 2026-10-14
- Page: https://www.bctengineer.com/q/semester_4/microprocessor/short-note-inx-xthl-mul-jg
- Whole chapter: https://www.bctengineer.com/md/semester_4/microprocessor/chapter-2

## Question

Write short notes on: INX, XTHL, MUL, JG.

## Short answer

INX increments a register pair by 1, no flags affected. XTHL exchanges HL with top of stack without altering SP. MUL (8086) performs unsigned multiply, e.g., AX=AL×src; CF/OF set if upper half nonzero. JG (8086) jumps if signed greater, i.e., ZF=0 and SF=OF.

## Answer

#### INX (Increment register pair) - 8085
`INX rp` increases the 16-bit content of a register pair (BC, DE, HL or SP) by 1. It is a 1-byte, 6T instruction and **no flags** are affected. It is used to move pointers through tables.
```asm
        LXI H,2000H
        INX H           ; HL = 2001H
```

#### XTHL (Exchange top of stack with HL) - 8085
Exchanges L with the byte at M[SP] and H with the byte at M[SP+1]; SP is unchanged and no flags are affected (1 byte, 16T). It is used to replace a value on the stack, for example the return address.

#### MUL - 8086 (not available in 8085)
The 8085 has no multiply instruction (multiplication is done by repeated addition or shift-and-add). In the 8086, `MUL src` performs **unsigned** multiplication:
- Byte: AX <- AL x src8
- Word: DX:AX <- AX x src16

CF and OF are set if the upper half of the result (AH or DX) is non-zero; other flags are undefined. (`IMUL` is the signed version.)
```asm
        MOV AL,05H
        MOV BL,04H
        MUL BL          ; AX = 0014H
```

#### JG - 8086 (not available in 8085)
`JG label` (same as `JNLE`) is a conditional jump for **signed** numbers: it jumps if the first operand is greater than the second after a CMP, that is when ZF = 0 and SF = OF. It is a 2-byte instruction with an 8-bit relative displacement (-128 to +127).
```asm
        CMP AX,BX
        JG BIGGER       ; jump if AX > BX (signed)
```

## Check yourself

The answer's key points as multiple-choice questions, with the correct option and why.

1. HL = 20FFH. After INX H, what is HL and which flags change?
   A. HL = 2100H; no flags are affected
   B. HL = 2000H; the carry flag is set
   C. HL = 2100H; Z and CY are set because L overflowed
   D. HL = 20FFH + 1 only in L, so HL = 2000H; Z is set
   Answer: A. INX adds 1 to the full 16-bit register pair, so 20FFH becomes 2100H. INX does not affect any flags. (Key point: INX increments a register pair and affects no flags)

2. What does XTHL do?
   A. Copies HL into SP
   B. Exchanges HL with DE
   C. Exchanges L with M[SP] and H with M[SP+1]; SP does not change
   D. Pushes HL on the stack and decrements SP by 2
   Answer: C. XTHL swaps HL with the top two bytes of the stack (L with M[SP], H with M[SP+1]). SP is not changed and no flags are affected. (Key point: XTHL swaps L with M[SP] and H with M[SP+1]; SP unchanged)

3. Which statement about MUL is correct?
   A. MUL is an 8085 instruction that multiplies A by B
   B. MUL is an 8086 signed multiply; for a byte operand the result goes in AL only
   C. MUL does not exist in the 8085; in the 8086 a byte MUL gives AX <- AL x src8 (unsigned)
   D. MUL is an 8086 instruction that always stores a word result in BX
   Answer: C. The 8085 has no multiply instruction and uses repeated addition or shift-and-add. The 8086 MUL is unsigned: AX <- AL x src8 for bytes and DX:AX <- AX x src16 for words. IMUL is the signed version. (Key point: MUL is an 8086 unsigned multiply; the 8085 has none)

4. After CMP AX,BX in the 8086, when does JG jump?
   A. When CF = 0 and ZF = 0 (unsigned greater)
   B. When ZF = 1
   C. When SF = 1
   D. When ZF = 0 and SF = OF (signed greater)
   Answer: D. JG (same as JNLE) is for signed numbers and jumps when ZF = 0 and SF = OF. CF = 0 and ZF = 0 is the unsigned condition used by JA. (Key point: JG is an 8086 signed jump: ZF = 0 and SF = OF)
