161B InString¶
Stub MON 161B (113 decimal) · Mnemonic INSTR · Group: File Operations (manual section 2.4)
Available from: All programs (manual compatibility box)
Emulation source: src/handlers/mon_161B_InString.c
Description¶
Reads a string of characters from a peripheral device, e.g. a terminal.
Notes¶
- Background programs wait if there are no characters in the device buffer. RT programs continue.
- All parameters are fetched and returned via the alternative page table.
- You are advised to use the faster InputString on the ND-500.
- Appendix F contains an ASCII table.
Parameters¶
| Name | Type | Direction | Description |
|---|---|---|---|
DeviceNo |
INTEGER | In | Logical device number of a peripheral device. See appendix B. |
TextRead |
STRING | Out | Buffer to receive the string of characters read. |
NoOfBytes |
INTEGER | In | Maximum number of characters to read. |
Terminator |
INTEGER | In | Terminating character. Input stops when this character is read. |
ReturnStatus |
INTEGER | Out | 16-bit status word. -1=parameter error. Bits 15:14 indicate: 0=max chars read, 1=terminator read, 2=not terminated (RT only), 3=device error. Bits 13:0 contain count of chars read (if bits 15:14 are 0, 1, or 2). |
Direction: In = the program supplies the value, Out = the call returns it, In/Out = both.
See also¶
InputString, In8AndFlag, InUpTo8Bytes, In8Bytes, In4x2Bytes, and OutString
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 : DeviceNo, NoOfBytes, Terminator, ReturnStatus
BYTES : TextRead(0:255)
Monitor_Call(‘InString’. DeviceNo, TextRead, NoOfBytes, &
Terminator, ReturnStatus)
fortran
INTEGER DeviceNo, NoOfBytes, Terminator, ReturnStatus
CHARACTER TextRead*256
...
Monitor_Call('InString', DeviceNo, TextRead(1:256), NoOfBytes,
C Terminator, ReturnStatus)
pascal
DeviceNo, NoOfBytes, Terminator, ReturnStatus : INTEGER2;
TextRead : PACKED ARRAY [0..255] OF CHAR;
...
InString(DeviceNo, TextRead, NoOfBytes, Terminator, ReturnStatus);
01 DeviceNo COMP.
01 TextRead PIC X(256).
01 NoOfBytes COMP.
01 Terminator COMP.
01 ReturnStatus COMP.
...
MONITOR-CALL "InString" USING DeviceNo, TextRead, NoOfBytes,
Terminator, ReturnStatus.
| DeviceNo | : W BLOCK 1 |
|------------|-----------------|
| TextRead | : STRING 4000B |
| NoOfBytes | : W BLOCK 1 |
| Terminator | : W BLOCK 1 |
| ReturnStatus | : W BLOCK 1 |
| InString | : EQU 37B9 + 161B |
CALLG InString, 4, DeviceNo, TextRead, NoOfBytes, Terminator
IF K GO Error
W1 := ReturnStatus %Status is returned in W1 register.
Error.
LDA (PAR %Load register A with address of parameter list.
MON 161 %Monitor call InString.
STA STAT %Store status returned.
| STAT. 0 | |
|---------|-----------------------|
| PAR, | DEVNO %Logical device number |
| TEXT | %String read. |
| COUNT | %Maximum number of characters to be read. |
| TERM | %Terminator character. |
DEVNO,
TEXT, 0 \
**+50/ %Make a string of 80 characters.
COUNT, 120 %To read maximum 80 characters.
TERM, @' %Terminate reading when @ is read.
ND-100 and ND-500 All users All programs
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_161B_InString |
| Code lines | 8 (non-blank, non-comment lines in the file) |
Source¶
SINTRAN III Monitor Calls (ND-860228.2 EN), page 323.