OUTI
Input and Output Group
Expansion:
OUTput Increment
Usage:
outi
Outputs to the port address found in memory at pointer C register i.e. (C) and sends the data stored in address pointer (HL). It then increments HL and decrementsB register.
| Instruction | Description | Opcode |
|---|---|---|
| INI | OUTput Increment | EDA3 |
Example
; Example
ld bc, $00FE ; load BC with the address of port 254 ($FE) and the counter in B
ld hl, $4FFF ; load HL with the ending address of the memory block
ld b, $10 ; load B with the number of bytes to send (16 bytes in this example)
WriteLoop:
outi ; output a byte from (HL) to port C ($FE), increment HL, decrement B
jp nz, WriteLoop ; repeat the loop if B is not zero
; after the loop, HL will be incremented by the number of bytes sent,
; and the data block starting at $4FFF will be sent to the I/O port in reverse order