💾 Archived View for blitter.com › apl-books › apl.maxhost.org › apl-tops-20.txt captured on 2024-05-12 at 16:35:21.

View Raw

More Information

⬅️ Previous capture (2022-07-16)

-=-=-=-=-=-=-

Panda Distribution, PANDA TOPS-20 Monitor 7.1

APL-SF, Version 2.0

first run the klt20 script:

./klt20

GO
BOOT>/e
dbugsw/ 2         start system in normal mode
dbugsw/ 1         start system in stand-alone mode
147$g             ($ will appear when user hits ESC)

why reload? halt

CTRL C

@login operator     
password: DEC-20
@enable
terminal vt100

INFORMATION LOGICAL-NAMES EDITOR:
edit
ctrl-f, ctrl-h, ctrl-n, ctrl-p

cd system:

APLSF
terminal...tty

escape mode
-----------

@I10        displays numbers 1 to 10
@R          rho
@L          quad
@G          del
@H          ???
@E          epsilon
@D          floor
@J          jot

tty mode
--------

"THIS IS A COMMENT"
            comments are surrounded with double quotes

#           multiply
%           divide

.CE         ceiling
.CR         circle
.CS         back scan
.DA         drop
.DE         decode
.DM         diamond
.DQ         matrix divide
.EN         encode
.EP         epsilon
.FM         format
.GD         grade down
.GO         goto
.GU         grade up
.FL         floor
.FM         format
.IB         i-beam
.IO         index generator
.IQ         file input
.LE         less than or equal to
.LG         logarithm
.OQ         file output
.NE         not equal
.NG         negation (e.g. .NG1 means -1)
.NT         not
.OM         omega
.OR         or
.OU         out (escape from input mode)
.RO         rho
.RV         rotate
.SO         jot
.TR         transposition
.XQ         execute

,           concatenate

!4          factorial of 4

A _ .IO 4   assign numbers 1 to 4 to A

A _ 'WELCOME TO APL'

A _ 3 3 .RO .IO 9
            set A to 1 2 3
                     4 5 6
                     7 8 9

A _ .IO 10  A is set to 1 2 3 4 5 6 7 8 9 10
A[6]        returns 6
+/A         returns 55
-/A         returns -5
3^ A        3 take A returns gives the first 3 elements of A, i.e. 1 2 3

A @J.# A    returns the ten times table
(.IO 10) .SO.# (.IO 10)
            returns the ten times table

A _ 2 2 .RO .IO 4
.DQ A       gives matrix inverse

A _ .BX     evaluate input for A
            note the character input must be enclosed in single quotes

A _ .QQ     character input for A
            note that single quotes are not necessary here

A _ 'CAT'
'A' .EP A   is 'A' a member of A, returns 1

.RV A       reverse A

A _ .TR 2 3 .RO .IO 6
            A is assigned 1 4
                          2 5
                          3 6

.IB17       i-beam 17 reports information about the symbol table
.IB28       i-beam 28 returns 0 if APL char set or 1 if TTY char set

@LCHS 8     returns the file organization and open status of files
.BXCHS 8    same

.BXIO       displays origin
.BXAV       displays all characters (atomic vector)
.BXALPHA    displays all alphabetic characters
.BXALPHAU   displays underlined alphabetic characters
.BXASCII    display all ascii characters
.BXASCII[59]
            outputs : (colon)
.BXTS       display date and time
.BXTT       display terminal type

.BXCR 'PRIMEN'
            display canonical representation of function PRIMEN, line numbers are not listed
@LCR 'PRIMEN'
            same

.BXASS 'TEST/AS'

.FM .BXTS [1 2 3]
            display date

NLIST _ 'B' .BXNL 2
            store list of variables starting with B
.BXEX NLIST
            delete all variables starting with B

)WSID
)OFF        log off
)OFF HOLD   log off aplsf only

)CHARGE     displays a record of activity

)ERASE FILE
            erases workspace file

)SAVE FILE  save workspace to file (system automatically suffixes file with .apl)

)WIDTH      displays current width, default is 132

)ORIGIN     displays origin
)ORIGIN 0   sets origin to 0, also )OR 0 
  
)CLEAR      clear workspace
)VARS       list all variables

)VERSION    displays version of APLSF

)MON        exit to monitor

)LIB	    list all workspace names
)LIB /B     show blocks

)SIZE       displays size of the currently active workspace

)MAXCORE
)MINCORE

)OWNER

)SIZE       return size of active workspace

)OUTPUT PRIME1
            divert output to file prime1.aas

CTRL E CEASE NOW
[Confirm]	hit return 
CTRL \ SHUT
CTRL \ QUIT

control codes
-------------

ctrl-h      deletes a character
ctrl-u      blanks out entire line

tops-20 commands
----------------

note that tops-20 commands are not case sensitive

teco        text editor
edit        text editor
emacs       text editor

cat file    display file
pwd
help *      gives complete list of topics

find        exit quits program

ctrl-f      command completion

ls sys:     list files in system directory
ls -l       list files in long form

cd          changes to HOME directory
cd C:       changes to the include directory
cd FUN:     changes to the games directory
cd DOC:     changes to the documentation directory
cd TOPS20:<UNSUPPORTED>
            changes to the unsupported directory
cd TOPS20:<GIGI>
            changes to gigi directory

env         display environment

i term      display terminal parameters

terminal vt100
            set terminal to vt100
terminal width 132
            set terminal width to 132

systat      system status

information logical-names system (info log sys)
            display info on logical-names (similar to env on unix)

clisp       runs Uppsala Common Lisp

date        display date and time

delete file 
            erase file

define WORK: /tops20/operator

dir <*>*.c
            locate all *.c files
dir TOPS20:<BLISS-SOURCES>
            list the bliss sources

submit test.ctl

libary      editor for creating, maintaining, and listing COBOL library files

logout      log off system

od -x file  hexdump file

scribe      a document-formatting program

languages 
---------

basic, bliss, C, fortran, cobol, aplsf

observations
------------

unprintable characters are displayed as .SQ or squish quad

missing
-------

.SS and .UU don't work

function examples
-----------------

note that clipboarding only seems to work with pristine workspaces

@G TEST
  'THIS IS A TEST'
@G

@G M _ MULTI R
  A _ .IO R
  M _ A @J.# A
@G

@G P _ IDENTITY R
  "GENERATE THE IDENTITY MATRIX"
  P _ (.IOR) .SO.= .IOR
@G

@G RISING[@L]@G   list function rising

@G TEST
[@H2]@G           delete line 2 within function test

@G TEST
[0.BX]        
TESTING
@G                change function header of test to testing

example of labels and goto:

.DL   TEST        
[1]   "THIS IS A TEST"
[2]    .GO L1
[3]   "TEST"
[4]   "TEST"
[5]   L1:'BONK!'

.DL   F_X RISING Y
"compute the rising factorial"
F_#/((.IO Y)+(X-1))
.DL

function that returns an explicit result:

@G A _ TEST X
[1]   A _ 2 # X
[2]   @G

.DL   R_PRIMEI X
[1]    P_ 2 3
[2]   L1:.GO (X.LE .RO P)/L3
[3]    R_.NG1^P
[4]   L2:.GO (0=P.AB R_R+2)/L2
[5]    P_P,R
[6]    .GO L1
[7]   L3:R_X.RO P
    .DL

.RO PRIME 100    returns 100 (the shape of vector returned by primei)

function with local variables:

   .DL   T_PRIMEN N;W;B;K
[1]   "DISPLAY PRIME NUMBERS UP TO N"
[2]    K_.FL N*0.5
[3]    V_1+2#.IO .FL (N-1)%2
[4]    T_2
[5]   LP:B_V[1]
[6]    T_T,B
[7]    V_(.NT 0=B.AB V)/V
[8]    .GO (B<K)/LP
[9]    T_T,V
    .DL

create a function to list function primei

 @G LIST
[1]   .XQ '@G PRIMEN[.BX]@G'
[2]   @G


[5.BX]     list line 5
[.BX5]     list from line 5 to end
[5.BX0]    extend line 5