;********************************************************************* ; ; MAILON.M68 - MAIL LOGON Routine ; ; Written by: Dave Heyliger - AMUS Staff ; ; Purpose: To inform system that YOU are on. Records up ; to 3 logon JOBs you happen to be on (3 JOBIDX's) ; ; Used: Upon startup via a "ONLINE.CMD" file in CMD: ; or with FORCE from AMOSL.INI ; ;********************************************************************* ; Edit History: ; ; Initials Name Company Name Phone ; ======== ====================== ==================== ============ ; MJS Michael Spalding Northview Labs 312-564-8181 ; ; ; Version Date Initials Description ; ======= =========== ======== ============================================== ; ; 1.1 13-Jan-87 MJS Grab user ID from GINDTA.SV (Alpha Base) if ; it exists. Don't display new mail message ; if no new mail exists. If GINDTA.SV is not ; found or user is not found in EMAIL.USR, ; manual entry of initials is requested. Don't ; check for new mail if AB user- an AB message ; will be displayed for each new message rec'd. ; This version should be compatable with non-AB ; systems. Use DO file E.DO included for ; AB startup command (specified in USER FILE). ; ; SEARCH SYS ;grab the regulars SEARCH SYSSYM SEARCH TRM ;define a version number VMAJOR=1. ;original program by ;Dave Heyliger - AMUS VMINOR=1. ; Update to support Alpha Base ; Michael Spalding- Northview Labs VSUB=0. VEDIT=0. PHDR -2,0,PH$REE!PH$REU ;may be run logged out .OFINI .OFDEF IDDB,D.DDB ;EMAIL.USR, EMAIL.DAT DDB .OFDEF SCRAP,20. ;scrap buffer area workspace .OFDEF MEMPTR,4 ;EMAIL.SYS memory location .OFDEF GINOK,1 ;MJS 1.1- GINDTA flag .OFSIZ IMPSIZ GETIMP IMPSIZ,A3 ;A3 points to variables ;point to EMAIL.SYS memory in system memory - A4 dedicated SCHSYS: LEA A2,SYSFIL ;point to ascii file LEA A0,SCRAP(A3) ;A0 points to buffer area FILNAM @A0 ;create filename SRCH @A0,A4 ;A4 will contain mem pointer BEQ SAVPTR ;search found EMAIL.USR TYPECR BYEBYE: EXIT ;get the users name (CR will prompt them again, ^C cancels prompt) SAVPTR: MOV A4,MEMPTR(A3) ;save memory pointer ;MJS v1.1 - Moved following code to PACKID label below ;SRCHOK: MOV MEMPTR(A3),A4 ;get memory pointer to A4 ; MOV #0,SCRAP(A3) ;clear name buffer ;MJS v1.1 - Changed to grab user name from GINDTA.SV (Alpha Base) ; Added following 5 lines and NOAB label below. SRCH GINDTA,A2,F.USR ; index GINDTA.SV module in user mem BNE NOAB ; not an AB user- go ask user for ID MOVB #1,GINOK(A3) ; flag to indicate GINDTA.SV found ADD #2276,A2 ; A2 points to the initials in GINDTA BR PACKID ; go pack it NOAB: CRLF ;screen junk TYPE ;prompt for user name KBD ;get it CTRLC BYEBYE ;^C quits (no EMAIL access) CMPB @A2,#15 ;just a cr? ;MJS v1.1 - Replace BEQ SRCHOK with BEQ NOAB ; BEQ SRCHOK ;yup, ask em again BEQ NOAB ;yup, ask em again PACKID: MOV MEMPTR(A3),A4 ;get memory pointer to A4 MOV #0,SCRAP(A3) ;clear name buffer LEA A1,SCRAP(A3) ;point to scrap buffer PACK ;create RAD50 handle PACK ;get the number of "blocks" to scan SCAN: MOV 508.(A4),D4 ;D4 contains block size MOV #20.,D3 ;number of users per block ;look for this guy LOOP: CMM SCRAP(A3),@A4 ;found a name? BNE NNF ;name not found ;found the user, point to the 3 IDX slots in the "bucket" PUSH A4 ;save location of user ADD #12.,A4 ;bypass passwrd etc. CMP @A4,#0 ;empty? BNE IDX2 ;nope, try next position ;slot open, insert JOBIDX INID: CALL GETIDX ;yup, get IDX in ;MJS 1.1 - Added following line to skip new message routine. User will ; automatically get an Alpha Base message for each EMAIL message they ; received since last logon. Changed JMP NEWMSG to JEQ NEWMSG. TSTB GINOK(A3) ; is this an AB user? JEQ NEWMSG ; no- see about new messages EXIT ;user already on one terminal, try next slot IDX2: ADD #4,A4 ;bypass IDX-1 CMP @A4,#0 ;empty? BNE IDX3 ;nope BR INID ;yup, place em in there ;user on two terminals, try next slot IDX3: ADD #4,A4 ;try next position CMP @A4,#0 ;empty? JNE FULIDX ;nope, IDX array full BR INID ;yup, place in IDX ;no name found in this "bucket" of the array, try next bucket NNF: DEC D3 ;one less user to scan BEQ NXTBLK ;0 = get next block ADD #24.,A4 ;bypass rest of goodies BR LOOP ;search again ;block has been searched - user not found. Get the next block NXTBLK: DEC D4 ;one less block JEQ ERR ;user not found, let em know ADD #56.,A4 ;weird number ;(24. for the user, 32. extra) MOV #20.,D3 ;20 users/block BR LOOP ;try searching again ;GETIDX Subroutine - gets user's IDX ; on entry: A4 points to slot in system memory where user will be placed ; on exit : user JOBIDX placed in system memory ;----------------------------------------------------------------------------- GETIDX: JOBIDX A6 MOV A6,@A4 RTN ;NEW MESSAGE Routine - see's if user has any new mail since last logon ; on entry: user's IDX was placed in system memory, A4 on stack ^ user ; on exit : user's new mail status displayed to screen, returned to "." ;-------------------------------------------------------------------------- NEWMSG: LEA A4,IDDB(A3) ;point to MOVW #[EMA],IDDB+D.FIL(A3) ;setup BOX:EMAIL.DAT MOVW #[IL ],IDDB+D.FIL+2(A3) MOVW #[DAT],IDDB+D.EXT(A3) MOVW #[DSK],IDDB+D.DEV(A3) MOVW #0,IDDB+D.DRV(A3) MOVW #3402,IDDB+D.PPN(A3) INIT @A4 ;create buffer space LOOKUP @A4 ;there? BEQ 10$ ;yup ;BOX:EMAIL.DAT not found! Bummer! CRLF ;nope MOV #7,D1 ;bell TTY ;beep TYPECR < ?EMAIL.DAT not found. Contact your SYSOP.> POP A4 ;adjust stack EXIT ;and quit 10$: POP A1 ;A1 points to user ADD #8.,A1 ;point to record number CLR D4 ;clear these guys CLR D3 MOVW IDDB+D.REC+2(A3),D4 ;get first block MOVW @A1,D3 ;get offset ADDW D3,D4 ;add to D4 MOVW D4,IDDB+D.REC+2(A3) ;set record number READ @A4 ;read in the users block ;now look 40 times for any new mail (null marks last msg slot) MOV IDDB+D.BUF(A3),A2 ;A2 point to the users block MOV #40,D4 ;counter of looks CLR D3 ;counter of new messages CNM: CMPW (A2)+,#1 ;new message? BNE NNM ;nope, don't count it INC D3 ;yup, count it NNM: ADD #4,A2 ;bypass message DEC D4 ;one less look BNE CNM ;if not 40. looks, look again ;messages counted, report info to user ;MJS v1.1 - Don't display if no messages (too depressing!). ; Added next 2 lines and DONE label. TST D3 ; any messages? JEQ DONE ; no- just exit SUB #8.,A1 ;point back to the name TYPE MOV D3,D1 ;get the number DCVT 0,OT$TRM ;type out the number CMP D3,#1 ;one new message? BEQ 10$ ;yup TYPE < new EMAIL messages, > ;nope, more than one BR 20$ ;bypass below 10$: TYPE < new EMAIL message, > 20$: LEA A2,SCRAP(A3) ;get some workspace PUSH A2 ;save start location UNPACK ;create the name UNPACK CLRB @A2 ;end name w/ null POP A2 ;retrieve start location TTYL @A2 ;type out the name CRLF ;return DONE: EXIT ;and quit ERR: TYPECR ;cant find this user CRLF ;crlf ;MJS v1.1 - JMP SRCHOK ;ask again JMP NOAB ;ask again ;user already on at least 3 JOBs FULIDX: CRLF ;return MOV #7,D1 ;get a bell TTY ;beep! TYPECR EXIT SYSFIL: ASCII /EMAIL.SYS/ EVEN GINDTA: RAD50 /GINDTASV/ EVEN END .