; in simh: ; simh> set console telnet=3333 ; then invoke telnet to port 3333 on the simh systm ; simh> load test.bin ; simh> run ; initialize stack pointer start: MOV #1000, R6 ; store pointer to text in R0 loop: MOV #text, R0 CALL printstart JMP loop ; store copy of R0 on the stack printstart: MOV R0,-(SP) ; string ends with 0x00 print: TSTB (R0) BEQ pdone ; put character in tty buffer MOVB (R0), @#TTYTX ; wait for it to be transmitted waittx: TSTB @#TTYST BPL waittx INC R0 JMP print ; retrieve stored r0 from stack pdone: MOV (SP)+,R0 RET make_raw text: .ASCII "test\r\n\x00" TTYST = 177564 TTYTX = 177566