.title terminalqio Perform Terminal Qio .ident /V1.0/ ; ; Author: Rodrick A. Eldridge ; 104 Computer Science ; Iowa State University ; Ames, Iowa 50011 ; (515) 294-5659 ; ; Created: April 1986 ; ; Description: This module contains a set of routines for performing ; qios to the terminal. ; ; Format: external module terminal_qio ; ; external module get - ; ; external module get_string - ; ; ; external module put_ln ; external module put - ; ; external module put_string - ; ; global module terminal_qio - psect=terminal_qio const $dscdef ; descriptor definitions $iodef ; i/o definitions max_length = 512 var tt_chan: .blkw 1 tt_func: .blkw 1 tt_iosb: .blkw 1 tt_length: .blkw 1 .blkl 1 tt_cr_lf: .byte 13,10 tt_name: .ascid /TT:/ tt_char: .blkb 1 tt_prompt: .blkb max_length tt_string: .blkb max_length begin ; assign channel to terminal $assign_s chan=tt_chan,- devnam=tt_name return end global module get - psect=terminal_qio - mask= begin if eql then terminal_qio if then return end end if eql then movl #io$_readvblk,tt_func if neq then addw @get.flag(ap),tt_func end $qiow_s chan=tt_chan,- func=tt_func,- iosb=tt_iosb,- p1=tt_char,p2=#1 else movl #io$_readprompt,tt_func if neq then addw @get.flag(ap),tt_func end movq @get.prompt(ap),r6 ; r6=prompt length, r7=address movc5 r6,(r7),#^a/ /,#max_length,tt_prompt movw r6,tt_length $qiow_s chan=tt_chan,- func=tt_func,- iosb=tt_iosb,- p1=tt_char,p2=#1,- p3=#tt_prompt,p4=#tt_length end if then movzwl tt_iosb,r0 if then return end end movb tt_char,@get.char(ap) ; return character return end global module get_string - psect=terminal_qio - mask= begin if eql then terminal_qio if then return end end if eql then movl #io$_readvblk,tt_func if neq then addw @get_string.flag(ap),tt_func end $qiow_s chan=tt_chan,- func=tt_func,- iosb=tt_iosb,- p1=tt_string,p2=#max_length else movl #io$_readprompt,tt_func if neq then addw @get_string.flag(ap),tt_func end movq @get_string.prompt(ap),r6 ; r6=prompt length, r7=address movc5 r6,(r7),#^a/ /,#max_length,tt_prompt movw r6,tt_length $qiow_s chan=tt_chan,- func=tt_func,- iosb=tt_iosb,- p1=tt_string,p2=#max_length,- p3=#tt_prompt,p4=#tt_length end if then movzwl tt_iosb,r0 if then return end end movq @get_string.descr(ap),r6 ; r6=string length, r7=address movc5 tt_length,tt_string,#^a/ /,r6,(r7) return end global module put_ln - psect=terminal_qio begin ; put carriage control and line feed to terminal if eql then terminal_qio if then return end end $qiow_s chan=tt_chan,- func=#io$_writevblk!io$m_noformat,- iosb=tt_iosb,- p1=tt_cr_lf,p2=#2 if then movzwl tt_iosb,r0 end return end global module put - psect=terminal_qio begin ; put a character to the terminal if eql then terminal_qio if then return end end movb @put.char(ap),tt_char movl #io$_writevblk,tt_func if neq then addw @put.flag(ap),tt_func end $qiow_s chan=tt_chan,- func=tt_func,- iosb=tt_iosb,- p1=tt_char,p2=#1 if then movzwl tt_iosb,r0 end return end global module put_string - psect=terminal_qio - mask= begin ; put a string to the terminal if eql then terminal_qio if then return end end movq @put_string.descr(ap),r6 ; r6=string length, r7=address movc5 r6,(r7),#^a/ /,#max_length,tt_string movw r6,tt_length movl #io$_writevblk,tt_func if neq then addw @put_string.flag(ap),tt_func end $qiow_s chan=tt_chan,- func=tt_func,- iosb=tt_iosb,- p1=tt_string,p2=tt_length if then movzwl tt_iosb,r0 end return end .end