114B GetTimeUsed¶
Validated MON 114B (76 decimal) · Mnemonic TUSED · Group: Not grouped in manual
Available from: Background programs (manual compatibility box)
Emulation source: src/handlers/mon_114B_GetTimeUsed.c
Description¶
Gets the time you have used the CPU since you logged in. In batch jobs, you get the time since you entered the job.
- The CPU time used is given in basic time units. A basic time unit is 1/50th of a second.
- Can also be used from RT-programs.
Parameters¶
| Name | Type | Direction | Description |
|---|---|---|---|
TimeUsed |
LONGINT | Out | CPU time used in basic time units (1/50s). Output returned in W1 register. |
Direction: In = the program supplies the value, Out = the call returns it, In/Out = both.
See also¶
@TIME-USED
Compatibility¶
| Machines | Users | Programs |
|---|---|---|
| ND-100 and ND-500 | All users | Background 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).
INTEGER4 : TimeUsed
...
Monitor_Call('GetTimeUsed', TimeUsed)
INTEGER*4 TimeUsed
...
Monitor_Call('GetTimeUsed', TimeUsed)
TimeUsed : LONGINT;
...
GetTimeUsed(TimeUsed);
01 TimeUsed COMP PIC S9(10).
...
MONITOR-CALL "GetTimeUsed" USING TimeUsed.
TimeUsed : W BLOCK 1
GetTimeUsed : EQU 37B9 + 114B
...
CALLG GetTimeUsed, 0
W1 =: TimeUsed %Result is returned in W1 register.
MON 114 %Monitor call GetTimeUsed.
STD TIME %Store CPU time.
...
TIME, 0 %A double word.
0 %
ndmonlib implementation¶
Validated Registered MON_STATUS_VALIDATED in src/core/mon_registry.c: implemented, tested and working.
| Handler | mon_114B_GetTimeUsed |
| Code lines | 17 (non-blank, non-comment lines in the file) |
Notes from the handler source¶
src/handlers/mon_114B_GetTimeUsed.c line 20
Reset session time (can be called from mon_init or debugger).
The TUSED baseline now lives in mon_clock; kept as a thin alias so existing
callers continue to work.
src/handlers/mon_114B_GetTimeUsed.c line 28
Elapsed CPU time in basic time units. In deterministic (pinned-clock)
mode this returns 0 so the run is bit-reproducible; otherwise it is the
real host CLOCK_MONOTONIC elapsed since session start.
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_114B_GetTimeUsed.c |
| Last updated | 2026-07-17 |
Note¶
Returns elapsed CPU time in basic time units (1/50 s) from mon_clock. Two modes (commit 4fa340a): unpinned = real host CLOCK_MONOTONIC elapsed since session start; ND500X_PIN_CLOCK set = ALWAYS 0, so the run is bit-reproducible. A guest that waits for TUSED to advance would spin forever in pinned mode - no observed program does.
Parameter notes¶
| Name | Note | Verified |
|---|---|---|
| TimeUsed | Returned in W1/I1 ONLY. Unlike 11B, the nd500x handler does NOT also write a parameter word. The manual types it LONGINT; nd500x returns a 32-bit value. | Yes |
Observed calls¶
1. CAT-500 code generator (cat-cat5-b06.dom), startup
| Field | Value |
|---|---|
| Params | |
| Expectation | Part of CAT-500's fixed startup sequence (11B TIME, 114B TUSED, 143B RSIO, 422B GSWSP, 41B ROBJE, 76B SETBS, 62B RMAX, 73B SMAX, 504B DVOUTS, 503B DVINST) before its banner and "Cat-500:" prompt. It does not appear to act on the value; a pinned 0 does not stop it. |
| Note | Source: nd500x/docs/CAT500_UECOM_CSHARP_HANDOFF.md Part C. |
Return contract¶
- Success: K flag cleared; TimeUsed in W1 (I1). 0 when the clock is pinned.
- Errors
Verified¶
1. MON 114B dispatches via MCTAB to the L07 worker TUSED in segment 003-S3CP.
| Field | Value |
|---|---|
| Evidence | Carve L-VSX-500 114B-GetTimeUsed/README.md: MCTAB slot (segment 044-S3IDPIT, byte offset 1976) = 041303B = TUSED; TUSED worker body carved at 041303B-041373B in 003-S3CP (byte offset 9606). Reproduced: dd if=044-S3IDPIT.bin bs=1 skip=1976 count=2 -> 42 c3. |
Unverified¶
- nd500x measures HOST wall time (CLOCK_MONOTONIC), not emulated CPU time. The manual says "the time you have used the CPU". These are different quantities; on a fast host the emulator reports far less than a real ND-500 would, and the number moves with host load.
- "Time since you logged in" / "since you entered the job" has no emulator analogue - the baseline is the session start (mon_clock_reset_session / mon_reset_session_time).
- An audited but NOT-APPLIED correction is recorded in nd500x/docs/MON_CSHARP_SYNC_HANDOFF.md PART C: "114B TUSED: optional byte-proven entry arg-check that returns error selector 147 on mismatch." nd500x performs no argument check at all. The selector 147 has not been cross-checked against the Appendix A error table here.
- The TUSED worker body is carved but was not decoded for this note.
- 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/114B-GetTimeUsed/README.md | MCTAB[114B] = TUSED = 041303B, worker carved in 003-S3CP. |
| nd500x/src/libmon/mon_clock.c | mon_clock_tused_basic_units() - returns 0 when pinned. |
Source¶
SINTRAN III Monitor Calls (ND-860228.2 EN), page 293.