This note is a guide to the user of NODAL on the IBM PC/AT running XENIX. This note does not cover the syntax of the NODAL language but is an addendum to the suite of NODAL related manuals for the specific operational details of PC/AT XENIX NODAL. The following is a list of related manuals:
The following is a list of the current features included in the implementation (for more details, see the IBM PC/AT XENIX NODAL Functions manual:
The interpreter runs on systems with the following hardware configuration:
The interpreter runs under the XENIX 2.0 operating system. The network software for token ring interface should be resident and the appropriate host routing tables set up. The font files for Graphical Kernel System (GKS) should be in the appropriate place. The standard console installation covers all of these points.
The installation of NODAL concerns three files:
In the standard console installation, these files will already exist.
In addition to the keys and control sequences which have meaning in the line and screen editor, the following also have meaning:
The interpreter is started up by typing:
nodal
Command access to the TITN network (for file access, see below) is performed through the NODAL commands EXEC, WAIT and IMEX identically as from a computer on the TITN network. A word about case sensitivity: this implementation of NODAL is not case sensitive, all commands and data item references are converted to upper case on execution. However, elements such as strings and file-names are not converted because of possible loss of meaning. The TITN world is case sensitive and the following should be remembered:
For this implementation, a new command has been implemented and a function added. The command RFEXEC is a Remote File Execute which is similar to the normal EXECUTE except that the remote computer loads the specified file as well as receiving the NODAL elements sent with the command. It has the following syntax:
RFEXEC(comp)file [elements]
where:
comp | remote TITN computer name |
file | file to be loaded from remote computer |
elements | an optional list of line and data elements as for the normal EXECUTE command |
The command actually works by sending a NODAL element for line 1.01 as follows:
1.01 $DO "ERA 1.01; LOAD file; RUN"
where file is an exact copy of the string specified in the RFEXEC. Care therefore has to be taken that the line 1.01 is not included in the optional list of NODAL elements sent by the RFEXEC command.
The function SENS.C has been added. This function performs a non-blocking WAIT, after an EXECUTE to a TITN computer:
SET A = SENS.C
returns 0 if the remitted data is not yet available, 1 if remitted data has been received.
This concerns local and remote files accessed through the commands OLD, LOAD and SAVE (and function OPEN).
host[.user][index]filename
where:
host | computer name on TITN network> |
user | user name on destination host |
index | up to 6 digit decimal number in ASCII |
filename | up to 6 characters filename. |
An example:
SAVE #GP1#GATE
To remain compatible with previous versions of NODAL, brackets used to delimit the remote computer name are also accepted. The previous example becomes:
SAVE (GP1)GATE
For local files, the conventions of the underlying XENIX apply. The following are some examples:
SAVE file
SAVE FILE
SAVE dir2/file
SAVE ../dir1/file
The filename is copied directly from the command, therefore the filename is case sensitive. The first two examples of local file saves write to two different files.
The interface to the dataserver from XENIX NODAL is through the function GETDS which has the following syntax:
$SE A = GETDS(var, string)
where:
var | is the local variable which will receive the data. |
string | specifies the data item to be fetched (this has the format NAME,[SUBNAME] with NAME and the optional SUBNAME having a maximum of 6 characters each). |
A function has been implemented which performs the same as the c library function 'system' in XENIX.
call system(string) | passes the specified string through to an invocation of the c-shell. For example: |
call system("ps") | will send a description of the status of the current processes to the console. |
A facility has been implemented whereby compiled functions, actually in the form of main
programs, can be called from NODAL. The function is written, in any compiled
language supported on XENIX, as a main program which reads from its standard
input the parameters expected and likewise writes to its standard output any
results. This program is developed and tested completely separately from the
NODAL interpreter using standard input/output from/to the terminal.
In NODAL, the interface to this function is constructed using the mechanism for
constructing defined function headers, with the following possibilities:
DEF-CALL ... | call function |
DEF-FUNC ... | read-only numeric function |
DEF-STR ... | read-only string function with parameters |
With parameters:
V | value |
S | string |
R | reference |
For reference parameters, real variables and real arrays are allowed, but only in the cases of DEF-CALL functions are the values copied back to the NODAL data items, ie. in the case of DEF-F and DEF-S they are treated as read-only parameters, but in DEF-C functions, they are read/write parameters.
After the header has been constructed, the NODAL resident function, CFUNC is called which links the defined function header to the remote program as follows:
CFUNC(defined function name, string)
where string is the file name of the program. The file name can be absolute (eg. /usr/amk/fun/realfun) or relative to the current directory (eg. realfun, if the current directory is /usr/amk/fun). The defined function header is removed from the defined function list, and the function name is placed in the resident function list.
When the function is subsequently called in NODAL, the remote program is run as a son process, with the specified parameters written to it (by means of a pipe which becomes the program's standard I/O) and the results, if any, are read back. The header tells NODAL how the remote program should be called and specifies the parameters, however, if the program interface does not match the given header, the consequences are not defined. Care has to be taken that the header matches the function.
Two examples are given below, firstly a example of a numeric function with two read only parameters, secondly a call function with a reference parameter:
A numeric function with two read-only parameters. Firstly the program is written, in the C language for example:
#include <stdio.h> main() { float fl; char str[20]; /* read in the parameters */ scanf("%f%s",&fl,str); /* a floating point and a string*/ /* do something with them */ /* write the result of the function */ printf("%f\n",fl); } |
In NODAL, the following defined function header can be set up:
DEF-FUN AMK(V-A, S-B)
and then the CFUNC function is called to link the header with the actual remote function (program) as follows:
CFUNC(AMK, "here-it-is")
and the function AMK is added to the resident function list. The function can then be called:
SET A = AMK(1, "this is a string")
which returns the floating value to A.
A call function with a reference parameter. The following C program is written:
#include <stdio.h> main() { int i; float fl; char str[20]; for (i=0; i<10; i++) { /* read in a value, do something and write it back */ scanf("%f", &fl); printf("%f\n", fl); |
In NODAL, the following defined function header can be set up:
DEF-CALL AMK(R-A)
and then the CFUNC function is called to link the header with the actual program as follows:
CFUNC(AMK, "/usr/amk/compiled/fun1")
and the function AMK is added to the resident list. The function can then be called in NODAL:
DIM B(10); FOR I = 1,10; SET B(I) = I
AMK(B)
which will send the array B to the function, and then read the 10 elements back from the function.
The order in which the parameters are sent to the function is that in which they appear
in the function header. This also applies to the order in which reference
parameters come back from the function.