DCR R:
- This instruction decrements the contents of specified register by 1.
- The result is stored in the same register.
- Register R can be any general purpose register like A, B, C, D, E, H and L.
- All flags are modified except carry flag.
- It is a one byte instruction.
- Register addressing mode is used.
Example:
If H = 20H
DCR H ; This instruction decrements the contents of H (20H) by one and the result (1FH) is stored in H.
DCR M:
- This instruction decrements the contents of the memory location pointed by HL register pair by 1.
- The result is stored in the same memory location.
- All flags are modified except carry flag.
- It is a one byte instruction.
- Register indirect addressing mode is used.
Example:
If HL = 2000H, (2000H) = 20H
If HL = 2000H, (2000H) = 20H
DCR M ; This instruction decrements the contents of location 2000H i.e. 20H by one and the result (1FH) is stored in location 2000H.
DCX Rp:
- This instruction decrements the contents of the specified register pair by 1.
- The result is stored in the same register pair.
- Rp is 16-bit register pair like BC, DE, HL or SP.
- Only higher order register is specified for register pair.
- No flags are modified.
- It is a one byte instruction.
- Register addressing mode is used.
Example:
If BC = 2001H
If BC = 2001H
DCX B ; This instruction decrements the contents of BC register pair (2001H) by one and the result (2000H) is stored in BC.
Comments
Post a Comment