.TITLE PUTTXT .ident /000001/ ;25-Jul-79 Original .ENABL LC .LIST BEX,MEB ; ; PUTTXT output a line of text. ; ; Calling sequence: ; ; MOV #COUNT,-(SP) ;Number of bytes to output ; MOV #BUFFER,-(SP) ;Buffer to output ; MOV #FDB,R0 ;File data block ; CALL PUTTXT ;Do the routine ; BIT (SP)+,(SP)+ ;Clear the stack ; BCS ERROR ;Error sets C-bit ; ; Return: all registers preserved. ; ; ; Edit history: ; 000001 25-Jul-79 MM Original edit ; BUFFER = 20 ;Buffer location on stack COUNT = 22 ;Byte count location on stack CR = 15 ;Carriage return LF = 12 ;Line feed ; ; Note that this routine assembles differently if RSX is set to 1 ; .IIF NDF RSX RSX = 0 ;Presuppose RT11 ; .IF NE RSX .MCALL PUT$S ; .IFTF PUTTXT:: .IFT PUT$S R0,2(SP),4(SP) ;I/O request RTS PC ;And exit .IFF .GLOBL SAVREG .GLOBL PUTC0 JSR R5,SAVREG ;Save registers R1-R5 MOV SP,R5 ;Establish Stack marker for error exit MOV R0,R1 ;R1 -> FDB MOV BUFFER(SP),R2 ;R2 -> Buffer MOV COUNT(SP),R3 ;R3 := Byte count BEQ 20$ ;Jump if it's a blank line ; 10$: MOVB (R2)+,R0 ;Get byte to output JSR PC,PUTC0 ;And do it DEC R3 ;Count it as done BGT 10$ ;Do some more ; 20$: MOV #CR,R0 ;End of line is JSR PC,PUTC0 ;terminated by MOV #LF,R0 ;A carriage-return JSR PC,PUTC0 ;Line-feed sequence RTS PC ;And then exit .ENDC .END