A funny construction. What in the listing is called SAS is
"illegal". It is the instruction TFL, "set Teleprinter Flag".
Which just does that what it is called: Set the Teleprinter Flag.
There are two possibilities: If the interrupt system is set up
accordingly, this will cause an interrupt, which eventually could
do the printout via TLS.
The other possibility is the User Flag. Since EDU-50 and TSS-8 is
a multiuser system, it runs probably with this flag set.
The UM flag enabled traps all instructions OSR, HLT, LAS and IOT
to which SAS odr TSF belongs, to prevent that a user gains full
control over the machine. So he cannot HLT it or have access to
memoryfields which are not allowed. These operations are privileged
to the operating system.
In this case SAS is like a systemtrap or system call, which is handled
by the runtime system of EDU-50 or TSS-8.
Parameters for this sys-call is the address of COUNT which has to be
loaded in AC. The second parameter is the word behind COUNT, the pointer
to the string itself.
Subroutines on PDP-8s and similar machines without stackpointer are
often programmed in a way that they have two or more exit points.
The first is the address directly behind the JMS or in this case the
SAS instruction, which jumps back to 0201, the other exit is the
next address, in this example the HLT at 204.
Note, that this SYS-call probably changes both, the COUNT and PTR as
well, so that this program probably will work only one time after
loading, if you don't reinialize them both.
On 13.04.21 15:24, David Meyer wrote:
> I also figured out how to print an array of characters from memory with the SAS operator. Character literals make it a little easier to input strings in the source:
> /JOANNES I:I - IN PRINCIPIO ERAT VERBUM
> /VERB3 - PRINT FROM MEMORY WITH SAS
> 0200 7200 CLA
> 0201 1377 TAD (COUNT)
> 0202 6040 SAS
> 0203 5201 JMP .-2
> 0204 7402 HLT
> 0205 7746 COUNT, -32 /CHAR. COUNT * -1
> 0206 0206 PTR, . /ADDR. OF STR. - 1
> 0207 0311 STRING, "I;
> 0210 0316 "N;
> 0211 0240 " ;
> 0212 0320 "P;
> 0213 0322 "R;
> 0214 0311 "I;
> 0215 0316 "N;