Peripherals
Overview
Peripherals extend the NCS/e with additional input, output, storage, and other hardware capabilities.
Programs communicate with most peripherals using EXT verbs. These use the same instruction syntax as native CPU operations, but are handled by the connected peripheral rather than by the CPU itself.
For example:
D.TXT "Hello, world!"
D.BLT
PRINT.NEW
PRINT.DATA "Hello, world!\n"
PRINT.DONE
Peripheral verbs are grouped into namespaces identifying the interface they belong to. D.*, for example, provides the standard Display interface, while PRINT.* provides the standard Printer interface.
Peripheral availability
Peripherals are not part of the base CPU and may not be present in every NCS/e system.
Programs using a peripheral require a compatible implementation of its interface to be connected.
Different peripherals may implement the same interface. Programs generally communicate with the interface rather than depending on a particular physical peripheral model.
Registers and arguments
Peripheral verbs receive the values and registers supplied as their operands.
Unlike native CPU instructions, a peripheral is responsible for deciding how those operands are used. A register supplied to a peripheral may be used as an input, an output, or both.
For example:
D.CURGET r0 r1
uses r0 and r1 as outputs for the current cursor coordinates.
Peripheral documentation identifies the expected operands and registers modified by each verb.
Peripherals may also report errors through the er register.
Execution
Peripheral calls may be synchronous or asynchronous.
A synchronous operation completes before execution continues:
D.BLT
MOVE r0 1
An asynchronous operation allows execution to continue without waiting for the peripheral operation to finish:
D.BLTN
MOVE r0 1
When synchronous peripheral calls appear among coalesced instructions, the current program line waits for the call to complete before continuing with the next instruction.
Standard peripherals
The standard NCS/e peripheral interfaces include:
- Display — Character display and graphics attributes.
- Keyboard — Buffered text input.
- Printer — Document output.
Additional peripherals and expansion hardware may provide their own EXT interfaces.