Devices
WOPR CPU can be expanded with multiple devices. The CPU can use OUT
instruction, memory mapping and interrupts to communicate to the devices.
The common instructions below are used to enumerate, identify and initialize the device. However all devices have device specific commands used to access device specific functionality.
Instruction OUT
is used to talk to devices. Parameter P0 to OUT
is always
the device being addressed. Parameter P1 is the command. Commands 0-255 are
reserved for generic operations. Commands 256-65535 are device specific.
Commands:
Cmd | Description |
---|---|
0 | Get device type. Result R0 of 0x0000 indicates no device is connected. Devices are numbered sequentially, and the first time 0x0000 is returned indicates that there are no more devices. CPU does not support hot plugging devices. |
1 | Set device interrupt. P2 holds interrupt that the device should use. |
2 | Set memory map. P2 holds pointer to the start of the memory map. Size of the memory map is device specific. |
If a device receives a command it does not understand, it will return 0xBAAD in R0.
Please browse the documentations for the specification of all devices.