The YGREC8's Manual : the OUT opcode

Created dim. 29 oct. 2023 23:40:23 CET by whygee@f-cpu.org

PRELIMINARY / WORK IN PROGRESS


Encoding

15141312 111098 7654 3210
1 1 0 1 Imm9 SND

Description

This is the complementary instruction to the IN opcode.

This opcode takes the SND operand and writes it to the I/O register space at the address given by the 9-bit Imm9 field.

Unimplemented addresses are not reported (no trap/error).

Effects

OUT does not affect the Carry, Sign or Zero flags.

However writing to the I/O space can have all kinds of side effects, be careful where you write.

Forms

This is a core operation that supports only the Imm9 format, with no condition/inhibition.

No indirect/register address form is provided, keeping decoding as fast as possible. This could change in the future (with a PF option? with a dedicated IO index register?) but so far, it's already enough (and messy) to get it going.

Example

OUT 123 R3 ; write the contents of R3 to the IO register #123