Printer
Overview
The Printer is the standard NCS/e document output peripheral.
Programs create a print job, append text to it, and finalize the completed document for pickup.
A basic print operation consists of:
PRINT.NEW
PRINT.DATA "Hello, world!\n"
PRINT.DONE
Larger documents may be assembled using multiple PRINT.DATA calls:
PRINT.NEW
PRINT.DATA "NCS/e SYSTEM REPORT\n"
PRINT.DATA "-------------------\n"
PRINT.DATA "STATUS: OK\n"
PRINT.DONE
The Printer maintains the current job between calls.
Print jobs
A normal print job follows three steps:
PRINT.NEWbegins a new empty document.- One or more
PRINT.DATAcalls append text to the document. PRINT.DONEcompletes the document and makes it available for pickup.
PRINT.NEW and PRINT.CANCEL may be issued at any time.
Both discard any existing job and clear the Printer's current error state. PRINT.NEW then begins a new empty job, while PRINT.CANCEL returns the Printer to its ready state without starting one.
This applies regardless of whether the Printer is currently processing a job, reporting an error, or holding a completed document awaiting pickup.
PRINT.NEW — New Print Job
PRINT.NEW
Discards any existing print job and begins a new empty job.
Operands
This operation takes no operands.
Modified registers
This operation does not modify any registers.
Examples
-- Begin a new print job.
PRINT.NEW
PRINT.DATA "Hello, world!\n"
PRINT.DONE
Calling PRINT.NEW while another job exists abandons the old job and immediately begins another:
PRINT.NEW
PRINT.DATA "This document will be discarded.\n"
PRINT.NEW
PRINT.DATA "Replacement document\n"
PRINT.DONE
Notes
- Any existing print data is discarded.
- Any existing Printer error is cleared.
- A job currently in progress is abandoned.
- A completed document awaiting pickup is discarded.
- A new empty print job is started.
PRINT.DATA — Append Print Data
PRINT.DATA <text>
Appends text to the current print job.
Operands
| Position | Name | Type | Description |
|---|---|---|---|
| 1 | text |
String value | Text to append to the document. |
Modified registers
This operation does not modify any registers.
Examples
PRINT.NEW
PRINT.DATA "Hello, world!\n"
PRINT.DONE
A document may be assembled incrementally:
PRINT.NEW
PRINT.DATA "Line one\n"
PRINT.DATA "Line two\n"
PRINT.DATA "Line three\n"
PRINT.DONE
The resulting document contains:
Line one
Line two
Line three
Values may also be converted to strings normally when passed as print data:
MOVE r0 42
PRINT.NEW
PRINT.DATA "The answer is "
PRINT.DATA r0
PRINT.DATA ".\n"
PRINT.DONE
Notes
- Each call appends to the end of the current document.
- Existing print data is preserved between calls.
- Multiple calls may be used to construct a document incrementally.
PRINT.DONE — Complete Print Job
PRINT.DONE
Completes the current print job and makes the resulting document available for pickup.
Operands
This operation takes no operands.
Modified registers
This operation does not modify any registers.
Examples
PRINT.NEW
PRINT.DATA "PRINT TEST\n"
PRINT.DATA "Hello from NCL!\n"
PRINT.DONE
Notes
PRINT.DONEfinalizes the current document.- The completed document remains available until it is picked up, discarded or replaced.
PRINT.NEWmay be used to discard the completed document and immediately begin another job.PRINT.CANCELmay be used to discard the completed document and return the Printer to ready.
PRINT.CANCEL — Cancel Print Job
PRINT.CANCEL
Discards any existing print job and returns the Printer to its ready state.
Unlike PRINT.NEW, no new job is started.
Operands
This operation takes no operands.
Modified registers
This operation does not modify any registers.
Examples
PRINT.NEW
PRINT.DATA "This document will not be printed.\n"
PRINT.CANCEL
PRINT.CANCEL may also be used to reset the Printer from another state:
PRINT.CANCEL
-- > Printer returns to ready
Notes
- Any existing print data is discarded.
- Any existing Printer error is cleared.
- A job currently in progress is abandoned.
- A completed document awaiting pickup is discarded.
- No new print job is started.
- The Printer returns to its ready state.
Starting over
Programs do not need to determine the Printer's current state before resetting it.
To discard whatever the Printer is currently doing and immediately begin a fresh document:
PRINT.NEW
To discard whatever the Printer is currently doing without beginning another document:
PRINT.CANCEL
This makes either operation suitable for recovering to a known Printer state before continuing.