Skip to content

30B GetOwnRTAddress

Validated   MON 30B (24 decimal) · Mnemonic GETRT · Group: Monitor Calls for Terminal Handling (manual section 2.6)

Available from: All programs (manual compatibility box)

Emulation source: src/handlers/mon_30B_GetOwnRTAddress.c

Description

Gets the address of the calling program's RT description. Background programs get the RT description address of the RT program which controls the terminal.

Parameters

Name Type Direction Description
RTDescrAddress INTEGER Out The RT description address returned in W1.

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

See also

GetRTAddress, GetRTDescr, GetRTName, and @LIST-RT-PROGRAMS

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 : RTDescrAddress
...
Monitor_Call('GetOwnRTAddress', RTDescrAddress)
INTEGER RTDescrAddress
...
Monitor_Call('GetOwnRTAddress', RTDescrAddress)
RTDescrAddress : INTEGER2;
...
GetOwnRTAddress(RTDescrAddress);
01 RTDescrAddress COMP.
...
MONITOR-CALL "GetOwnRTAddress" USING RTDescrAddress.
RTDescrAddress : W BLOCK 1
GetOwnRTAddress : EQU 37B9 + 30B
...
CALLG GetOwnRTAddress, 0
W1 =: RTDescrAddress %Result is returned in W1 register.
MON 30 %Monitor call GetOwnRTAddress.
STA RTPRO %Store address of RT description.
...
RTPRO, 0

ndmonlib implementation

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

Handler mon_30B_GetOwnRTAddress
Code lines 57 (non-blank, non-comment lines in the file)
Generator note registered VALIDATED but the source says 'TODO' - check whether the call is complete

Notes from the handler source

src/handlers/mon_30B_GetOwnRTAddress.c line 46

SINTRAN WINDOW SEGMENT (Segment 31)

ARCHITECTURAL NOTE:
In the real ND-500 system, RT descriptions are stored in ND-100 memory, not ND-500
memory. The ND-100 runs SINTRAN III and manages all RT scheduling. When the ND-100
suspends an ND-500 process, it saves the ND-500 registers into the RT description
(fields DPREG-DBREG). The ND-500 accesses this structure through shared memory or
a memory-mapped window to ND-100 space.

We use Segment 31 (0x1F) as the "SINTRAN Window" - a region that maps to ND-100
system tables. This is architecturally correct because:
- Segment 31 is reserved for system use (not user program space)
- It provides a clean separation between user data and SINTRAN data
- It can later be replaced with actual ND-100 memory when integrating emulators

IMPORTANT: The emulator must ensure segment 31 has valid MMU mappings:
- DC[31] must point to a valid physical segment in the PST
- Physical memory must be allocated for this segment
- The segment must be readable/writable by user code (for accessing RT descriptions)

Reference: ND-05.009.4 EN (ND-500 Reference Manual) - Memory Management

src/handlers/mon_30B_GetOwnRTAddress.c line 74

RT-Description structure size: 26 words.

src/handlers/mon_30B_GetOwnRTAddress.c line 79

Default priority for emulated processes.

src/handlers/mon_30B_GetOwnRTAddress.c line 84

Track if RT description has been initialized.

src/handlers/mon_30B_GetOwnRTAddress.c line 89

Initialize the RT-Description structure at RT_DESCRIPTION_ADDR.
This creates a simulated RT description for the emulated process.

STATUS word (offset 1) bit definitions per ND-60062-01D-EN page 289:
  Bit 0-7:  Priority (0-255, 255 = highest)
  Bit 8-9:  Ring
  Bit 10:   Not used
  Bit 11:   5ABS   - Absolute time scheduling
  Bit 12:   5INT   - Periodic program
  Bit 13:   5RWAIT - Voluntarily waiting (RTWT)
  Bit 14:   5REP   - Repeat after termination
  Bit 15:   5WAIT  - Waiting for I/O transfer

For a running program: no flags set, just priority.

Reference: SINTRAN III System Documentation (ND-60062-01D-EN), pages 289-290

src/handlers/mon_30B_GetOwnRTAddress.c line 134

Offset 8-15 (decimal) = 10-17 (octal): Saved registers (P, X, T, A, D, L, S, B)

Per SINTRAN III System Documentation (ND-60062-01D-EN), page 290:
"All registers of the current RT-program are saved in these locations
 IF IT IS INTERRUPTED."

Since our program is actively running (not interrupted), these fields
should be 0. The actual register values are in the CPU, not here.
These only get populated when the scheduler suspends the RT program.

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

Note

nd500x returns a pointer to a SYNTHETIC RT description it builds itself. There is no ND-100 in the emulator, so there is no real RT description to point at. Architecturally, real RT descriptions live in ND-100 memory (the ND-100 runs SINTRAN III and owns RT scheduling); the ND-500 reaches them through shared memory. nd500x models that with a "SINTRAN window" at segment 31 (0x1F), base 0xF8000000, and puts the RT description at offset 0x1000 = 0xF8001000. Everything about the ADDRESS and the CONTENTS is an emulator construction.

Parameter notes

1. RTDescrAddress

Field Value
Note Returned in W1/I1 (the A register on ND-100; the manual's MAC example is "MON 30 / STA RTPRO"). nd500x ALSO writes it to parameter word 0 when an argument is supplied, for high-level-language callers.
Verified Yes

2. RTDescrAddress

Field Value
Note REQUIREMENT ON THE HOST: segment 31 must have valid MMU mappings (DC[31] pointing at a valid PST physical segment, physical memory allocated, readable/writable by user code) or the caller's first dereference of the returned pointer faults.
Verified No

Return contract

  • Success: K flag cleared; RTDescrAddress = 0xF8001000 in W1 and in the OUT parameter.
  • Errors

Verified

1. MON 30B dispatches via MCTAB to the L07 worker GTRT in segment 025-S3IRPIT.

Field Value
Evidence Carve L-VSX-500 30B-GetOwnRTAddress/README.md CORRECTED 2026-07-15: MCTAB[30B] slot 005650B (segment 044-S3IDPIT, byte offset 1872) = 072036B = GTRT. Reproduced: dd if=044-S3IDPIT.bin bs=1 skip=1872 count=2 -> 74 1e.

2. The result is returned in A/W1.

Field Value
Evidence Manual MAC example "MON 30 / STA RTPRO"; carve README states the result is returned in W1 (the A register on the ND-100).

3. Saved-register fields (DPREG..DBREG) are only populated when the RT program is INTERRUPTED, so a running program must see 0 there.

Field Value
Evidence SINTRAN III System Documentation (ND-60062-01D-EN) page 290: "All registers of the current RT-program are saved in these locations IF IT IS INTERRUPTED." nd500x writes 0 to offsets 8-15 accordingly.

4. The STATUS word (offset 1) bit layout.

Field Value
Evidence ND-60062-01D-EN pages 289-290: bits 0-7 priority (0-255, 255 highest), bits 8-9 ring, bit 10 unused, bit 11 5ABS absolute time scheduling, bit 12 5INT periodic program, bit 13 5RWAIT voluntarily waiting (RTWT), bit 14 5REP repeat after termination, bit 15 5WAIT waiting for I/O transfer. For a running program: no flags, just priority.

Unverified

  • THE ADDRESS 0xF8001000 IS INVENTED. Segment 31 / the 0x1000 offset are an nd500x convention with no manual or carve backing. Nothing has been observed to depend on the specific value.
  • The 26-word RT-description layout in the handler header is transcribed from nd500x SINTRAN/OS/02-QUEUE-STRUCTURES-DETAILED.md plus ND-60062-01D-EN pages 289-290; the FIELD WIDTHS on ND-500 (nd500x writes 26 x 32-bit words) are not confirmed - the ND-100 structure is 16-bit words.
  • Fields left as TODO/0 in nd500x with no evidence: offset 7 SEGM (should carry the current domain), offsets 17-18 ACTSEG1/ACTSEG2. DEFAULT_PRIORITY is an invented 100.
  • Offset 6 STADR is filled with ctx->return_address as a "proxy" for the start address. That is a stand-in, not the real entry point.
  • The structure is initialised ONCE (static rt_description_initialized) and never refreshed, so it is a snapshot from the first 30B call.
  • No carved worker: the carve records NO ND-100 code worker and NO ND-100 named region for this call. GETRT resolves only in the L07 N500-SYMBOLS list (GETRT=106704B, the ND-500 companion). The real worker "reads the current RT-description pointer and returns it in A", but that read lies past the uncarved MFELL/CALLPROC bridge.
  • The manual behaviour "background programs get the RT description address of the RT program which controls the terminal" is not modelled - nd500x returns the same synthetic address regardless of caller.

Discrepancies

1. Earlier carve version: "GOTAB[30B] = 000000, a fall-through" on the disproven GOTAB-is-the-MON-table model (the README body still reads that way below its own correction header).

Field Value
Is MCTAB[30B] = 072036B = GTRT, byte-proven; dispatch is MON 30B -> ENT14(072167B) -> GOTAB[30B]=MFELL(072114B) -> CALLP(032201B) -> MCTAB[30B]=GTRT.
Evidence Carve CORRECTED 2026-07-15 header; dd if=044-S3IDPIT.bin bs=1 skip=1872 count=2 -> 74 1e.

Sources

Doc Note Page
NDInsight/tools/sintran-segment-carver/versions/L-VSX-500/re/mon-analysis/30B-GetOwnRTAddress/README.md MCTAB[30B] = GTRT = 072036B; no ND-100 worker carved.
SINTRAN III System Documentation (ND-60062-01D-EN) Pages 289-290: RT-description STATUS word bits and the saved-register rule. 289
ND-05.009.4 EN (ND-500 Reference Manual) Memory Management - cited by the handler for the segment-31 window model.

Source

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