17B SetTerminalType¶
Validated MON 17B (15 decimal) · Mnemonic MSTTY · Group: Monitor Calls for Terminal Handling (manual section 2.6)
Available from: All programs (manual compatibility box)
Emulation source: src/handlers/mon_17B_SetTerminalType.c
Description¶
Sets the type of a terminal. The terminal type tells SINTRAN III how to handle a particular terminal. A wrong terminal type normally distorts the screen. The function keys cannot be used.
- Appendix H lists the terminal types.
- Public background users may only set the terminal type for their own terminal. A background program must be run from user SYSTEM or RT to set the terminal type for another terminal.
Parameters¶
| Name | Type | Direction | Description |
|---|---|---|---|
DeviceNumber |
INTEGER2 | In | The logical device number of the terminal. Use 1 for your own terminal in background programs. |
TerminalType |
INTEGER2 | In | The terminal type. See appendix H for terminal types. |
Direction: In = the program supplies the value, Out = the call returns it, In/Out = both.
See also¶
GetTerminalType, @SET-TERMINAL-TYPE
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 : DeviceNumber, TerminalType
...
ON ROUTINEERROR DO
IF ErrCode <> 0 THEN ...
ENDON
Monitor_Call('SetTerminalType', DeviceNumber, TerminalType)
INTEGER DeviceNumber, TerminalType
...
Monitor Call('SetTerminalType', DeviceNumber, TerminalType)
IF (ErrCode .NE. 0) THEN ...
DeviceNumber, TerminalType : INTEGER2;
...
SetTerminalType(DeviceNumber, TerminalType);
IF ErrCode <> 0 THEN ...
01 DeviceNumber COMP.
01 TerminalType COMP.
01 ErrCode COMP.
...
MONITOR-CALL "SetTerminalType" USING DeviceNumber, TerminalType.
CALL "CbError" USING ErrCode.
IF ErrCode NOT = 0 GO ...
DeviceNumber : W BLOCK 1
TerminalType : W BLOCK 1
ErrCode : W BLOCK 1
SetTerminalType : EQU 37B9 + 17B
...
CALLG SetTerminalType, 2, DeviceNumber, TerminalType
IF K GO ERROR
...
ERROR : W1 =: ErrCode %ErrorCode in W1 register.
LDT DEVNO %Logical device number.
LDA TYPE %Terminal type number.
MON 17 %Monitor call SetTerminalType.
JMP ERROR %Error return from monitor call.
... %Normal return.
ERROR, ... %Error number in register A.
...
DEVNO, ...
TYPE, ...
ndmonlib implementation¶
Validated Registered MON_STATUS_VALIDATED in src/core/mon_registry.c: implemented, tested and working.
| Handler | mon_17B_SetTerminalType |
| Code lines | 20 (non-blank, non-comment lines in the file) |
Notes from the handler source¶
src/handlers/mon_17B_SetTerminalType.c line 20
This is SINTRAN's @SET-TERMINAL-TYPE mechanism at the MON level: MSTTY
writes the per-terminal type, 16B MGTTY reads it back. It used to accept
and ignore, so set->get did not round-trip and a program could not
configure its own terminal - which matters because a program that reads
type 0 (not set) asks the user instead.
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) | stub |
| nd500x handler | nd500x/src/libmon/handlers/mon_17B_SetTerminalType.c |
| Last updated | 2026-07-17 |
Stub behaviour¶
ACCEPT-AND-IGNORE SUCCESS NO-OP - SAY SO. 17B MSTTY validates nothing and stores nothing: the emulated console has no ND-specific terminal-type behaviour to configure. Consequence worth knowing: a 17B MSTTY followed by a 16B MGTTY does NOT read back the type that was set - 16B always answers 0.
Parameter notes¶
| Name | Note | Verified |
|---|---|---|
| TerminalType | Read as a 32-bit word (ND-500 INTEGER = W) despite the manual typing it INTEGER2, then discarded. | Yes |
Observed calls¶
| Caller | Expectation | Note |
|---|---|---|
| ND linker (linker-b01.dom), startup | Called during startup terminal configuration; only needs not to fail. | Before this handler existed the auto-generated stub returned error -1 and the linker crashed in startup device configuration. Commit 940ba39. |
Return contract¶
- Success: K flag cleared.
-
Errors
Code Octal Meaning 111 157B Missing parameter (fewer than 2 CALLG args)
Verified¶
| Claim | Evidence |
|---|---|
| The linker proceeds past its startup with the accept-and-ignore no-op. | Commit 940ba39: "17B MSTTY (SetTerminalType): accept-and-ignore success no-op." |
Unverified¶
- THE PRIVILEGE RULE IS NOT ENFORCED. The manual says "Public background users may only set the terminal type for their own terminal. A background program must be run from user SYSTEM or RT to set the terminal type for another terminal." nd500x does not check the user and never returns a privilege error. Which error code real SINTRAN returns for that violation is unknown - do not guess one.
- No terminal type is validated against Appendix H (which we do not hold), so an illegal type is accepted silently.
- THE CARVE WAS NOT MINED FOR THIS ENTRY. A carve folder exists at .../L-VSX-500/re/mon-analysis/17B-SetTerminalType/ and has not been read in.
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 477.