2B OutByte¶
Validated MON 2B (2 decimal) · Mnemonic OUTBT · Group: File Operations (manual section 2.4)
Available from: All programs (manual compatibility box)
Emulation source: src/handlers/mon_2B_OutByte.c
Description¶
Writes one byte to a character device, e.g. a terminal or an opened file. If the device is a word-oriented device, one word is written.
- The program waits if the output buffer of the device is full. You can change this with NoWaitSwitch or TerminalNoWait.
- The pointer to the next byte is incremented when you write to a mass-storage file.
- Output from card readers are converted to ASCII characters. Use DeviceControl to write the 12-bit card columns.
- You are advised to use the faster OutputString on the ND-500.
- Appendix F contains an ASCII table.
Parameters¶
| Name | Type | Direction | Description |
|---|---|---|---|
DeviceNumber |
INTEGER | In | Logical device number. See appendix B. Use 1 for your own terminal. |
OutputValue |
INTEGER | In | The byte to write. |
Direction: In = the program supplies the value, Out = the call returns it, In/Out = both.
See also¶
OutUpTo8Bytes, Out8Bytes, OutString, OutputString, OutMessage, OutNumber, and InByte
Compatibility¶
| Machines | Users | Programs |
|---|---|---|
| ND-100 and ND-500 | All users | All programs |
The manual's compatibility box for this call, word for word.
Yes/no fields from the YAML extraction (not in the manual's words):
| ND-100 | ND-500 | User programs | RT programs | System programs |
|---|---|---|---|---|
| Yes | Yes | No | No | No |
Examples¶
From the manual (OCR text, not corrected).
INTEGER : DeviceNumber, OutputValue
...
ON ROUTINEERROR DO
IF ErrCode >< 0 THEN ...
ENDON
Monitor_call('OutByte', DeviceNumber, OutputValue)
INTEGER DeviceNumber, OutputValue
...
Monitor_Call('OutByte', DeviceNumber, OutputValue)
IF (ErrCode .NE. 0) THEN ...
DeviceNumber, OutputValue : INTEGER2;
...
OutByte(DeviceNumber, OutputValue);
IF ErrCode <> 0 THEN ...
01 DeviceNumber COMP.
01 OutputValue COMP.
01 ErrCode COMP.
...
MONITOR-CALL "OutByte" USING DeviceNumber, OutputValue.
CALL "CbError" USING ErrCode.
IF ErrCode NOT = 0 GO ...
DeviceNumber : W BLOCK 1
OutputValue : W BLOCK 1
ErrCode : W BLOCK 1
OutByte : EQU 37B9 + 2B
...
CALLG OutByte, 2, DeviceNumber, OutputValue
IF K GO ERROR
...
ERROR : W1 =: ErrCode %ErrorCode in W1 register.
LDT DEVNO %Logical device number.
LDA BYTE %Byte to be written.
MON 2 %Monitor call OutByte.
JMP ERROR %Error return from monitor call.
... %Normal return.
ERROR, %Error number in A register.
DEVNO, ...
BYTE, 'A'
Scanned by Jonny Oddene for Sintran Data © 2020
ndmonlib implementation¶
Validated Registered MON_STATUS_VALIDATED in src/core/mon_registry.c: implemented, tested and working.
| Handler | mon_2B_OutByte |
| Code lines | 64 (non-blank, non-comment lines in the file) |
Emulation research¶
Source
This section comes from the emulation: block of the call's YAML file in the NDInsight repo. It records what was learned while implementing the call in nd500x; its status is nd500x's, not ndmonlib's.
| Status (nd500x) | implemented |
| nd500x handler | nd500x/src/libmon/handlers/mon_2B_OutByte.c |
| Last updated | 2026-07-17 |
Parameter notes¶
1. DeviceNumber
| Field | Value |
|---|---|
| Note | 32-bit word (ND-500 INTEGER = W). Routed by device class: character device or terminal -> console; mass-storage file -> open-file table with the byte pointer incremented (the manual's "The pointer to the next byte is incremented when writing to mass-storage"); anything else -> error 24. |
| Verified | Yes |
2. OutputValue
| Field | Value |
|---|---|
| Note | Read as a 32-bit word; only the low 8 bits are written. |
| Verified | Yes |
Return contract¶
- Success: K flag cleared.
-
Errors
Code Octal Meaning 24 030B No such device name (unsupported device class) 90 132B No file opened with this number 124 174B Illegal parameter (file not open for writing, or host write error) 111 157B Missing parameter (fewer than 2 CALLG args)
Verified¶
1. The device model is shared with 1B: device 1 = own terminal, files are numbered separately. See the device_model block on 1B_InByte.yaml - it is recorded once there rather than duplicated.
| Field | Value |
|---|---|
| Evidence | Same is_character_device()/is_terminal()/is_mass_storage_file() routing in nd500x/src/libmon/handlers/mon_2B_OutByte.c. |
2. The real SINTRAN error codes are used, not invented ones.
| Field | Value |
|---|---|
| Evidence | Commit 6b57202 swept the invented 52/53/55/57 out of every handler and replaced them from the Appendix A table (nd500x/src/libmon/mon_errors.h). |
Unverified¶
- NO OBSERVED CALLER. Neither NC, CAT-500 nor the ND linker has been traced issuing 2B - they use 504B DVOUTS / 162B OUTST, exactly as the manual advises ("You are advised to use the faster OutputString on the ND-500"). So this handler is implemented but NOT proven end to end.
- The manual's "The program waits if the output buffer of the device is full" is NOT modelled: nd500x has no output buffer and never waits on write. See 67B OutBufferSpace, which always reports free space for the same reason.
- Word-oriented devices ("if the device is a word-oriented device, one word is written") are not modelled; nd500x always writes one byte.
Sources¶
| Doc | Note |
|---|---|
| SINTRAN III Monitor Calls (ND-860228.2 EN) | The manual body of this YAML. |
Source¶
SINTRAN III Monitor Calls (ND-860228.2 EN), page 377.