74B SetStartByte¶
Validated MON 74B (60 decimal) · Mnemonic SETBT · Group: File Operations (manual section 2.4)
Available from: All programs (manual compatibility box)
Emulation source: src/handlers/mon_74B_SetStartByte.c
Description¶
Sets the next byte to be read or written in an opened mass-storage file.
- The bytes in a file are numbered upwards from 0.
Parameters¶
| Name | Type | Direction | Description |
|---|---|---|---|
FileNumber |
INTEGER | In | File number. See OpenFile. |
BytePointer |
INTEGER4 | In | Start byte in the file (32-bit value). First byte is 0. |
Direction: In = the program supplies the value, Out = the call returns it, In/Out = both.
See also¶
GetStartByte, SetStartBlock, SetMaxBytes, and @SET-BYTE-POINTER
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 : FileNumber
INTEGER4 : BytePointer
...
ON ROUTINEERROR DO
IF ErrCode > 0 THEN ...
ENDON
Monitor_Call('SetStartByte', FileNumber, BytePointer)
INTEGER FileNumber
INTEGER*4 BytePointer
...
Monitor_Call('SetStartByte', FileNumber, BytePointer)
IF (ErrCode .NE. 0) THEN ...
FileNumber : INTEGER2;
BytePointer : LONGINT;
...
SetBytePointer(FileNumber, BytePointer); [Note routine name.]
IF ErrCode <> 0 THEN ...
01 FileNumber COMP.
01 BytePointer COMP PIC S9(10).
01 ErrCode COMP.
...
MONITOR-CALL "SetStartByte" USING FileNumber, BytePointer.
CALL "CbError" USING ErrCode.
IF ErrCode NOT = 0 GO ...
FileNumber : W BLOCK 1
BytePointer : W BLOCK 1
ErrCode : W BLOCK 1
SetStartByte : EQU 37B9 + 74B
...
CALLG SetStartByte, 2, FileNumber, BytePointer
IF K GO ERROR
...
ERROR : W1 =: ErrCode %ErrorCode in W1 register.
LDT FILNO %File number returned from earlier open.
LOD POINT %Byte pointer.
MON 74 %Monitor call SetStartByte.
JMP ERROR %Error return from monitor call.
... %Normal return.
ERROR, ... %Error number in register A.
...
FILNO, ...
POINT, ... %A double word.
... %
ndmonlib implementation¶
Validated Registered MON_STATUS_VALIDATED in src/core/mon_registry.c: implemented, tested and working.
| Handler | mon_74B_SetStartByte |
| Code lines | 40 (non-blank, non-comment lines in the file) |
Notes from the handler source¶
src/handlers/mon_74B_SetStartByte.c line 47
Set the sequential read/write position to the given byte (first byte
is 0). Track it in the entry and seek the host file if present.
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_74B_SetStartByte.c |
| Last updated | 2026-07-17 |
Parameter notes¶
| Name | Note | Verified |
|---|---|---|
| BytePointer | INTEGER4 read as a full 32-bit word on the ND-500, not a halfword. The first byte of a file is 0. | Yes |
Return contract¶
- Success: K flag cleared; the entry position is set and the host file seeked.
-
Errors
Code Octal Meaning 87 127B File number out of range 90 132B No file opened with this number 99 143B No such block (host seek failed) 111 157B Missing parameter
Observed calls¶
1. ND linker (linker-b01.dom), DDB table load
| Field | Value |
|---|---|
| Params | Bytepointer: 0 |
| Expectation | The linker OPENs 'DDBTABLES-G':VTM (abbreviation-resolves to DDBTABLES-G06:VTM), 74B SETBTs the byte pointer to 0, then reads the file via 144B MAGTP function 0. The position set here is the position that read starts from. |
| Note | Also observed in a FAILURE cascade: when the linker's first 50B OPEN (empty file name) fails, the following 74B SETBT is issued with an invalid file number (56) and errors. That SETBT error is a SYMPTOM of the OPEN failure, not a SETBT defect - do not chase it. |
Verified¶
1. BytePointer is a 32-bit INTEGER4.
| Field | Value |
|---|---|
| Evidence | Recorded as carve-verified in nd500x/docs/MON_COMPLETENESS_MATRIX.md row 74B ("byte ptr read as 32-bit INTEGER4 (carve-verified)"). NOTE: that row does not record the octal address of the carved worker, so the specific byte cite is not reproducible from our notes - treat the width as verified, the citation as incomplete. |
2. The position set here is honoured by subsequent transfers.
| Field | Value |
|---|---|
| Evidence | Runtime: the linker SETBTs to 0 and its following 144B MAGTP function 0 read starts at 0 ("pos=10000" octal after a 4096-byte read). Commit 940ba39 implemented the real seek (the handler had been an auto-generated stub returning -1). |
Unverified¶
- Seeking BEYOND the end of the file is allowed by the host and reported as SUCCESS. What real SINTRAN does for a byte pointer past the end of a file is not established.
- Whether the real SETBT interacts with the block size (76B SETBS) - e.g. rejecting a pointer that is not on a block boundary - is not established; nd500x accepts any pointer.
Sources¶
| Doc | Note | Commit |
|---|---|---|
| SINTRAN III Monitor Calls (ND-860228.2 EN) | The manual page this YAML was extracted from. | |
| nd500x/docs/MON_COMPLETENESS_MATRIX.md | Row 74B SETBT - PASS, carve-verified width. | |
| 940ba39 (nd500x) - real SETBT implementation (was a stub returning -1) |
Source¶
SINTRAN III Monitor Calls (ND-860228.2 EN), page 471.