Another retro computing type question...
I'm hoping that someone out there will remember how to do direct character IO from the terminal under VMS using Ada83 (v3.0A).
Unfortunately this old version of Ada does not implement GET_IMMEDIATE in the TEXT_IO package.
There is a tantalising hint in Jones' book 'Ada in Action' at section 3.7.1 but I've not been able to find the listings that the text refers to, or anything in the DEC Language Reference Manual that might help directly. I'm sure I did this in FORTRAN and PASCAL a long time ago but can't for the life of me remember how!
I know I could make life easier for myself by upgrading, or even switching to Linux and using the GNAT compiler but half the fun is figuring out how stuff works (or in this case used to work).
Thanks
To start, please note that I have no experience at all with VAX/VMS and I don't have access to a VAX system. That said, section 3.7.5 of the book provides quite some details on the workings of the (missing) code. Using this description (and some info from the VAX Ada Run-Time Reference Manual, section 8.6, or the Run-Time Reference Manual for OpenVMS Systems, section 7.7, see here) I attempted to (more-or-less) reconstruct some part of the the VMS package (i.e. how it might've looked like). The result is shown below. I have no idea whether it even compiles, but it seems a nice starting point from which to continue the investigation.
Update (4-jul-2021)
Out of interest, I digged in a little bit further and it seems that
QIOandQIOWactually stand for system services named "Queue I/O (wait)". These services are described in some more recent VMS documents:The first manual describes the parameters for
$QIOand$QIOWwhile the second manual describes terminal specific driver functions which are likely needed here (see chapter 5 and appendix A.5).Based on these documents, it seems that you need to use use
$QIOand$QIOWin combination with a functionsIO_READVBLKandIO_WRITEVBLK. I'm not sure this is actually correct, but it at least seems plausible. I added this to the code below.disk2/dec/vmss.ada (reconstruction attempt)
disk2/dec/vmsb.ada (reconstruction attempt)
disk2/dec/vmsbi.ada (reconstruction attempt)
disk2/dec/vmsbo.ada (reconstruction attempt)
main.ada