MACRO-10
MACRO-10is anassembly languagewith extensivemacrofacilities forDEC'sPDP-10-basedMainframe computersystems, theDECsystem-10and theDECSYSTEM-20.MACRO-10 is implemented as atwo-pass assembler.
Programming examples
[edit]A simple "Hello, world!"program in MACRO-10 assembler, to run underTOPS-10,adapted from a specimen in a large collection of "Hello World" programs in various languages:[1]
TITLEHELLOWORLD
;'Hello world' in MACRO-10 for TOPS-10
SEARCHUUOSYM;Make UUO symbol names available
LAB:ASCIZ/Hello,world!
/;NUL-terminated ASCII string with CRLF
START:RESET;Initialise job to clean runtime state
OUTPUT:OUTSTRLAB;Output string starting at LAB:
MONRT.;Return to monitor
JRSTOUTPUT;Restart at OUTPUT: if user CONTINUEs job
ENDSTART;End assembly, set program start address
If this program is saved in the fileHELLO.MAC,it can be assembled, linked and run like this (the TOPS-10 system prompt is the.
at the start of lines):
.COMPILEHELLO.MAC/DLIST
MACRO:HELLO
EXIT
.LOADHELLO
LINK:Loading
EXIT
.SAVE
HELLOsaved
.RUN
Hello,world!
.
The assembly listing file generated by the/DLIST
(Disk LISTing) option to theCOMPILE
command:
HELLOWORLDMACRO%53B(1247)17:297-Apr-:9Page1
HELLOMAC7-Apr-:917:29
TITLEHELLOWORLD
;'Hello world' in MACRO-10 for TOPS-10
SEARCHUUOSYM;Make UUO symbol names available
000000'110145154154157LAB:ASCIZ/Hello,world!
000001'054040167157162
000002'154144041015012/;NUL-terminated ASCII string with CRLF
000003'000000000000000
000004'04700000000000START:RESET;Initialise job to clean runtime state
000005'05103000000000'OUTPUT:OUTSTRLAB;Output string starting at LAB:
000006'04701000000012MONRT.;Return to monitor
000007'25400000000005'JRSTOUTPUT;Restart at OUTPUT: if user CONTINUEs job
000004'ENDSTART;End assembly, set program start address
NOERRORSDETECTED
PROGRAMBREAKIS000010
CPUTIMEUSED58:25.100
36PCOREUSED
HELLOWORLDMACRO%53B(1247)17:297-Apr-:9PageS-1
HELLOMAC7-Apr-:917:29SYMBOLTABLE
LAB000000'
MONRT.047040000012
OUTPUT000005'
OUTSTR051140000000
RESET047000000000
START000004'
The date ":9" is aYear 2000 problem. A more complex MACRO-10 example program, which renders one version of the99 Bottles of Beersong, may be examined at the "99 Bottles of Beer" web site.[2]
For larger bodies of code, much of the MACRO-10 code for the TOPS-10 and TOPS-20 systems is available in the Trailing Edge PDP-10 tape archives.[3]
References
[edit]- ^Wolfram Rösler,"The Hello World Collection".Retrieved on 16 November 2016.
- ^"99 Bottles of Beer"Retrieved on 10 April 2009.
- ^Trailing Edge PDP-10 software archive
External links
[edit]- DECsystem-10 Macro Assembler Reference Manual(PDF).Maynard, Massachusetts: Digital Equipment Corporation. April 1978.Retrieved2010-07-08.
- Singer, Michael (1978).Introduction to DECsystem-10 Assembler Language Programming.New York: John Wiley & Sons. p. 145.ISBN0-471-03458-4.
- Gorin, Ralph E (1981).Introduction to DECSYSTEM-20 Assembly Language Programming.Bedford, Massachusetts: Digital Press. p. 539.ISBN0-932376-12-6.