Created dim. 29 oct. 2023 23:40:23 CET by whygee@f-cpu.org PRELIMINARY / WORK IN PROGRESS
15 | 14 | 13 | 12 | 11 | 10 | 9 | 8 | 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 |
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
1 | 1 | 0 | 0 | Imm9 | SND |
This is the complementary instruction to the OUT opcode.
This opcode reads the I/O register space at the address given by the 9-bit Imm9 field and writes the value to the core register given by the SND field.
Unimplemented addresses are not reported (no trap/error).
IN does not affect the Carry, Sign or Zero flags.
However reading from the I/O space could have all kinds of side effects, be careful where you read.
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.
IN 123 R3 ; read IO register #123 and write the value to R3