220B DirectOpen¶
Stub MON 220B (144 decimal) · Mnemonic DOPEN · Group: File Operations (manual section 2.4)
Available from: All programs (manual compatibility box)
Emulation source: src/handlers/mon_220B_DirectOpen.c
Description¶
Opens a file. Files must be opened before they can be accessed. For public users this monitor call is identical to OpenFile. User SYSTEM and user RT are given the same access rights as the owner of a file.
Parameters¶
| Name | Type | Direction | Description |
|---|---|---|---|
FileNumber |
INTEGER2 | Out | File number returned on success. |
AccessCode |
INTEGER2 | In | Access code: 0=Sequential write, 1=Sequential read, 2=Random read/write, 3=Random read only, 4=Sequential read/write, 5=Sequential write append, 6=Random read/write common contiguous, 7=Random read common contiguous, 8=Random read/write contiguous direct transfer, 9=Random read/write append. |
FileName |
STRING | In | File name. |
FileType |
STRING | In | File type. Do not include the colon. Default is SYMB. |
Direction: In = the program supplies the value, Out = the call returns it, In/Out = both.
See also¶
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 | Yes | Yes | No |
Examples¶
From the manual (OCR text, not corrected).
INTEGER : FileNumber, AccCode
BYTES : FileName(0:63), FileType(0:3)
...
ON ROUTINEERROR DO
IF ErrCode > 0 THEN ...
ENDON
Monitor_Call('DirectOpen', FileNumber, AccCode, FileName, FileType)
INTEGER FileNumber, AccCode
CHARACTER FileName*64, FileType*4
...
Monitor_Call('DirectOpen', FileNumber, AccCode, FileName(1:64), FileType(1:4))
C IF (ErrCode .NE. 0) THEN ...
FileNumber, AccCode : INTEGER2;
FileName : PACKED ARRAY [0..63] OF CHAR;
FileType : PACKED ARRAY [0..3] OF CHAR;
...
DirectOpen(FileNumber, AccCode, FileName, FileType);
IF ErrCode <> 0 THEN ...
01 FileNumber COMP.
01 AccCode COMP.
01 FileName PIC X(64).
01 FileType PIC X(4).
01 ErrCode COMP.
...
MONITOR-CALL "DirectOpen" USING FileNumber, AccCode, FileName, FileType.
CALL "CbError" USING ErrCode.
IF ErrCode NOT = 0 GO ...
FileNumber : W BLOCK 1
AccCode : W BLOCK 1
FileName : STRINGDATA 'EXAMPLE'
FileType : STRINGDATA 'SYMB'
ErrCode : W BLOCK 1
DirectOpen : EQU 3789 + 220B
...
CALLG DirectOpen, 4, FileNumber, AccCode, FileName, FileType
IF K GO ERROR
...
ERROR : W1 =: ErrCode %ErrorCode in W1 register.
LDX (FILE %Address of file name string.
LDA (TYPE %Address of file type string.
LDT ACCES %Access code.
MON 220 %Monitor call DirectOpen.
JMP ERROR %Error return from monitor call.
STA FILNO %Normal return, store the filenumber returned.
...
ERROR, ... %Error number in register A.
...
FILNO, 0
ACCES, ...
FILE, 'EXAMPLE' %Open EXAMPLE:SYMB
TYPE, 'SYMB' %
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_220B_DirectOpen |
| Code lines | 8 (non-blank, non-comment lines in the file) |
Source¶
SINTRAN III Monitor Calls (ND-860228.2 EN), page 151.