Skip to content

0B ExitFromProgram

Validated   MON 0B (0 decimal) · Mnemonic LEAVE · Group: Commonly-Used Monitor Calls (manual section 2.3)

Available from: All programs (manual compatibility box)

Emulation source: src/handlers/mon_0B_ExitFromProgram.c

Description

Terminates the program. Returns to SINTRAN III. Batch jobs continues with the next command.

  • Background programs close all files not set permanently open. RT programs do not close any files.
  • RT programs release all reserved devices.

Parameters

None.

See also

ExitRTProgram

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

Monitor_Call('ExitFromProgram')
ExitFromProgram : EQU 37B9 + 0B
...
CALLG ExitFromProgram, 0
IF K GO Error %Possible if wrong number of parameters.
MON 0 %Monitor call ExitFromProgram.

ndmonlib implementation

Validated Registered MON_STATUS_VALIDATED in src/core/mon_registry.c: implemented, tested and working.

Handler mon_0B_ExitFromProgram
Code lines 11 (non-blank, non-comment lines in the file)

Notes from the handler source

src/handlers/mon_0B_ExitFromProgram.c line 20

"Background programs close all files not set permanently open" (see
file header) - this was documented but never implemented: without it,
any file the program built by writing through a connected segment
(mon_412B_FileAsSegment) is silently discarded, since writeback only
happens inside MON 43B CLOSE. RT programs are documented to keep their
files open across LEAVE; that distinction isn't tracked yet, so this
always closes-with-writeback (correct for the background/batch case
this emulator actually runs).

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) verified
nd500x handler nd500x/src/libmon/handlers/mon_0B_ExitFromProgram.c
Last updated 2026-07-17

Note

In the emulator LEAVE has no SINTRAN to return to, so the handler requests a CPU halt ("Program exit (MON 0B LEAVE)") and reports success. It does NOT close open files or release reserved devices, which the manual says a background program does on LEAVE - see unverified below.

Observed calls

1. ND linker (linker-b01.dom) @PC=0xB0016205

Field Value
Params
Expectation A clean program exit. This PC is the verified anchor for "the linker terminated normally" - a MON halt here is the expected end state, not a failure.
Note Reported as a verified anchor for the ND linker path (2026-07-17).

2. NC C front-end (nc-a06.dom)

Field Value
Params
Expectation NC ends every successful compile with a clean MON 0B LEAVE. Used throughout the nd500x work as the regression signal - e.g. commit 15ca5e9/b615586: "NC unchanged: clean MON 0B LEAVE at instr 1902382".
Note The instruction number is a determinism check, not part of the contract.

Return contract

  • Success: CPU halts; K flag cleared. The handler never returns an error.
  • Errors

Verified

1. MON 0B is dispatched through MCTAB, not the level-14 GOTAB, and its L07 worker is PRTEX.

Field Value
Evidence Carve L-VSX-500: MCTAB base 005620B in segment 044-S3IDPIT; the 0B slot (byte offset 1824) reads 35 bb = 032673B = PRTEX in segment 003-S3CP. dd if=044-S3IDPIT.bin bs=1 skip=1824 count=2 -> 35 bb. The earlier "GOTAB[0B]=000000 fall-through / LEAVE=144142B zero-filled" reading is retracted by the carve itself (CORRECTED 2026-07-15 header).

2. The emulator halts the CPU on 0B and both real ND programs reach it.

Field Value
Evidence handler mon_0B_ExitFromProgram.c calls mon_request_halt(); observed for NC (clean LEAVE) and the ND linker (PC=0xB0016205).

Unverified

  • The manual behaviours "background programs close all files not set permanently open" and "RT programs release all reserved devices" are NOT implemented by the nd500x handler - it only halts. No program observed so far depends on the implicit close, but a program that LEAVEs with a half-written file would not get it flushed by this call.
  • The PRTEX worker body was not read; only the MCTAB slot value is byte-proven. Whatever PRTEX does beyond terminating is unknown.
  • "Batch jobs continue with the next command" has no analogue in the emulator (there is no batch processor).

Sources

Doc Note
NDInsight/tools/sintran-segment-carver/versions/L-VSX-500/re/mon-analysis/0B-ExitFromProgram/README.md CORRECTED 2026-07-15 header carries the byte-verified MCTAB[0B] = PRTEX = 032673B.

Source

SINTRAN III Monitor Calls (ND-860228.2 EN), page 185.