mirror of
https://github.com/PDP-10/its.git
synced 2026-01-11 23:53:12 +00:00
Hello world for PALX and 11SIM.
This commit is contained in:
parent
6deada6e8f
commit
4715324ee9
39
src/hello/hello.palx
Normal file
39
src/hello/hello.palx
Normal file
@ -0,0 +1,39 @@
|
||||
;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
|
||||
Loading…
x
Reference in New Issue
Block a user