.TITLE USECHK - CHECK USERS VALIDITY .IDENT /1.0/ .ENABL LC ;+ ; ; Free software BY ; Project Software & Development, Inc. ; ; This software is furnished for free and may be used and copied as ; desired. This software or any other copies thereof may be provided or ; otherwise made available to any other person. No title to and ; ownership of the software is hereby transferred or allowed. ; ; The information in this software is subject to change without notice ; and should not be construed as a commitment by PROJECT SOFTWARE ; AND DEVELOPMENT, INC. ; ; PROJECT SOFTWARE assumes no responsibility for the use or reliability ; of this software on any equipment whatsoever. ; ; Project Software & Development, Inc. ; 14 Story St. ; Cambridge, Ma. 02138 ; 617-661-1444 ; ; ; Title: USECHK.MAC ; Author: Robin Miller ; Date: July 27, 1982 ; ; Description: ; ; This module contains the routines to validate a particular ; accounting entry before outputting the entry. ; ; ; Modification History: ; ;- .ENABL AMA .NLIST BEX .SBTTL CHKUIC - CHECK FOR VALID UIC NUMBER ;+ ; ; CHKUIC - Check for valid UIC number. ; ; If the user has specified a particular UIC number (B.UIC), this ; routine converts the ASCII UIC number to binary, and compares it ; with the specified UIC number to see if it is valid. ; ; Inputs: ; R0 = the binary UIC to check. ; R3 = the current account entry. ; ; Outputs: ; C bit clear/set = valid UIC/invalid UIC. ; ; All registers are preserved. ; ;- CHKUIC::CALL $SAVAL ; SAVE ALL REGISTERS MOV R3,R4 ; SAVE POINTER TO ENTRY ADD #A.GRP,R3 ; POINT TO THE ASCII GROUP MOV #3,R5 ; SIZE OF THE GROUP CALL COPY ; COPY THE ASCII GROUP CALL CONVRT ; CONVERT IT TO BINARY MOV R1,-(SP) ; SAVE THE GROUP NUMBER SWAB (SP) ; PUT GROUP IN HIGH BYTE MOV R4,R3 ; RESET THE ENTRY ADDRESS ADD #A.MBR,R3 ; POINT TO THE MEMBER MOV #3,R5 ; SIZE OF THE MEMBER CALL COPY ; COPY THE ASCII MEMBER CALL CONVRT ; CONVERT IT TO BINARY BISB R1,(SP) ; OR IN THE MEMBER NUMBER CMP (SP)+,R0 ; DO THE ENTRYS MATCH ? BEQ 100$ ; IF EQ, YES (SUCCESS) 90$: SEC ; NO, SHOW FAILURE RETURN 100$: CLC ; SHOW SUCCESS RETURN .SBTTL CHKUSE - CHECK FOR VALID USER NAME ;+ ; ; CHKUSE - Check for valid user name. ; ; If the user has specified a particular user name (B.USER), this ; routine compares it with both the first name and the last name ; for a match. A match on either first of last returns success. ; ; Inputs: ; R3 = the current account entry. ; ; Outputs: ; C bit clear/set = valid USER/invalid USER. ; ; All registers are preserved. ; ;- CHKUSE::CALL $SAVAL ; SAVE ALL REGISTERS BIT #B.USER,STATUS ; WAS A USER SPECIFIED ? BEQ 100$ ; IF EQ, NO (VALID ENTRY) MOV R3,R4 ; COPY THE ACCOUNT ENTRY ADD #A.LNM,R4 ; POINT TO THE LAST NAME MOV #USEBUF,R5 ; ADDRESS OF USER BUFFER CALL COMPAR ; DO THE COMPARE BCC 100$ ; IF CC, GOT A MATCH MOV R3,R4 ; COPY THE ACCOUNT ENTRY ADD #A.FNM,R4 ; POINT TO THE FIRST NAME MOV #USEBUF,R5 ; ADDRESS OF USER BUFFER CALL COMPAR ; DO THE COMPARE BCC 100$ ; IF CC, SUCCESS RETURN ; RETURN FAILURE 100$: CLC ; SHOW SUCCESS RETURN .SBTTL COMPAR - COMPARE TWO ASCII STRINGS ;+ ; ; COMPAR - Compare two ASCII strings. ; ; Inputs: ; R4 = address of first string. ; R5 = address of second string (terminated by NULL). ; ; Outputs: ; C bit clear/set = match/nomatch. ; ; Registers R4 and R5 are modified. ; ;- COMPAR::TSTB (R5) ; END OF SECOND STRING ? BEQ 100$ ; IF EQ, YES (SUCCESS) CMPB (R4)+,(R5)+ ; DO WE HAVE A MATCH ? BEQ COMPAR ; IF EQ, YES (LOOP) 90$: SEC ; SHOW FAILURE 100$: RETURN .SBTTL COPY - COPY CHARACTERS TO WORK BUFFER ;+ ; ; COPY - Copy characters to the work buffer. ; ; Inputs: ; R3 = the address to start copy from. ; R5 = the number of bytes to copy. ; ; Outputs: ; All registers are preserved. ; ;- COPY:: CALL $SAVAL ; SAVE ALL REGISTERS MOV #WRKBUF,R4 ; ADDRESS OF WORK BUFFER 10$: MOVB (R3)+,(R4)+ ; START THE COPY SOB R5,10$ ; LOOP UNTIL DONE CLRB (R4) ; TERMINATE WITH A NULL RETURN .SBTTL CONVRT - CONVERT OCTAL ASCII TO BINARY ;+ ; ; CONVRT - Convert octal ASCII to binary. ; ; Inputs: ; WRKBUF = the octal ASCII characters to convert. ; ; Outputs: ; R1 = the converted binary number. ; R2 = the terminating character. ; ; Registers R3 - R5 are preserved by $COTB. ; ;- CONVRT::MOV R0,-(SP) ; SAVE R0 MOV #WRKBUF,R0 ; ADDRESS OF ASCII BYTES CALL $COTB ; CONVERT OCTAL TO BINARY MOV (SP)+,R0 ; RESTORE R0 RETURN .END