Skip to content

22B OutUpTo8Bytes

In progress   MON 22B (18 decimal) · Mnemonic M8OUT · Group: File Operations (manual section 2.4)

Available from: All programs (manual compatibility box)

Emulation source: src/handlers/mon_22B_OutUpTo8Bytes.c

Description

Writes up to 8 characters to a device, e.g. a terminal or an internal device.

Notes

  • You can only use this monitor call for terminals, TADs, internal devices, and synchronous modems.
  • The writing terminates when a character with value 0 is found. The 0 byte is not output.
  • Appendix F contains an ASCII table.
  • Standard Error Code is returned via ErrCode variable in high-level languages, or in W1 register for ASSEMBLY-500. The K flag indicates if an error occurred.

Parameters

Name Type Direction Description
DeviceNo INTEGER In Logical device number. Use 1 for your own terminal. File numbers are illegal.
OutData STRING In The 8 characters to be written (writing stops at first 0 byte).

Direction: In = the program supplies the value, Out = the call returns it, In/Out = both.

See also

OutMessage, Out8Bytes, OutputString, OutString, OutNumber, OutByte, and InUpTo8Bytes

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 Yes Yes No

Examples

From the manual (OCR text, not corrected).

    INTEGER : DeviceNo
    BYTES : OutData(0:7)
    ...
    ON ROUTINEERROR DO
    IF ErrCode > 0 THEN ...
    ENDON
    Monitor_Call('OutUpTo8Bytes', DeviceNo, OutData)
INTEGER DeviceNo
CHARACTER OutData*8
...
Monitor_Call('OutUpTo8Bytes', DeviceNo, OutData(1:8))
IF (ErrCode .NE. 0) THEN ...
DeviceNo : INTEGER2;
OutData : RECORD...END;
...
OutUpTo8Bytes(DeviceNo, OutData);
IF ErrCode <> 0 THEN ...
01 DeviceNo COMP.
01 OutData PIC X(8).
01 ErrCode COMP.
...
MONITOR-CALL "OutUpTo8Bytes" USING DeviceNo, OutData.
CALL "CbError" USING ErrCode.
IF ErrCode NOT = 0 GO ...
    DeviceNo : W BLOCK 1
    OutData : STRINGDATA 8
    ErrCode : W BLOCK 1
    OutUpTo8Bytes : EQU 37B9 + 22B
    ...
    CALLG OutUpTo8Bytes, 2, DeviceNo, OutData
    IF K GO ERROR
    ...
    ERROR : W1 =: ErrCode               %ErrorCode in W1 register.
    LDT  DEVNO           %Logical device address.
    LDD  BYTES           %First 4 bytes to be written.
    LDX  BYTES+2         %Next 2 bytes to be written.
    COPY SX DL
    LDX  BYTES+3         %Last 2 bytes to be written.
    MON  22              %Monitor call OutUpTo8Bytes.
    JMP  ERROR           %Error return from monitor call.
    ...
                          %Normal return.
    ERROR, ...           %Error number in register A.
    ...
    DEVNO, ...
    BYTES, 'HELLO!!!'

ndmonlib implementation

In progress Registered MON_STATUS_IN_PROGRESS: partly implemented. The dispatcher calls the handler.

Handler mon_22B_OutUpTo8Bytes
Code lines 48 (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_22B_OutUpTo8Bytes.c
Last updated 2026-07-17

Parameter notes

1. OutData

Field Value
Note Taken as a RAW BYTE ADDRESS (arg_addresses[1]) and read byte by byte - NOT as an ND-500 [Length][Pointer] descriptor and NOT as a 0x27-terminated SINTRAN string. Contrast 32B OutMessage (descriptor) and 162B OutString (descriptor in its 2-arg form). If a caller passes a descriptor here it will print the descriptor bytes.
Verified Yes

2. DeviceNo

Field Value
Note 32-bit word. File numbers are rejected before anything is written.
Verified Yes

Return contract

  • Success: K flag cleared; 0 to 8 bytes written.
  • Errors

    Code Octal Meaning
    124 174B Illegal parameter (a file number was passed - the manual says file numbers are illegal)
    24 030B No such device name (not a character device or terminal)
    111 157B Missing parameter (fewer than 2 CALLG args)

Verified

1. Writing stops at the first 0 byte and the 0 is NOT output; at most 8 bytes are written.

Field Value
Evidence Implements the manual's own rule ("Writing terminates when a character with value 0 is found. The 0 byte is not output.") - mon_22B_OutUpTo8Bytes.c loop over i < 8 with break on b == 0.

2. File numbers are rejected, per the manual's "Only for terminals, TADs, internal devices, and synchronous modems. File numbers are illegal."

Field Value
Evidence is_mass_storage_file(device_no) -> error 124 (174B), before any output.

Unverified

  • NO OBSERVED CALLER. No traced program (NC, CAT-500, ND linker) issues 22B; they use 504B DVOUTS / 162B OUTST. Implemented but NOT proven end to end.
  • Error 124 (174B Illegal parameter) for the file-number case is a CHOICE, not a read value - the manual says file numbers are illegal but does not give the code it returns.
  • TADs, internal devices and synchronous modems (the other device classes the manual permits) are not modelled at all; nd500x accepts only character devices and terminals and returns 24 (030B) for everything else.

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 387.