MACRO-10 is anassembly language with extensivemacro facilities forDEC'sPDP-10-basedMainframe computer systems, theDECsystem-10 and theDECSYSTEM-20. MACRO-10 is implemented as atwo-pass assembler.
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-10SEARCHUUOSYM; Make UUO symbol names availableLAB:ASCIZ/Hello,world!/; NUL-terminated ASCII string with CRLFSTART:RESET; Initialise job to clean runtime stateOUTPUT:OUTSTRLAB; Output string starting at LAB:MONRT.; Return to monitorJRSTOUTPUT; Restart at OUTPUT: if user CONTINUEs jobENDSTART; 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/DLISTMACRO:HELLOEXIT.LOADHELLOLINK:LoadingEXIT.SAVEHELLOsaved.RUNHello,world!.
The assembly listing file generated by the/DLIST
(Disk LISTing) option to theCOMPILE
command:
HELLOWORLDMACRO%53B(1247)17:297-Apr-:9Page1HELLOMAC7-Apr-:917:29TITLEHELLOWORLD; 'Hello world' in MACRO-10 for TOPS-10SEARCHUUOSYM; Make UUO symbol names available000000'110145154154157LAB:ASCIZ/Hello,world!000001'054040167157162000002'154144041015012/; NUL-terminated ASCII string with CRLF000003'000000000000000000004'04700000000000START:RESET; Initialise job to clean runtime state000005'05103000000000'OUTPUT:OUTSTRLAB; Output string starting at LAB:000006'04701000000012MONRT.; Return to monitor000007'25400000000005'JRSTOUTPUT; Restart at OUTPUT: if user CONTINUEs job000004'ENDSTART; End assembly, set program start addressNOERRORSDETECTEDPROGRAMBREAKIS000010CPUTIMEUSED58:25.10036PCOREUSEDHELLOWORLDMACRO%53B(1247)17:297-Apr-:9PageS-1HELLOMAC7-Apr-:917:29SYMBOLTABLELAB000000'MONRT.047040000012OUTPUT000005'OUTSTR051140000000RESET047000000000START000004'
The date ":9" is aYear 2000 problem.A more complex MACRO-10 example program, which renders one version of the99 Bottles of Beer song, 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]