Skip to content

312B CheckMonCall

Validated   MON 312B (202 decimal) · Mnemonic MOINF · Group: Not grouped in manual

Available from: All programs (manual compatibility box)

Emulation source: src/handlers/mon_312B_CheckMonCall.c

Description

Some monitor calls are optional or only available in later versions of SINTRAN III. This monitor call checks if a monitor call exists in your particular SINTRAN III system. Optional monitor calls are included or left out when SINTRAN III is generated.

Parameters

Name Type Direction Description
MonCallNumber INTEGER In Monitor-call number.
MonCallEntry INTEGER Out Address of the monitor call entry. 0 means not implemented.

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

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 : MonCallNumber, MonCallEntry
...
Monitor_Call('CheckMonCall', MonCallNumber, MonCallEntry)
INTEGER MonCallNumber, MonCallEntry
...
Monitor_Call('CheckMonCall', MonCallNumber, MonCallEntry)
MonCallNumber, MonCallEntry : INTEGER2;
...
CheckMonCall(MonCallNumber, MonCallEntry);
01 MonCallNumber COMP.
01 MonCallEntry COMP.
...
MONITOR-CALL "CheckMonCall" USING MonCallNumber, MonCallEntry.
MonCallNumber : W BLOCK 1
MonCallEntry : W BLOCK 1
CheckMonCall : EQU 3789 + 312B
...
CALLG CheckMonCall, 2, MonCallNumber, MonCallEntry
...
LDA MONNO %Load register A with monitor call number.
MON 312 %Monitor call CheckMonCall.
...
%Return: Monitor call not implemented in system.
STA ENTRY %Skipreturn: Monitor call is implemented.
...

MONNO, ... %Monitor call number.
ENTRY, 0 %Monitor call entry returned if implemented.

ndmonlib implementation

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

Handler mon_312B_CheckMonCall
Code lines 29 (non-blank, non-comment lines in the file)

Notes from the handler source

src/handlers/mon_312B_CheckMonCall.c line 21

Real SINTRAN III VSX-500 L07 Monitor-Call TABle (MCTAB / 9MCTA @ 005620B),
carved byte-for-byte from segment 044-S3IDPIT (L-VSX-500 image, MCTAB[0] at
file byte offset 1824, 256 big-endian words). MOINF/312B returns MCTAB[N]:
the call's dispatch-entry address, or 0 if the call is not generated into this
system. 216 of 256 slots are populated; every populated slot lands on a named
L07 symbol (e.g. MCTAB[312B]=032600B MOINF, MCTAB[317B]=050701B UECOM,
MCTAB[321B]=065453B UEADM - all oracle-verified).

This REPLACES the earlier fake (0xF8000000+num), which the L07 oracle
(mon-oracle-for-NC/312B-MOINF_317B-UECOM.md) explicitly flagged as wrong: MOINF
returns a 16-bit entry word or 0, never a 32-bit sentinel, and NC dereferences
the entry for some calls (e.g. 321B UEADM), so the true value is required.

src/handlers/mon_312B_CheckMonCall.c line 86

MOINF is a capability probe: it returns the call's real dispatch entry,
MCTAB[N], or 0 if the call is not generated into THIS SINTRAN system. We ARE
emulating an L07 VSX-500 system, so we report exactly what that system's
carved MCTAB holds - no fabricated value, no dependence on which handlers
this emulator happens to implement. 0 = not present; non-zero = present and
the 16-bit entry address (which NC dereferences for some calls, e.g. 321B).

NOTE (ND-100 vs ND-500 form): the ND-100 MAC ABI signals presence via the
skip-return convention; the ND-500 CALLG two-parameter form NC uses writes
the entry into the second parameter (0 = not implemented). We follow the
ND-500 form and write MCTAB[N] into arg[1].

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_312B_CheckMonCall.c
Last updated 2026-07-17

Note

THE REAL CONTRACT IS FULLY BYTE-PROVEN (see verified below) - MOINF simply returns MCTAB[N]. nd500x does NOT implement that: it has no MCTAB, so it answers from its own handler registry and synthesises a fake entry address, with ONE hard-coded exception (321B) where the real MCTAB value is returned. Status is "partial" for that reason, not because the contract is unclear.

Parameter notes

1. MonCallNumber

Field Value
Note IN parameter, 32-bit word on ND-500 (W BLOCK). The real ND-100 worker takes it in the A register and bounds-checks it against 256.
Verified Yes

2. MonCallEntry

Field Value
Note OUT parameter - the result goes to argument 1, NOT to W1. 0 means the call does not exist in this system; non-zero is the call's dispatch entry address. OUT-PARAMETER DEFECT CLASS: this call's whole answer is its OUT parameter; returning SUCCESS without writing it leaves the caller reading a stale cell and failing far away (as 412B FSCNT did, commit 73ac594, and 144B MAGTP function 0, commit 6ad9c09). nd500x writes it whenever arg_count >= 2.
Verified Yes

Observed calls

1. NC C front-end (nc-a06.dom), branch at 0x08029092 / 0x0802909E

Field Value
Params Moncallnumber: 321
Expectation NC probes for 321B UEADM and only takes its "UEADM available" path when the returned entry is NON-ZERO. Returning 0 makes NC skip building its list, walk a NULL, and crash at 0x080241FC.
Note MonCallNumber is octal 321B. nd500x returns MCTAB[321B] = 065453B for this case. See docs/NC_CRASH_0x08023EA4_ROOTCAUSE.md UPDATE 31 and commit 2618145.

Return contract

  • Success: K flag cleared; MonCallEntry written. REAL SINTRAN uses the ND-100 skip-return convention instead - normal return with A=0 means "not implemented", skip return with A=entry means "implemented".
  • Errors

    Code Octal Meaning
    111 157B Missing parameter (fewer than 1 argument supplied)

Verified

1. MOINF reads the caller's A (the MON number), bounds-checks it against 256 (000400B), indexes MCTAB @ 005620B by it, returns MCTAB[N] in the caller's A, and takes the SKIP RETURN only when the entry is non-zero.

Field Value
Evidence Carve L-VSX-500 312B-CheckMonCall - EVERYTHING is byte-proven from the carved instruction and data words: 032600B IRR 10 DA (read caller's A); 032601B-032603B LDT 35 (=256) / SKP IF DA MLST ST (the bound); 032604B-032605B X:=n / A := mem[005620B + n]; 032607B RADD CLD 0 DA (out of range -> 0); 032610B IRW 10 DA (return entry); 032611B JAZ; 032612B-032614B the skip return; 032615B JMP I 6. See 312B-CheckMonCall.pseudo.c and .ASM.

2. MCTAB[N] holds MON N's worker entry address, or 0 if not implemented.

Field Value
Evidence Same carve. MCTAB base 005620B is the 032637B constant read via LDA I ,X 32; the bound 000400B is the 032636B constant read via LDT 35.

3. MOINF is dispatch machinery and lives with the dispatcher in 026-S3IMPIT / 017-S3SMPIT (load 32000B), immediately after CALLP=032201B - NOT in 003-S3CP with the ordinary workers.

Field Value
Evidence Carve README (CORRECTED 2026-07-13, "and SPECIAL"): MCTAB slot 006132B (segment 044-S3IDPIT, byte offset 2228) = 032600B = MOINF; worker body carved at 032600B-032615B in 026-S3IMPIT (byte offset 768). Reproduced: dd if=044-S3IDPIT.bin bs=1 skip=2228 count=2 -> 35 80. In the 003-S3CP overlay the same virtual address 032600B decodes as an unrelated data record table (X103T..X107E) - MOINF must NOT be read there.

4. MCTAB[321B] = 065453B (UEADM), so 321B EXISTS in SINTRAN L07.

Field Value
Evidence Carve: dd if=044-S3IDPIT.bin bs=1 skip=2242 count=2 -> 6b 2b = 065453B; the UEADM worker is carved in 003-S3CP. Commit 2618145 applied it.

Unverified

  • THE FAKE ENTRY ADDRESS 0xF8000000 + MonCallNumber, returned for every implemented call other than 321B, IS INVENTED. It is an agreed CROSS-EMULATOR CONVENTION between nd500x and RetroCore (commit 9b0c904: "implemented calls return fake entry 0xF8000000+n, non-existent and deprecated calls return 0"), not a SINTRAN value. A caller that DEREFERENCES the returned entry would fault - no observed program does; NC only tests it against zero.
  • nd500x answers from its own handler registry (mon_get_status), so its answer describes WHAT THE EMULATOR IMPLEMENTS, not what SINTRAN L07 was generated with. Those sets differ. The faithful implementation would be a real MCTAB table carved out of 044-S3IDPIT; only slot 321B has been wired.
  • nd500x reports MON_STATUS_DEPRECATED calls as NON-EXISTENT (entry 0). That is the agreed cross-emulator convention, but for 321B specifically it contradicts the byte truth - hence the hard-coded exception ABOVE the registry lookup.
  • nd500x uses the K flag / OUT-parameter convention, not the ND-100 SKIP RETURN the carve proves. Whether an ND-500 CALLG-form 312B uses the skip return at all is not established.
  • A pre-existing nd500x unit-test failure is recorded as "312B MCTAB" in the MON suite (commits 2d9b00f, 73ac594: "3 pre-existing failures (312B MCTAB, 256B DEABF x2)"). Not diagnosed here.

Discrepancies

1. "GOTAB[321B] = octal 112376 (bytes 94 FE) - NON-ZERO", used as the value 312B should return for 321B, on the model that GOTAB is the monitor-call table.

Field Value
Is MOINF returns MCTAB[N], not GOTAB[N]. MCTAB[321B] = 065453B (carve-verified). The 0112376 GOTAB value is RETRACTED/WRONG - it came from reading the wrong table, and 065453B read in SINTRAN-DATA_commoncode is zeros (wrong overlay), which is what produced the old "absent" conclusion.
Evidence Carve tier oracle 312B-MOINF_317B-UECOM.md and .../mon-analysis/321B-UEAdministrator/README.md CORRECTED 2026-07-13; commit 2618145. The retraction is also recorded in the handler comment at mon_312B_CheckMonCall.c lines 37-49, which preserves both the old claim and its correction.

2. The nd500x handler's own header comment reads "[O] MonCallEntry (INTEGER): Address of entry (0 if exists, non-zero if not)".

Field Value
Is Inverted. 0 = does NOT exist. The manual field, the nd500x registry ("0 means not implemented") and the carved worker all agree, and the code below that comment implements it correctly. The comment is stale.
Evidence Carve pseudo-C: "entry==0 -> normal return (call NOT implemented); entry!=0 -> skip return, A = entry (call implemented)."

3. An older nd500x test expected 312B to return 0 or -1.

Field Value
Is The agreed convention is fake entry 0xF8000000+n for implemented, 0 for non-existent and deprecated.
Evidence Commit 9b0c904: "old expectation of 0/-1 was wrong".

Sources

Doc Note
NDInsight/tools/sintran-segment-carver/versions/L-VSX-500/re/mon-analysis/312B-CheckMonCall/312B-CheckMonCall.pseudo.c Fully byte-proven model of the real worker - the best available spec for this call.
NDInsight/tools/sintran-segment-carver/versions/L-VSX-500/re/mon-analysis/312B-CheckMonCall/README.md MCTAB[312B] = MOINF = 032600B; MOINF lives in 026-S3IMPIT, not 003-S3CP.
nd500x/docs/MON_CSHARP_SYNC_HANDOFF.md Line 63: "For 321B UEADM, return MCTAB[321B] = octal 065453 (carve-verified)."

Source

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