The DCX instruction

The DCX (Decrement Register Pair) instruction is used to decrease the value of the specified 16-bit register pair by 1.

The DCX instruction format

InstructionDescription
DCX B Decrements the 16-bit value stored in the BC register pair by 1.
DCX D Decrements the 16-bit value stored in the DE register pair by 1.
DCX H Decrements the 16-bit value stored in the HL register pair by 1.
DCX SP Decrements the 16-bit value stored in the stack pointer (SP) by 1.

Usage example

; Author: Evgeny Sergeevich Dovgopolov

main:
    mvi     h, 50h  ; Load the hexadecimal value 50h into register H
    mvi     l, 00h  ; Load the hexadecimal value 00h into register L
    dcx     h       ; Decrease the value of the HL register pair by 1

    hlt             ; Stop program execution

Example taken from the textbook "HANDYFAR - MASM (Evgeny Sergeevich Dovgopolov)".

Processor status flags

S
Yes
Z
Yes
AC
Yes
P
Yes
CY
Yes