;******************************************************************
;
;MALINI.M68 - Mail Initialization (run at bootup)
;
; Written by: Dave Heyliger - AMUS Staff
;
; Purpose: fills EMAIL.SYS with user information. EMAIL.SYS
; should be located in system memory.
;
; Used: On bootup via AMOSL.INI. Place this command in
; AMOSL.INI after the last SYSTEM command line.
;
;******************************************************************
SEARCH SYS ;get the usuals
SEARCH SYSSYM
SEARCH TRM
VMAJOR=1. ;Original program by
VMINOR=0. ;Dave Heyliger - AMUS
VEDIT=0.
;look for DSK0:EMAIL.SYS in system memory - A1 points to it
GOTFIL: LEA A2,SYSFIL ;point to ascii file
LEA A0,SCRAP(A3) ;A0 points to buffer area
FILNAM @A0 ;create filename
SRCH @A0,A1 ;A1 will contain mem pointer
BEQ SRCHOK ;search found EMAIL.USR
TYPECR < ?EMAIL.SYS not found>
EXIT
;found EMAIL.USR, EMAIL.SYS. Open the random file up for reading
SRCHOK: OPENR @A4 ;open the file
READ @A4 ;read first block
MOV IDDB+D.BUF(A3),A2 ;point to first block buffer
MOV 508.(A2),D3 ;get number of blocks
RESET: MOV IDDB+D.BUF(A3),A2 ;point to buffer
MOV #128.,D4 ;counter (128 * 4 per block)
;get the users name into system memory (not nec. sequential listing)
LOOP: MOV (A2)+,(A1)+ ;move in random file block
DEC D4 ;one less move
BEQ NXTBLK ;0 = next block
BR LOOP ;else get next word
;one random block now in memory, get next one in
NXTBLK: DEC D3 ;one less block
BEQ DONE ;0 = all done
;setup the next block record
NB: INCW IDDB+D.REC+2(A3) ;next block
READ @A4 ;read next block
BR RESET ;reset pointer and go!