.title buffer routines ; VERB Version 1.0 June 1st, 1985 ; Written by Joe Meadows Jr., with thanks to the ; Fred Hutchinson Cancer Research Center for kindly ; allowing me to use their computing resources. ; ; If you have any questions, comments, ideas, or ; whatever, feel free to contact me via US Mail : ; Joe Meadows Jr. ; 4841 268th Ave. N.E. ; Redmond Wa. 98052 ; or via phone : (206) 827-7296 .psect _clex_local rd,wrt,noexe _clex_desc:: _clex_pos:: .long .long _clex_buffer _clex_buffer: .blkb 512 .psect _clex_code rd,nowrt,exe .entry put_output,0 tstl _clex_pos ; is there really anything to output? beql 5$ ; don't bother to output empty line pushaq _clex_desc calls #1,@clex_output ; output the buffer blbc r0,10$ clrl _clex_pos ; clear the buffer, if successfully output 5$: movl #1,r0 10$: ret .entry add_to_buffer,^m ; 4(ap) = pointer to ascic movl 4(ap),r4 movzbl (r4),r5 incl r4 brb _add_buffer .entry add_to_buffer_trunc,^m ; 4(ap) = pointer to ascic ; 8(ap) = length to truncate to movl 4(ap),r4 movzbl (r4),r5 incl r4 cmpl r5,8(ap) blss _add_buffer movl 8(ap),r5 _add_buffer: subl3 _clex_pos,clex_width,r2 cmpl r5,r2 bleq 20$ calls #0,put_output ; output string if it whats to be added wont fit blbc r0,30$ brb _add_buffer 20$: movl _clex_pos,r3 addl r5,_clex_pos movc3 r5,(r4),_clex_buffer(r3) movl #1,r0 30$: ret .end