;Hello world for the PDP-11 cross assembler PALX, running in the 11SIM ;PDP-11 emulator. To assemble, type ; :CWD HELLO ; :PALX HELLO PALX ;To run, type ; :PDP11 ; ;L HELLO BIN ; ;G .TITLE HELLO R0=%0 R1=%1 SP=%6 PC=%7 TPS=177564 ;Console output status TPB=177566 ;Console output data .=1000 GO: MOV #STACK,SP ;Initialize stack pointer MOV #HELLO,R0 ;Point to start of string LOOP: MOVB (R0)+,R1 ;Get one character BEQ STOP ;Stop if zero JSR PC,TYO JMP LOOP STOP: HALT TYO: TSTB TPS ;Console ready for output? BPL TYO ;If not, check again MOV R1,TPB ;Send character RTS PC .=.+100 STACK: HELLO: .ASCIZ /Hello world! / .END GO