User Tools

Site Tools


tops-20

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
tops-20 [2020/05/06 23:08]
smj
tops-20 [2020/07/13 10:36] (current)
setala Added a missing @
Line 33: Line 33:
 **PROGRAMMING EXAMPLES USING "COMPILE", "LOAD" and "SAVE" COMMANDS** **PROGRAMMING EXAMPLES USING "COMPILE", "LOAD" and "SAVE" COMMANDS**
  
-TOPS-20 supports many programming languages using a standard COMPILE/LOAD/SAVE model.  Here are few simple examples to get started:+TOPS-20 supports many programming languages using a standard COMPILE/LOAD/SAVE model.  TOPS-20 is very helpful using command recognition and DWIM (Do What I Mean) without having to completely type out everything.  Here are few simple examples to get started:
  
 **FORTRAN-77** **FORTRAN-77**
Line 39: Line 39:
 //NOTE: This formatting is punched card style - The first 5 and 6th columns are special// //NOTE: This formatting is punched card style - The first 5 and 6th columns are special//
  
-      @copy TTY: test.for+      @copy TTY: test.for                             ;A simple way to enter in TEXT from the terminal
        TTY: => TEST.FOR.1        TTY: => TEST.FOR.1
              
-               PROGRAM TEST+               PROGRAM TEST                           ;Declare the name of the program
              
-               WRITE (5, 10) +               WRITE (5, 10)                          ;OUTPUT to the terminal (UNIT 5) at line 10 
-      10       FORMAT(' TESTING 1 2 3!')+      10       FORMAT(' TESTING 1 2 3!'             ;FORMAT the text for OUTPUT
              
-             END +               END                                    ;END the program 
-      ^Z +      ^Z                                              ;CTRL-Z closes the file 
-      @type test.for+      @type test.for                                  ;TYPE the test.for file and verify
                PROGRAM TEST                PROGRAM TEST
              
-             WRITE (5, 10)+               WRITE (5, 10)
       10       FORMAT(' TESTING 1 2 3!')       10       FORMAT(' TESTING 1 2 3!')
                          
-             END +               END 
-      @compile test +      @compile test                                   ;COMPILE the file TEST 
-      FORTRAN: TEST +      FORTRAN: TEST                                   ;COMPILE determined TEST is a FORTRAN program 
-      TEST    +      TEST                                         ;TEST is now written out as a .REL file 
-      @load test+      @load test                                      ;LOAD the file (or EXECUTE TEST to LOAD and RUN)
       LINK: Loading       LINK: Loading
-      @save test+      @save test                                      ;SAVE the loaded program to a .EXE file
        TEST.EXE.1 Saved        TEST.EXE.1 Saved
       @v test.*       @v test.*
Line 71: Line 71:
                          
        Total of 8 pages in 3 files        Total of 8 pages in 3 files
 +       
 +       @<smj.fortran>test                             ;Run the .EXE file
 +       TESTING 1 2 3!
 +       CPU time 0.09   Elapsed time 0.19
 +
 +For an excellent summary to get started with FORTRAN on TOPS-20, check out
 +[[http://wiki.twenex.org/doku.php?id=tutorials:fortran]]
 +
 +**MACRO-20**
 +
 +MACRO is the assembler on TOPS-20.  Here is a simple example of a Hello World in MACRO
 +
 +       @COPY TTY:hello.mac                             ;A simple way to enter text into a file
 +       title hello                                      
 +       
 +       entry output
 +       search uuosym
 +       
 +       hello: asciz /Hello there.
 +       
 +       /
 +       output: outstr hello
 +        monrt.
 +        end output
 +       ^Z
 +       
 +       @type hello.mac
 +       title hello
 +       
 +       entry output
 +       search uuosym
 +       
 +       hello: asciz /Hello there.
 +       
 +       /
 +       output: outstr hello
 +        monrt.
 +        end output
 +       @compile hello
 +       MACRO: hello
 +       
 +       EXIT
 +       @load hello
 +       LINK: Loading
 +       @save hello
 +        HELLO.EXE.1 Saved
 +       @<smj>hello
 +       Hello there.
  
  
tops-20.1588806522.txt.gz · Last modified: 2020/05/06 23:08 by smj