.title TALKER $iodef TT_iosb_in: .blkq 1 TT_iosb_out: .blkq 1 TT_chan: .blkw 1 TT_device: .ascid /sys$command/ pt_iosb_in: .blkq 1 pt_iosb_out: .blkq 1 pt_chan: .blkw 1 pt_device: .ascid /pseudo/ send_buffer: .blkb 1 receive_buffer: .blkb 512 .entry talker,^m<> $assign_s - devnam=tt_device,- chan=tt_chan if then ret endif $assign_s - devnam=pt_device,- chan=pt_chan if then ret endif $qio_s - chan=pt_chan,- func=#,- iosb=pt_iosb_in,- astadr=pt_ast,- p1=receive_buffer,- p2=#1 ; Hang a read with AST on pseudo if then ret endif $qio_s - chan=tt_chan,- func=#,- iosb=tt_iosb_in,- astadr=tt_ast,- p1=send_buffer,- p2=#1 ; Hang read with AST on terminal if then ret endif $hiber_s ; Go to sleep while AST's do the work ret ; All done if we wake up. .entry tt_ast,^m<> ; Here when terminal has something to say if then movzwl tt_iosb_in,r0 $exit_s r0 endif if then $wake_s ret endif $qio_s - chan=pt_chan,- func=#io$_writevblk,- iosb=pt_iosb_out,- p1=send_buffer,- p2=#1 if then $exit_s r0 endif $qio_s - chan=tt_chan,- func=#,- iosb=tt_iosb_in,- astadr=tt_ast,- p1=send_buffer,- p2=#1 ; Hang read with AST on terminal if then ret endif ret .entry pt_ast,^m<> ; Here when pseudo device says something if then movzwl pt_iosb_in,r1 $exit_s r1 endif addw3 pt_iosb_in+2,pt_iosb_in+6,r1 ; Compute record length movzwl r1,r1 $qio_s - ; Write pseudo's data to term chan=tt_chan,- func=#,- iosb=tt_iosb_out,- p1=receive_buffer,- p2=r1 if then $exit_s r0 endif $qio_s - chan=pt_chan,- func=#,- iosb=pt_iosb_in,- astadr=pt_ast,- p1=receive_buffer,- p2=#1 ; Hang a read with AST if then $exit_s r0 endif ret .end talker