Register a SA Forums Account here!
JOINING THE SA FORUMS WILL REMOVE THIS BIG AD, THE ANNOYING UNDERLINED ADS, AND STUPID INTERSTITIAL ADS!!!

You can: log in, read the tech support FAQ, or request your lost password. This dumb message (and those ads) will appear on every screen until you register! Get rid of this crap by registering your own SA Forums Account and joining roughly 150,000 Goons, for the one-time price of $9.95! We charge money because it costs us money per month for bills, and since we don't believe in showing ads to our users, we try to make the money back through forum registrations.
 
  • Locked thread
LongSack
Jan 17, 2003

Let's see some seriously old stuff here.

My contribution:

SPL (Systems Programming Language)

Architecture - HP/3000
Date - 1984

The HP/3000 minicomputers were a stack-based architecture with some special purpose registers:
  • S register = TOS (Top Of Stack)
  • Q register was current procedure relative, so that procedure parameters were stored at Q-4 ... Q-x and local variables were stored at Q+0 ... Q+y
  • DB register was Global procedure relative, so that global variables were stored at DB+x (and magic stuff only available to Privileged Mode code was stored at DB-x)

Memory was divided into 64K banks of 16-bit words (128K bytes). Code was relatively small since much of the functionality was encoded into Shared Libraries (SL).

SPL was an Algol-based language which had special features designed for writing low level code for the HP/3000 machines, like an "ASSEMBLE(...)" statement that allowed the emitting of assemble code.

Here is the code for a routine that would redefine the current process as a "System Process" which allowed some other things to happen (note that // is not a comment in SPL, I just use it here for readability):

code:
INTEGER PROCEDURE SETSYSPROC;							// declare subroutine
    OPTION PRIVILEGED;								// requires privileged mode
BEGIN
    PROCEDURE ERRORON; OPTION EXTERNAL;						// declare external routine
    ERRORON;									// call external routine
    ASSEMBLE (
                          LDXI 4;						// load 4 into index register	
                          PLDA;							// load from absolute address (4)
                          LDI %11;						// put %11 (9) on Top Of Stack (TOS)
                          LADD, STAX;						// add top 2 elements on stack and store result in index register
                          PLDA;							// load from absolute address
                          DUP, NOP;						// copy TOS
                          LDI 4;						// put 4 on TOS
                          DPF 6:3;						// deposit TOS value into TOS-1 bits 6:3
                          PSTA;							// store TOS value into absolute addreee
                          EXF 6:3;						// extract bits 6-8 from TOS
                          STOR Q-4;
    );										// store result in Q-4 (return value)
END;
Here is the routine to put it back:
code:
PROCEDURE RESETSYSPROC(INDEX);
    VALUE INDEX;									// INDEX is a value type
    INTEGER INDEX;									// INDEX is an integer
    OPTION PRIVILEGED;									// YES, this too requires privileged mode
BEGIN
    PROCEDURE ERROREXIT(SDEC,ERR,PARM);							// declare external routine
        VALUE SDEC, ERR, PARM;
        INTEGER SDEC, ERR, PARM;
        OPTION EXTERNAL;
BEGIN
    ASSEMBLE( 
                          LDXI 4;							// load 4 into index register
                          PLDA;								// load from absolute address
                          LDI %11;							// push 9 onto stack
                          LADD, STAX;							// add top 2 items on stack, and store result into index register
                          PLDA;								// load from absolute address
                          LOAD Q-4;							// load parameter 
                          DPF 6:3;							// deposit parameter into TOS bits 6 - 8
                          PSTA
    );											// store TOS into absolute address
    ERROREXIT(1,0,0);
END;
I started programming in 1979. I would ride my bike down to the local Radio Shack and play around with their computers, which were mainly assembled from kits. After high school, I went to school at Miami University in Oxford, Ohio. It was there I met my first "real" computers. The HP/3000 minicomputer taught me SPL (see above), APL (we had some hard-copy terminals with the APL character set) and BASIC. Further classes taught me Pascal, PL/I, and COBOL.

After transferring to Ohio State, I learned CLU and LISP.

So, fellow programming Goons, what is the oldest piece of code you still have around?

Adbot
ADBOT LOVES YOU

  • Locked thread