Skip to content

263B GetDeviceType

In progress   MON 263B (179 decimal) · Mnemonic GDEVT · Group: Device Handling (manual section 2.11)

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

Emulation source: src/handlers/mon_263B_GetDeviceType.c

Description

Gets the device type, e.g. terminal, floppy disk, mass-storage file, etc. The monitor call also provides information on how to handle the device.

Parameters

Name Type Direction Description
DeviceNo INTEGER In Logical device number (1= own terminal). See appendix B.
IOFlag INTEGER In Input or output part. Use 0 for input and 1 for output.
DevType INTEGER Out Device type. The numbers below are returned: 0: Unspecified. 1: Terminal. 2: Terminal access device (TAD). 3: Communication channel. 4: Internal block device. 5: Floppy disk drive. 6: Magnetic tape station. 7: Mass-storage file.
DevAttr INTEGER4 Out Device information (returned in the combined A and D registers. The bits have the following meaning: Bit 0: InByte or OutByte allowed. Bit 1: StartOnInterrupt allowed. Bit 2: DeviceControl allowed. Bit 3: Block calls allowed. Bit 4: ClearDevice available. Bit 5: Reservation not needed. Bit 6: COSMOS remote open file. Bit 10g: NOTS (NET/One Terminal Server) terminal. Bit 11g: MTAD device.

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

Compatibility

ND-100 ND-500 User programs RT programs System programs
Yes Yes Yes Yes Yes

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 : DeviceNo, IOFlag, DevType
INTEGER4 : DevAttr
...
ON ROUTINEERROR DO
IF ErrCode >< 0 THEN ...
ENDON
Monitor_Call('GetDeviceType', DeviceNo, IOFlag, DevType, DevAttr)
INTEGER DeviceNo, IOFlag, DevType
INTEGER*4 DevAttr
...
Monitor_Call('GetDeviceType', DeviceNo, IOFlag, DevType, DevAttr)
IF (ErrCode .NE. 0) THEN ...
DeviceNo, IOFlag, DevType : INTEGER2;
DevAttr : LONGINT;
...
GetDeviceType (DeviceNo, IOFlag, DevType, DevAttr);
IF ErrCode <> 0 THEN ...
01 DeviceNo COMP.
01 IOFlag COMP.
01 DevType COMP.
01 DevAttr COMP PIC S9(10).
01 ErrCode COMP.
...
MONITOR-CALL "GetDeviceType" USING DeviceNo, IOFlag, DevType, DevAttr.
CALL "CbError" USING ErrCode.
IF ErrCode NOT = 0 GO ...
DeviceNo : W BLOCK 1
IOFlag : W BLOCK 1
DevType : W BLOCK 1
DevAttr : W BLOCK 1
ErrCode : W BLOCK 1
GetDeviceType : EQU 37B9 + 263B
...
CALLG GetDeviceType, 4, DeviceNo, IOFlag, DevType, DevAttr
    IF K GO ERROR
...
ERROR : W1 =: ErrCode    %ErrorCode in W1 register.
LDT DEVNO                 %Logical device number.
LDA IOF                   %Input/output flag.
MON 263                  %Monitor call GetDeviceType.
JMP ERROR                %Error return from monitor call.
STT TYPE                 %Normal return, store device type.
STD ATBUT                %Store device attributes.
...
ERROR, ...               %Error number in register A.
...
DEVNO, ...
IOF, ...
TYPE, 0
ATBUT, 0
0                        %A double number.
0                        %

ndmonlib implementation

In progress Registered MON_STATUS_IN_PROGRESS: partly implemented. The dispatcher calls the handler.

Handler mon_263B_GetDeviceType
Code lines 40 (non-blank, non-comment lines in the file)

Notes from the handler source

src/handlers/mon_263B_GetDeviceType.c line 56

An open mass-storage file - which is what the ND linker asks about, for
the DDBTABLES file it just opened. Byte I/O and block I/O both apply;
an already-open file needs no reservation.

src/handlers/mon_263B_GetDeviceType.c line 62

Device 1 is the console; the character-device range covers the terminal.
A terminal does byte I/O; it is the program's own terminal, so no
reservation is needed.

src/handlers/mon_263B_GetDeviceType.c line 68

Not modelled - report Unspecified with no capabilities rather than
guess. UNVERIFIED: whether SINTRAN ever returns 0 for a live device, or
errors instead. No program has exercised this branch.

src/handlers/mon_263B_GetDeviceType.c line 75

Input vs output part does not change the answer for the
device classes modelled here; kept for the log/contract.

src/handlers/mon_263B_GetDeviceType.c line 78

[O] DevType (INTEGER = 32-bit word), [O] DevAttr (INTEGER4). The manual
says DevAttr comes back "in the combined A and D registers", but this ND-500
CALLG passes four parameter ADDRESSES, so both OUT values are written to the
parameter block. Writing them is the point of the call - a GDEVT that
returned success without writing DevType/DevAttr would be the 412B FSCNT /
144B MAGTP OUT-parameter defect class again.

Emulation research

Source

This section comes from the emulation: block of the call's YAML file in the NDInsight repo. It records what was learned while implementing the call in nd500x; its status is nd500x's, not ndmonlib's.

Status (nd500x) implemented
nd500x handler nd500x/src/libmon/handlers/mon_263B_GetDeviceType.c
Last updated 2026-07-17

Detail

Implemented 2026-07-17 (commit ba66f33). The ND linker calls GDEVT on the DDBTABLES file and on the domain file it opens; the stub had returned -1 and halted execution.

Device types

  • Radix: decimal
  • Source: SINTRAN III Monitor Calls (ND-860228.2 EN)
  • Values

    Code Name
    0 Unspecified
    1 Terminal
    2 Terminal access device (TAD)
    3 Communication channel
    4 Internal block device
    5 Floppy disk drive
    6 Magnetic tape station
    7 Mass-storage file

Dev attr bits

Bit Meaning
0 InByte/OutByte allowed
1 StartOnInterrupt allowed
2 DeviceControl allowed
3 Block calls allowed
4 ClearDevice available
5 Reservation not needed
6 COSMOS remote open file

Mapping

  • An open mass-storage file (device 64-127) -> DevType 7, DevAttr = InByte/OutByte + Block calls + Reservation-not-needed.
  • Device 1 / terminal / character device -> DevType 1, DevAttr = InByte/OutByte + Reservation-not-needed.
  • Unmodelled device -> DevType 0 (Unspecified), DevAttr 0 (unverified branch, no program exercises it).

Parameter notes

1. DevType

Field Value
Note OUT (INTEGER word). Must be written - a GDEVT that returns success without writing DevType/DevAttr is the 412B FSCNT / 144B MAGTP OUT-parameter defect class.
Verified Yes

2. DevAttr

Field Value
Note OUT (INTEGER4). Manual says "returned in the combined A and D registers", but the ND-500 CALLG passes 4 parameter addresses, so it is written to the parameter block via a dword write.
Verified Yes

Source

SINTRAN III Monitor Calls (ND-860228.2 EN).