IOX

From NDWiki
Revision as of 23:06, 5 April 2009 by Mike (talk | contribs) (Rework on the page (+InstructionBox, +example, text from ND-06.029.1, etc))
Jump to navigation Jump to search
IOX
Description Exchange information between
I/O system and A register.
Format IOX <device register address>
Code 164 0008
Affected See description
Type See description
Architecture {{{Architecture}}}


IOX is an assembly instruction used for programmed IO and it transfers data between a device I/O register and the CPU's A register.

IOX is a privileged instruction in normal cases but if there is no OS running and the paging system is turned off then IOX is an unprivileged instruction. IOX and IOXT are the only instructions used to communicate with external instructions.


Device register address

Register addresses can hold data, command or status information for a device.

Bit 0-10 of the instruction code sets the direction and IO address:

  • Bit 0 gives the direction of transfer:
    • If bit 0 is zero then IOX reads the value from the IO register into register A
    • If bit 0 is one then IOX writes the contents of register A to the IO register
  • Bit 3-9 is the selected device
  • Bit 0-2 is the selected register within selected device
  • Bit 10 is the type of interface:
    • If bit 10 is zero then it is a Standard ND interface
    • If bit 10 is one then it is a Customer designed interface


An external device may require more than one register address, for example a magnetic tape unit may need several register addresses; these should be given successive device-register addresses (remembering to use odd addresses for input and even addresses for output).

Note

  • Addressing of a non existing device results in a IOX error.
  • The number of external devices that can be controlled by the CPU depends on the configuration of the devices.


Example

To give an instruction to a device

LDA <device command code>
IOX <device register address>

The lsb of IOX will be 1. The A register contents are output to the device addressed within the IOX opcode.

To check the status of a device

IOX <device register address>

The lsb of IOX will be 0. The status code of the device addressed by the IOX opcode will be loaded into the A register.

Transfer data

IOX <device register address>

Data from the device addressed by the IOX instruction is read into the A register if the lsb of IOX is 0. If the lsb of IOX is 1, the A register contents are output to the device.


Se also


References