A complete
"Hello, World!" program in PDP-11 macro assembler, to run under
RT-11: .TITLE HELLO WORLD .MCALL .TTYOUT,.EXIT HELLO:: MOV #MSG,R1 ;STARTING ADDRESS OF STRING 1$: MOVB (R1)+,R0 ;FETCH NEXT CHARACTER BEQ DONE ;IF ZERO, EXIT LOOP .TTYOUT ;OTHERWISE PRINT IT BR 1$ ;REPEAT LOOP DONE: .EXIT MSG: .ASCIZ /Hello, world!/ .END HELLO The .MCALL pseudo-op warns the assembler that the code will be using the .TTYOUT and .EXIT macros. The .TTYOUT and .EXIT macros are defined in the standard system macro library to expand to the EMT instructions to call the RT-11 monitor to perform the requested functions. If this file is , the RT-11
commands to assemble, link and run (with console output shown) are as follows: .MACRO HELLO ERRORS DETECTED: 0 .LINK HELLO .R HELLO Hello, world! . (The RT-11 command prompt is ".") For a more complicated example of MACRO-11 code, two examples chosen at random are Kevin Murrell's KPUN.MAC, or Farba Research's JULIAN routine. More extensive libraries of PDP-11 code can be found in the Metalab freeware and Trailing Edge archives. ==References==