113B GetCurrentTime¶
Validated MON 113B (75 decimal) · Mnemonic CLOCK · Group: Commonly-Used Monitor Calls (manual section 2.3)
Available from: All programs (manual compatibility box)
Emulation source: src/handlers/mon_113B_GetCurrentTime.c
Description¶
Gets the current system time and date.
- The current system time is returned as basic time units, seconds, minutes, hours, day, month, and year.
Parameters¶
| Name | Type | Direction | Description |
|---|---|---|---|
TimeBuffer |
ARRAY | Out | Buffer to receive 7 integers containing: [0] = basic time units (1/50th second) [1] = seconds [2] = minutes [3] = hours [4] = day [5] = month [6] = year |
Direction: In = the program supplies the value, Out = the call returns it, In/Out = both.
See also¶
GetBasicTime, AdjustClock, SetClock, and @DATCL
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 ARRAY : TimeBuffer(0:6)
...
Monitor_Call('GetCurrentTime', TimeBuffer(0))
INTEGER TimeBuffer(7)
...
Monitor_Call('GetCurrentTime', TimeBuffer(1))
TimeBuffer : record;
...
GetCurrentTime(TimeBuffer);
01 TimeBuffer.
02 array COMP OCCURS 7 TIMES.
...
MONITOR-CALL "GetCurrentTime" USING TimeBuffer.
TimeBuffer : W BLOCK 7
GetCurrentTime : EQU 37B9 + 113B
...
CALLG GetCurrentTime, 1, TimeBuffer
| Instruction | Parameter | Comment |
|-------------|-----------|----------------------------------------------|
| LDA | (PAR | %Load register A with address of parameter list. |
| MON | 113 | %Monitor call GetCurrentTime. |
| ... | | |
| PAR, | CLOK | |
| ... | | |
| CLOK, 0 | | %Basic time units. |
| | 0 | %Seconds. |
| | 0 | %Minutes. |
| | 0 | %Hours. |
| | 0 | %Day. |
| | 0 | %Month. |
| | 0 | %Year. |
Scanned by Jonny Oddene for Sintran Data © 2020
ndmonlib implementation¶
Validated Registered MON_STATUS_VALIDATED in src/core/mon_registry.c: implemented, tested and working.
| Handler | mon_113B_GetCurrentTime |
| Code lines | 37 (non-blank, non-comment lines in the file) |
Notes from the handler source¶
src/handlers/mon_113B_GetCurrentTime.c line 46
Get current time via the MON clock (pinned UTC instant in deterministic
mode, else real host localtime).
src/handlers/mon_113B_GetCurrentTime.c line 58
Calculate basic time units since midnight
= hours * 3600 * 50 + minutes * 60 * 50 + seconds * 50
src/handlers/mon_113B_GetCurrentTime.c line 83
[6] Year, written as the full year (e.g. 1985).
INFERRED, NOT PROVEN. Read the whole note before changing this either
way. This returned tm_year % 100 until 2026-08-08.
What is settled:
- This buffer is seven separate words, not the packed 32-bit ND date
word used for file-system dates (that one crams year/month/day/
hour/minute/second into one word, year as a 6-bit offset from 1950).
The MON 113B manual page lists the seven words individually, and
MP-P2-N500.NPL from line 1310 copies all seven resident clock words
verbatim to the ND-500, widening each to 32 bits and converting
nothing. So the packed format does not apply here.
What is NOT settled - the width of this word:
- The manual never states it. The MON 113B page gives the seventh word
only as "%Year.", and MON 111B SetClock likewise says only "Year.".
- The one piece of evidence either way is a single line of SINTRAN.
RP-P2-ACCRT.NPL packs an accounting record right after the call:
"TPARA+ACBASE"; *MON 2CLOC % GET TIME OF DUMP (line 184)
D:=0; A:=YEAR-3554/\77; ... (line 186)
TPARA is this same seven-word buffer (declared above it as BUNI,
SEC, MINUT, HOUR, DAY, MNTH, YEAR). The radix there is octal - the
mask 77 is 63, six contiguous bits, whereas 77 decimal would be the
nonsense mask 1001101 - so 3554 is 1900. Subtracting 1900 from the
returned value only makes sense if it is a full year: on 85 it goes
negative. That is the whole argument.
- Against it: that line uses a base of 1900, while the file-date
format uses 1950, so the two are not one consistent convention.
- Do not cite the MON YAML corpus. Its "last two digits (tm_year %
100)" note quotes this C file, so it was written from the emulator.
No observation distinguishes the two. For any 1980s date, a caller that
prefixes "19" to the low two digits prints the same thing whichever it
received. The ND LINKER does exactly that, which is why its banner still
reads 1926 with this fix in place.
What would settle it: a capture from a real SINTRAN III system showing a
date rendered from this call, or the resident clock's own year cell read
out of a live system or a memory image.
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) | implemented |
| nd500x handler | nd500x/src/libmon/handlers/mon_113B_GetCurrentTime.c |
| Last updated | 2026-07-17 |
Note¶
Fully implemented against a real clock source. By default it uses the host localtime; with the environment variable ND500X_PIN_CLOCK set it uses a pinned UTC instant so a whole compile run is bit-reproducible (commit 4fa340a). ND500X_PIN_CLOCK=1 pins to 1990-01-01 12:00:00 UTC (epoch 631195200) - the instant AGREED WITH the RetroCore C# emulator so both produce an identical MON time stream for a cross-emulator checkpoint diff. ND500X_PIN_CLOCK=<secs> pins to an arbitrary epoch.
Parameter notes¶
1. TimeBuffer
| Field | Value |
|---|---|
| Note | OUT parameter, and the ONLY output - there is no W1 return. On ND-500 each of the 7 elements is a 32-bit word (W BLOCK), so the handler writes at byte offsets +0, +4, +8, +12, +16, +20, +24 - a 28-byte buffer, not the 14 bytes an ND-100 (H) reading would give. On ND-100 INTEGER is a 16-bit halfword; getting this wrong silently shifts every field. |
| Verified | Yes |
2. TimeBuffer
| Field | Value |
|---|---|
| Note | OUT-PARAMETER DEFECT CLASS - this call's entire result is its OUT parameter. Returning SUCCESS without writing all 7 words is the failure shape that cost days on 412B FSCNT (commit 73ac594) and 144B MAGTP function 0 (commit 6ad9c09): the caller reads a stale cell and dies far away. The write IS the contract. |
| Verified | Yes |
3. TimeBuffer[0]
| Field | Value |
|---|---|
| Note | Basic time units SINCE MIDNIGHT, computed as (hour3600 + min60 + sec) * 50. 50 basic time units per second (20 ms each). |
| Verified | Yes |
4. TimeBuffer[6]
| Field | Value |
|---|---|
| Note | Year is the last two digits (tm_year % 100), e.g. 85 for 1985, 90 for 1990. |
| Verified | Yes |
Return contract¶
- Success: K flag cleared; 7 words written to TimeBuffer.
-
Errors
Code Octal Meaning 111 157B Missing parameter (fewer than 1 argument supplied) 124 174B Illegal parameter (host time breakdown failed - an emulator-side guard)
Verified¶
1. MON 113B dispatches via MCTAB to the L07 worker CLOCK in segment 003-S3CP.
| Field | Value |
|---|---|
| Evidence | Carve L-VSX-500 113B-GetCurrentTime/README.md: MCTAB slot (segment 044-S3IDPIT, byte offset 1974) = 040756B = CLOCK; CLOCK worker body carved at 040756B-040765B in 003-S3CP (byte offset 9180). Reproduced: dd if=044-S3IDPIT.bin bs=1 skip=1974 count=2 -> 41 ee. |
2. The pinned clock makes a full NC run bit-reproducible.
| Field | Value |
|---|---|
| Evidence | Commit 4fa340a: "Verified: 6/6 fresh pinned runs bit-identical; full ctest 18/18 pass." 113B is one of the calls routed through it. |
Unverified¶
- The CLOCK worker body is carved but was not decoded field by field for this note, so the buffer layout above is the MANUAL's, cross-checked only against the handler - not read from the carved worker's stores.
- Whether real SINTRAN returns local time or UTC. nd500x uses host LOCALTIME when unpinned and GMTIME when pinned (mon_clock_breakdown), so the two modes can differ by the host's timezone offset. Not settled from a manual.
- Not yet audited against the carve - listed under "NOT yet audited vs carve" in nd500x/docs/HANDOFF_MON_COMPLETENESS.md.
Sources¶
| Doc | Note |
|---|---|
| NDInsight/tools/sintran-segment-carver/versions/L-VSX-500/re/mon-analysis/113B-GetCurrentTime/README.md | MCTAB[113B] = CLOCK = 040756B, worker carved in 003-S3CP. |
| nd500x/src/libmon/mon_clock.c | The pinnable clock source (ND500X_PIN_CLOCK), shared with 114B, 142B and 41B. |
Source¶
SINTRAN III Monitor Calls (ND-860228.2 EN), page 227.