Mnemonics

OUTD

Input and Output Group
Expansion:
OUTput and Decrement
Usage:
outd

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 decrements HL and B register.

Z80.CPU instructions
Instruction Description Opcode
INI OUTput and Decrement EDAB

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: outd ; output a byte from (HL) to port C ($FE), decrement HL, decrement B jp nz, WriteLoop ; repeat the loop if B is not zero ; after the loop, HL will be decremented by the number of bytes sent, ; and the data block starting at $4FFF will be sent to the I/O port in reverse order

See also