Trailing-Edge
-
PDP-10 Archives
-
SRI_NIC_PERM_SRC_3_19910112
-
pascal-demo/demo-programs.doc
There are no other files named demo-programs.doc in the archive.
Here are some examples of various system operations from Pascal. Please
make sure that you use the new version of Pascal. Until we put it on
the system, do
def sys: new:,sys:
before compiling any programs (or put it in LOGIN.CMD).
IPCF [Inter-Process Communication Facility]
I have some routines intended for programs that need to communicate with
programs running in other jobs or forks. These examples are set up for
asymmetric use, i.e. where there is one job that acts as a "server", and
processes transactions issued by any number of other jobs. Here are the
files involved:
server.pas - this contains the subroutines for writing a server.
You would load this with your server program, e.g.
EXECUTE MYSERV.PAS,<HEDRICK.431>SERVER.PAS
The documentation for these routines is in SERVER.HDR
server.hdr - this contains EXTERN declaratins of the routines in
server.pas. You should INCLUDE this file in your source
program
INCLUDE '<HEDRICK.431>SERVER.HDR';
The comments document the routines.
tests.pas - this is an example of a very simple server.
user.pas, user.hdr, testu.pas - same for the user routines
COMND package, string handling, and queue interface
I have included the source for the program BSCRIBE. Type HELP BSCRIBE
to see what the program does. This relatively short program uses lots
of system facilities, and so makes a good example. Here are the major
packages it uses:
COMND - this package lets you scan commands in the standard
Tops-20 fashion, allowing ?, escape, etc. It is documented
in <pascal>pascmd.pas. This is a header file, which contains
documentation on all the routines. You should INCLUDE it
in your source program. The actual routines are built into
the Pascal runtimes, so you don't have to do anything special
to load them.
QUASAR - this package lets you submit queue requests, including
requests to print, and batch jobs. [However it does not yet
support the bin field for print requests, which means it may
not be so useful - that would not be hard to add.]
<pascal>quasar.pas is a header file, which contains
documentation, and which you should INCLUDE. You must load
the program with <pascal>qsr, e.g.
EXECUTE MYPROG.PAS,<PASCAL>QSR
If you really like system programming, you may be interested to
look at the source for these routine, which is <hedrick.431>qsr.pas
STRING - this is a slightly modified version of the normal STRSET and
STRWRITE facilities. It is designed for handling strings
when you are going to be making monitor calls. This is special,
but such strings must be "ASCIZ", i.e. they must end with a
0 byte. For normal string handling, see the description of
STRSET and STRWRITE in the [Rutgers] Pascal manual. STRING.PAS
is a header file, which contains documentation, and which you
should INCLUDE. The actual routines are in the Pascal library.