Skip to content

413B FileNotAsSegment

Validated   MON 413B (267 decimal) · Mnemonic FSCDNT · Group: File System Operations (manual section 2.9)

Available from: All programs (manual compatibility box)

Emulation source: src/handlers/mon_413B_FileNotAsSegment.c

Description

Disconnects a file as a segment in your domain. FileAsSegment allows files to be accessed as segments. This monitor call disconnects the file.

  • The file is not closed.
  • The file is automatically disconnected by CloseFile.

Parameters

Name Type Direction Description
FileNumber INTEGER2 In File number. See OpenFile.
LogSegmentNumber INTEGER2 In Segment number (optional parameter).

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

See also

FileAsSegment

Compatibility

Machines Users Programs
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
No No Yes Yes No

Disagreement

The manual box says ND-500, but the yes/no fields say ND-100 = No, ND-500 = No. The manual box is the source.

Examples

From the manual (OCR text, not corrected).

INTEGER : FileNumber, LogSegNumber
...
Monitor_Call('FileNotAsSegment', FileNumber, LogSegNumber)
INTEGER FileNumber, LogSegNumber
...
Monitor_Call('FileNotAsSegment', FileNumber, LogSegNumber)
FileNumber, LogSegNumber: LONGINT;
...
FileNotAsSegment(FileNumber, LogSegNumber);
01 FileNumber COMP.
02 LogSegNumber COMP.
...
MONITOR-CALL "FileNotAsSegment" USING FileNumber, LogSegNumber.
FileNumber : W BLOCK 1
LogSegNumber : W BLOCK 1
FileNotAsSegment : EQU 37B9 + 413B
...
CALLG FileNotAsSegment, 2, FileNumber, LogSegNumber

ndmonlib implementation

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

Handler mon_413B_FileNotAsSegment
Code lines 68 (non-blank, non-comment lines in the file)

Notes from the handler source

src/handlers/mon_413B_FileNotAsSegment.c line 25

LogSegmentNumber is an OPTIONAL parameter, so one argument is legal.
Only FileNumber is mandatory.

src/handlers/mon_413B_FileNotAsSegment.c line 71

If the caller named a segment, it must be the one the file is mapped to.
If the caller omitted it, disconnect whichever segment that is.

src/handlers/mon_413B_FileNotAsSegment.c line 82

Flush the segment back to the host file BEFORE dropping the mapping.
A connected file is MAPPED, not copied: the program reads and writes the
file through ordinary memory accesses to the segment, so everything it
built there exists only in the segment's pages until now. The ND Linker
constructs an entire :DOM this way and never issues a 120B WFILE for the
domain body - without this flush a linked domain was written out as
megabytes of zeros with a null start address, and would not run.

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

Parameter notes

1. LogSegmentNumber

Field Value
Note Genuinely OPTIONAL, as the manual field says. The handler requires only FileNumber; with one argument it disconnects whichever segment the file is mapped to, and with two it requires the named segment to be the one the file is actually mapped to (else 174B).
Verified Yes

Return contract

  • Success: K flag cleared; the file's segment-mapping bookkeeping is cleared. The file itself stays OPEN, per the manual.
  • Errors

    Code Octal Meaning
    87 127B File number out of range
    90 132B No file opened with this number
    111 157B Missing parameter (no args)
    124 174B Illegal parameter (file not mapped as a segment; or the named segment is not the one it is mapped to)

Observed calls

1. CAT-500 (cat-cat5-b06.dom)

Field Value
Params Logsegmentnumber: 0
Expectation Observed while 412B FSCNT was still failing to write its OUT parameter: CAT-500's 413B disconnect arrived with LogSegmentNumber=0 and MISMATCHED the real segment. That was a downstream symptom of the 412B OUT-parameter defect, not a 413B defect - the caller was passing back the stale 0 it had read from the unwritten OUT cell.
Note See 412B_FileAsSegment.yaml emulation.discrepancies. Commit 73ac594.

Verified

Claim Evidence
The file is NOT closed by this call, and CloseFile disconnects automatically. Both are manual statements; the handler leaves the open-file entry in use and clears only mapped_as_segment / mapped_segment_no / segment_access_type.

Unverified

  • INCOMPLETE - this handler is BOOKKEEPING-ONLY and known to be so. It clears flags. It does NOT (a) write the segment's pages back to the file when the file was mapped WRITABLE, nor (b) free the segment / capability that 412B allocated. This is explicitly flagged as outstanding in nd500x/docs/HANDOFF_412B_FSCNT_FileAsSegment.md ("STILL TODO ... 413B FSCDNT: still only clears flags"). It has been survivable only because CAT-500's input mapping is read-only.
  • Consequence of the above: after 413B the physical pages and the domain's data capability LEAK, and a subsequent 412B on the same logical segment number sees state 412B's own allocator - not 413B - has to reconcile.
  • The carve for 413B was NOT usable as a contract source for the same reason as 412B (routing proven; body semantics unverified). The argument and error contract here is manual-based plus caller-observed.
  • Whether real SINTRAN errors at all when the named segment does not match the file's mapping (nd500x returns 174B) is not established.

Sources

Doc Note Carve Commit
SINTRAN III Monitor Calls (ND-860228.2 EN) The manual page this YAML was extracted from.
Routing only; body semantics unverified (same caveat as 412B). NDInsight/tools/sintran-segment-carver/versions/L-VSX-500/re/mon-analysis/413B-FileNotAsSegment/
nd500x/docs/HANDOFF_412B_FSCNT_FileAsSegment.md Section "STILL TODO" records the missing write-back + free.
73ac594 (nd500x) - the 412B OUT-parameter fix that also explains 413B's observed mismatch

Source

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