Skip to content

5B ReadScratchFile

Stub   MON 5B (5 decimal) · Mnemonic RDISK · Group: File Operations (manual section 2.4)

Available from: Background programs (manual compatibility box)

Emulation source: src/handlers/mon_5B_ReadScratchFile.c

Description

Reads randomly from the scratch file. One block is transferred. There is one scratch file connected to each terminal. It is opened for random read and write access when you log in. Its file number is 100B.

Notes

  • The standard block size is 512 bytes. You can change this with SetBlockSize. The first block is number 0.

Parameters

Name Type Direction Description
BlockNumber INTEGER In Block number to start reading from. First block is 0.
DataDestination ARRAY Out Buffer address for the transferred data (256 words / 512 bytes).

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

See also

ReadBlock, ReadFromFile. ReadFromFile is the most efficient monitor call

Compatibility

Machines Users Programs
ND-100 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
No No Yes Yes No

Disagreement

The manual box says ND-100, but the yes/no fields say ND-100 = No, ND-500 = No. The manual box is the source.

Examples

From the manual (OCR text, not corrected).

INTEGER : BlockNumber
BYTES : DataDestination(0:511)
...
ON ROUTINEERROR DO
    IF ErrCode > 0 THEN ...
ENDON
Monitor_Call('ReadScratchFile', BlockNumber, DataDestination(0))
INTEGER BlockNumber
INTEGER DataDestination(256)
...
Monitor_Call('ReadScratchFile', BlockNumber, DataDestination(1))
IF (ErrCode .NE. 0) THEN ...
BlockNumber : INTEGER2;
DataDestination : RECORD...END;
...
ReadScratchFile(BlockNumber, DataDestination);
IF ErrCode <> 0 THEN ...
01 BlockNumber COMP.
01 DataDestination.
   02 array COMP OCCURS 256 TIMES.
01 ErrCode COMP.
...
MONITOR-CALL "ReadScratchFile" USING BlockNumber, DataDestination.
CALL "CbError" USING ErrCode.
IF ErrCode NOT = 0 GO ...
| Instruction | Description                                  |
|-------------|----------------------------------------------|
| LDT BLKNO   | %Block number to be read.                    |
| LDX (BUFF   | %Address of buffer to receive block read.    |
| MON 5       | %Monitor call ReadScratchFile.               |
| JMP ERROR   | %Error return from monitor call.             |
| ...         | %Normal return.                              |
| ERROR, ...  | %Error number in register A.                 |
| BLKNO, ...  |                                              |
| BUFF, 0     | `*+400/` %Make a buffer of 256 words, 1 block. |

ndmonlib implementation

Stub Registered MON_STATUS_NOT_IMPLEMENTED: the handler is a stub. mon_dispatch() in src/core/mon_dispatch.c reports the call as unimplemented without calling it.

Handler mon_5B_ReadScratchFile
Code lines 6 (non-blank, non-comment lines in the file)

Source

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