Tuesday, April 2, 2019

STAX

This command writes a number from 8-bit register A to memory at address, contained in 16-bit register.
Exists 2 variants of this command:

1)  STAX B
This command writes a number from 8-bit register A to a memory at address, contained in the register BC.
Code of this operation: 02 (2h).

2)  STAX D
This command writes a number from 8-bit register A to a memory at address, contained in the register DE.
Code of this operation: 12 (12h).

Example:
STAX D

Code:
12

Action:
A →  MEMORY [ DE ]

LXI

This command writes a 16-bit number to a 16-bit processor register.
Exists 4 variants of this command:

1) LXI B, 16-bit number
This command writes a 16-bit number to the 16-bit register BC.
Code of this operation: 01(1h).

2) LXI D, 16-bit number
This command writes a 16-bit number to the 16-bit register DE.
Code of this operation: 11 (11h).

3) LXI H, 16-bit number
This command writes a 16-bit number to the 16-bit register HL.
Code of this operation: 21 (21h).

4) LXI SP, 16-bit number
This command writes a 16-bit number to the 16-bit stack register SP.
Code of this operation: 31. (31h).

Example:
LXI H, 45FA

Code:
21  FA  45

Action:
45FA →  HL

That is:
FA →  L
45  →  H

NOP

This instruction does nothing. This is a empty operation. It can be used for a time delay (if you put it inside the loop).
Code of this operation: 00 (0h).