home *** CD-ROM | disk | FTP | other *** search
- ;
- ; Z3LIB Module Name: Z3LOG
- ; Author: Richard Conn
- ; Z3LIB Version Number: 1.3
- ; Module Version Number: 1.1
- ;
- public z3log
-
- ;
- ; Equates
- ;
- bdos equ 5
-
- ;
- ; Macros
- ;
- putrg macro
- push hl
- push de
- push bc
- push af
- endm
-
- getrg macro
- pop af
- pop bc
- pop de
- pop hl
- endm
-
- ;
- ; Z3LOG logs into the DU contained in a ZCPR3 FCB. On input,
- ; DE pts to FCB. No codes are returned.
- ;
- z3log:
- putrg ;save regs
- ;
- ; Get Current Disk in B (disk A = 1)
- ;
- push de ;save ptr to FCB
- ld c,25 ;get disk
- call bdos
- inc a
- ld b,a ;current disk in B
- pop de ;pt to FCB
- ;
- ; Determine Disk in B (disk A = 0)
- ;
- ld a,(de) ;get disk
- or a ;0=default
- jp z,log1
- ld b,a ;selected disk in B
- log1:
- dec b ;B=disk (disk A=0)
- ;
- ; Get Selected User in C
- ;
- ld hl,13 ;pt to S1 for user
- add hl,de
- ld c,(hl) ;user in C
- ;
- ; Log Into Disk in B
- ;
- push bc ;save DU
- ld e,b ;disk in E
- ld c,14 ;select disk
- call bdos
- pop bc
- ;
- ; Log Into User in C
- ;
- ld e,c ;user in E
- ld c,32 ;select user
- call bdos
- getrg ;restore registers
- ret
-
- end