;       LFORCE.SBR
;       VER 1.0         8611.00
;       
;       ALLOWS USER TO FORCE A LINE OF INFO AS
;       ANOTHER USERS OUTPUT BUFFER
;
;       PROPRIETARY PROGRAM MATERIAL
;
;       THIS MATERIAL IS THE PROPERTY OF JEFF STUYVESANT,
;       12307 PACIFIC AVE, APT 2,MAR VISTA, CALIF. ,90066
;       PERMISSION TO COPY AND USE IS GRANTED FOR 
;       NON-PROFIT USES ONLY.
;
;       Copyright (c) 1986 JEFF STUYVESANT


        SEARCH  SYS
        SEARCH  SYSSYM
        SEARCH  TRM
        
        OBJNAM .SBR

        RADIX 8.
        

VMAJOR  =       1.
VMINOR  =       0.
VSUB    =       0.
VEDIT   =       0.
VWHO    =       0.

;EQUATES
        T%NAM   =4

        A%TNAM  =4
        A%STR   =16

        O%TYPE  =-2
        O%LEN   =4

        PHDR    -1,0,PH$REE!PH$REU

; BASIC PARAMETER MEMORY LAYOUT

;       BASE:   ; 0(A3)         PARAMETERS IN LIST (TOTAL)
                                
        ; TERMINAL NAME
;       TYPE    ; 2(A3)         FIRST PARAMETER
;       ABS ADR ; 4(A3)         
;       LEN     ;10(A3)         
                                
        ; STRING                
;       TYPE    ;14(A3)         SECOND
;       ABS ADR ;16(A3)         
;       LEN     ;22(A3)         


        CMPW    @A3,#2                  ; check for only two vars
        BNE     1$

        CMP     A%TNAM+O%LEN(A3),#6     ; check for name length
        BNE     USAGE

        CMPW    A%TNAM+O%TYPE(A3),#2    ; check for name type
        BNE     USAGE

        CMPW    A%STR+O%TYPE(A3),#2     ; check for string type
1$:     BNE     USAGE
 
        MOV     A%TNAM(A3),A2           ; get addr of term name
        FILNAM  @A4,XXX                 ; set job name packed into free memory
        BEQ     USAGE
        MOV     TRMDFC,A5               ; point to first trm control block
2$:     
        CMM     T%NAM(A5),@A4           ; names match?
        BEQ     5$                      ;   NO  - keep looking
        MOV     @A5,A5                  ; POINT TO NEXT
        BEQ     3$                      ; if zero ain't no moor
        BR      2$                      ;   YES - done looking
3$:     CRLF
        TYPECR  <? Terminal not found.>
        BR      SLEEP
        

5$:     ; GET HERE WITH TRMDEF POINTER
        ADD     #10,A5                  ; point to TCB
        MOV     A%STR(A3),A0            ; get string pointer
        ; A2 POINTS TO OUT MESSAGE

        MOV     #-1,D3                  ; preset counter
100$:   INC     D3                      ; inc counter
        CMPB    (A0)+,#0.               ; at end of line?
        BNE     100$                    ; br if not

        MOV     A%STR(A3),D1            ; set up for TRMBFQ

        JLOCK                           ; LOCK SYSTEM insure whole message
        
        TRMBFQ                          ; send message
        
        JUNLOK                          ; UNLOCK system
        RTN                             ; back to basic

USAGE:  TYPECR  <USAGE: XCALL LFORCE Termname,String>
SLEEP:  SLEEP   300                     ; insure message is seen
        RTN                             ; back to basic


        END