; THIS PROGRAM SEARCHS THE JOB TABLE FOR THE USER'S JOB AND RETURNS THE LINE
; NUMBER IN THE TABLE OF THE USER'S JOB.  SYNTAX FOR CALLING FROM BASIC IS
;               XCALL USERNO,FFFF
; WHERE FFFF IS A FLOATING POINT NUMBER.
;       WRITTEN BY ROBERT KURZ, 1547 CHERRYWOOD DRIVE, MARTINEZ, CA 94553
;       DONATED BY ROBERT KURZ & DOUG SHAKER
;
SEARCH SYS
SEARCH SYSSYM

OBJNAM USERNO.SBR

USERNO: PHDR    -1,0,PH$REE!PH$REU      ; Re-entrant and re-usable
       CMPW    (A3)+,#1                ; number of arguments must be 1
       BNE     SYNTAX
       MOVW    (A3)+,D5                ; type of argument
       ANDW    #6,D5                   ; mask off junk
       CMPW    D5,#4                   ; must be floating point
       BNE     SYNTAX
       MOV     (A3)+,A2                ; address of variable
       JOBIDX  A1                      ; get the address of our job
       MOV     JOBTBL,A0               ; get the address of the jobtable
       CLR     D1
LOOP:   INC     D1                      ; increment job number
       CMP     A1,(A0)+                ; compare this entry to our job
       BNE   LOOP                    ; if not the same try the next one
       FLTOF   D1,@A2                  ; convert to floating point
       RTN                             ; all done
SYNTAX: TYPECR  <XCALL USERNO must have one floating point argument>
       RTN
END