7B ReadBlock¶
Stub MON 7B (7 decimal) · Mnemonic RPAGE · Group: File Operations (manual section 2.4)
Available from: not known - no compatibility box captured from the manual
Emulation source: src/handlers/mon_7B_ReadBlock.c
Description¶
Reads randomly from a file. You read one block at a time. The file must be opened for random read access.
- The standard block size is 512 bytes. You can change this with SetBlockSize. The first block is number 0.
Parameters¶
| Name | Type | Direction | Description |
|---|---|---|---|
FileNumber |
INTEGER2 | In | File number. See OpenFile. |
BlockNo |
INTEGER2 | In | Block number. |
DataDestination |
ARRAY | Out | Array for data returned. |
ErrCode |
INTEGER2 | Out | Standard Error Code. See appendix A. |
Direction: In = the program supplies the value, Out = the call returns it, In/Out = both.
See also¶
SetStartBlock, SetBlockSize, ReadDiskPage, ReadFromFile, WriteBlock
Compatibility¶
| ND-100 | ND-500 | User programs | RT programs | System programs |
|---|---|---|---|---|
| Yes | Yes | Yes | Yes | No |
From the YAML extraction; this call's page in the manual had no compatibility box that was captured.
Examples¶
From the manual (OCR text, not corrected).
INTEGER : FileNumber, BlockNo
BYTES : DataDestination(0:511)
...
ON ROUTINEERROR DO
IF ErrCode > 0 THEN ...
ENDON
Monitor_Call('ReadBlock', FileNumber, BlockNo, DataDestination(0))
INTEGER FileNumber, BlockNo
INTEGER DataDestination(256)
...
Monitor Call('ReadBlock', FileNumber, BlockNo, DataDestination(1))
IF (ErrCode .NE. 0) THEN ...
FileNumber, BlockNo : INTEGER2;
DataDestination : ARRAY [0..15] OF RECORD...END;
...
ReadBlock(FileNumber, BlockNo, DataDestination);
IF ErrCode <> 0 THEN ...
01 FileNumber COMP.
01 BlockNo COMP.
01 DataDestination.
02 array COMP OCCURS 256 TIMES.
01 ErrCode COMP.
...
MONITOR-CALL "ReadBlock" USING FileNumber, BlockNo, DataDestination.
CALL "CbError" USING ErrCode.
IF ErrCode NOT = 0 GO ...
LDT FILN0 %File number returned from earlier open.
LDA BLKN0 %Block number.
LDX (BUFF %Address of buffer to receive block read.
MON 7 %Monitor call ReadBlock.
JMP ERROR %Error return from monitor call.
... %Normal return.
ERROR, ... %Error number in register A.
...
FILN0, ...
BLKN0, ...
BUFF, 0
*+400/ %Make a buffer of 256 words.
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_7B_ReadBlock |
| Code lines | 7 (non-blank, non-comment lines in the file) |
Source¶
SINTRAN III Monitor Calls (ND-860228.2 EN), page 394.