.title flush Flush the output buffer .ident "V02.00" ;+ ; Index Flush the output buffer ; ; Usage ; ; flush(); ; ; Description ; ; flush() will force the internal output buffer to be flushed. ; This function actually issues the QIO for all of the terminal ; I/O functions in the CS library. It returns 0 if an error occurs ; and 1 if successful. ;- ; Edit History ; 18-Oct-82 TTC Rework of CS library ; .psect c$code flush:: mov $$bptr,r1 ; r1 --> end of buffer sub $$bbeg,r1 ; r1 = size of buffer beq 10$ ; If zero length, return mov $$bbeg,$$bptr ; Reinitialize buffer pointer mov #IO.WAL,ttqio+q.iofn ; Function: IO.WAL mov #ttqio+q.iopl,r0 ; r0 --> qio param list for prmclr call prmclr ; Clear qio parameters mov #ttqio+q.iopl,r0 ; r0 --> qio param list mov $$bbeg,(r0)+ ; Parameter #1: I/O Buffer address mov r1,(r0)+ ; Parameter #2: Message length mov #0,(r0)+ ; Parameter #3: Vertical format control mov #ttqio,r0 ; r0 -> ttqio address for xqiow call .xqiow ; Execute qio cmp $dsw,#is.suc ; How'd things go? blo 20$ ; Bad cmpb t.iosb,#is.suc bne 20$ 10$: mov #1,r0 ; All ok, r0 = 1 return 20$: clr r0 ; Error, r0 = 0 return .end