home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Oakland CPM Archive
/
oakcpm.iso
/
cpm
/
turbodos
/
td-zcpr3.lbr
/
Z33NIT.MZC
/
Z33NIT.MAC
Wrap
Text File
|
1988-12-16
|
2KB
|
111 lines
;
;
.Z80
NAME ('Z33INI')
cseg
USRIN@:: ;*** insert vector to z3init at warmstart
LD A,0C3H
LD HL,Z3INIT
LD (WARMST##),A
LD (WARMST##+01H),HL
;
XOR A ;*** clear z3flag to force bdos/wboot setup
LD (z3flag),A
;
LD A,01H ;*** install t41 module with 1 function
LD HL,usrnam
RET
;
usrnam: db 'ZCPRINIT'
;
USRFC@:: ;*** do nothing t41 function
NOP
NOP
XOR A
RET
;
z3flag:
db 0
;
z3init:
LD C,0DH ; reset disk system
LD A,0FFH ; C-Function 13
CALL CINTRY##
;
LD C,00H ; reset operating system
LD A,00H ; T-Function 0
CALL CINTRY##
;
LD A,(z3flag) ;*** get flag
OR A ;*** test
JP NZ,z3skip ;*** is set, skip init code
DEC A ;*** set flag
LD (z3flag),A ;*** store flag
;
LD C,0DH ; reset disk system
LD A,0FFH
CALL CINTRY##
;
LD A,0C3H ; install jumps for wboot & tdos
LD (00H),A
LD (050H),A
;
LD HL,WBOOTE## ; install warmboot vector
LD (01H),HL
;
LD HL,LTNTRY## ; install turbodos vector
LD (051H),HL
;
LD E,0FFH ; get current user
LD C,020H
CALL OCNTRY##
;
ADD A,A
ADD A,A
ADD A,A
ADD A,A
;
PUSH AF
;
LD C,019H ; get current drive
CALL OCNTRY##
LD C,A
;
POP AF
;
OR C
LD (04H),A ; store drive/user byte in base page
;
LD C,00H
CALL OTNTRY## ; reset operating system
;
LD HL,(MEMBAS##) ; compute lowest address of os
LD DE,(MEMRES##)
OR A
SBC HL,DE
;
LD DE,LCNTRY## ; get pointer to bdos entry point
;
LD A,0C3H ; install jump to bdos below operating system
DEC HL
LD (HL),D
DEC HL
LD (HL),E
DEC HL
LD (HL),A
;
LD (06H),HL ; install jump to system base in bdos vector
LD (05H),A
;
LD SP,HL ; set stack pointer to top op tpa
;
LD HL,00H ; push a zero so that returns will warmboot
PUSH HL
z3skip:
LD A,(04H) ; get drive/user byte from base page
LD C,A
JP z3ntry## ; jump into ZCPR now..........
;
END