6B WriteScratchFile¶
Stub MON 6B (6 decimal) · Mnemonic WDISK · Group: File Operations (manual section 2.4)
Available from: Background programs (manual compatibility box)
Emulation source: src/handlers/mon_6B_WriteScratchFile.c
Description¶
Writes randomly to 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 writing to. First block is 0. |
Buffer |
ARRAY | In | Buffer address containing data to write (256 words / 512 bytes). |
Direction: In = the program supplies the value, Out = the call returns it, In/Out = both.
See also¶
WriteBlock, WriteToFile, and ReadScratchFile
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 |
|---|---|---|---|---|
| Yes | No | No | No | No |
Examples¶
From the manual (OCR text, not corrected).
INTEGER : BlockNumber
BYTES : Buffer(0:511)
...
ON ROUTINEERROR DO
IF ErrCode > 0 THEN ...
ENDON
Monitor_Call('WriteScratchFile', BlockNumber, Buffer(0))
INTEGER BlockNumber
INTEGER Buffer(256)
...
Monitor Call('WriteScratchFile', BlockNumber, Buffer(1))
IF (ErrCode .NE. 0) THEN ...
BlockNumber : INTEGER2;
Buffer : ARRAY [0..15] OF RECORD...END;
...
WriteScratchFile(BlockNumber, Buffer);
IF ErrCode <> 0 THEN ...
01 BlockNumber COMP.
01 Buffer.
02 array COMP OCCURS 256 TIMES.
01 ErrCode COMP.
...
MONITOR-CALL "WriteScratchFile" USING BlockNumber, Buffer.
CALL "CbError" USING ErrCode.
IF ErrCode NOT = 0 GO ...
LDT BLKNO %Block number to be written into.
LDX (BUFF %Address of buffer containing data to be written.
MON 6 %Monitor call WriteScratchFile.
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_6B_WriteScratchFile |
| Code lines | 7 (non-blank, non-comment lines in the file) |
Source¶
SINTRAN III Monitor Calls (ND-860228.2 EN), page 567.