Skip to content

10B WriteBlock

Stub   MON 10B (8 decimal) · Mnemonic WPAGE · Group: File Operations (manual section 2.4)

Available from: not known - no compatibility box captured from the manual

Emulation source: src/handlers/mon_10B_WriteBlock.c

Description

Writes randomly to a file. You write one block at a time. The file must be opened for random write 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.
BlockNumber INTEGER2 In Block number.
Buffer ARRAY In Transferred block (data to be written).
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, WriteDiskPage, WriteFromFile, ReadBlock

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, BlockNumber
BYTES : Buffer(0:511)
...
ON ROUTINEERROR DO
    IF ErrCode > 0 THEN ...
ENDON
Monitor_Call('WriteBlock', FileNumber, BlockNumber, Buffer(0))
INTEGER FileNumber, BlockNumber
INTEGER Buffer(256)
...
Monitor Call('WriteBlock', FileNumber, BlockNumber, Buffer(1))
IF (ErrCode .NE. 0) THEN ...
FileNumber, BlockNumber : INTEGER2;
Buffer : ARRAY [0..15] OF RECORD...END;
...
WriteBlock(FileNumber, BlockNumber, Buffer);
IF ErrCode <> 0 THEN ...
01 FileNumber COMP.
01 BlockNumber COMP.
01 Buffer.
   02 array COMP OCCURS 256 TIMES.
01 ErrCode COMP.
...
MONITOR-CALL "WriteBlock" USING FileNumber, BlockNumber, Buffer.
CALL "CbError" USING ErrCode.
IF ErrCode NOT = 0 GO ...
LDT     FILNO       %File number returned from earlier open.
LDA     BLKNO       %Block number.
LDX     (BUFF       %Address of buffer to receive block read.
MON     10          %Monitor call WriteBlock.
JMP     ERROR       %Error return from monitor call.
        ...         %Normal return.
ERROR,  ...         %Error number in register A.

FILNO,  ...
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_10B_WriteBlock
Code lines 8 (non-blank, non-comment lines in the file)

Source

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