home *** CD-ROM | disk | FTP | other *** search
- ;
- ; Patch Overlay for NZCOM.COM AWH
- ;
- ; 1) Patch location 280H to connect the XBIOS BSX jumps
- ; to the DOS installed ( ZSDOS )
- ; 2) Patch path to B0: $$ B0:, as system boots with RAM disk A:
- ; 3) Patch command line to B0:STARTZCM
- ;
- ; Revision 1.0 5 Dec 90 Release
- ;
- ; Patch origins:
- ;
- patch1 equ 0280H ; user patch area
- patch2 equ 0680H ; path
- patch3 equ 0690H ; command line
- ;
- ; the ususal:
- ;
- cr equ 0dH
- lf equ 0aH
- ;
- ; cp/m locations:
- ;
- os$base equ 0 ; memory base
- biospg equ os$base+2 ; warmboot target hi-order byte
- bdos equ os$base+5 ; bdos entry
- ;
- prbuff equ 9 ; bdos print string
- ;
- ; nzcom environment location & offsets
- ;
- nzenv equ 0100H ; NZCOM.COM target system environment
- nzbiopg equ nzenv+2 ; Hi byte of const jump in XBIOS
- nzdos equ nzenv+042H ; pointer to DOS addr
- ;
- ; pointers to patch locations
- ;
- dosoff equ 0007h ; DOS patch at DOS+dosoff
- xbent equ 004eh ; XBIOS entry for BSX string
- xbtag equ 00dch ; location of 'XBIOS' string in XBIOS
- xbret equ 02a8h ; XBIOS BSX return addr stored here
- ;
- ;---------------------------------------------------------------------
- ;
- ; Patch BSX jump into new DOS, and DOS return into XBIOS
- ;
- ;---------------------------------------------------------------------
- ;
- org patch1
- ;
- pat1: cp 0 ; non nzcom system running?
- jr z,a0 ; yes, find XBIOS location
- cp 1 ; nzcom running?
- jr z,a1 ; get XBIOS location
- cp 3 ; new system loaded?
- jr z,a3 ; install patches
- ret ; none of the above, pass
- ;
- ; NZCOM not loaded, get XBIOS page from page 0 warm boot vector
- ;
- a0: ld hl,biospg ; point to hi byte
- jr a01com ; join common code
- ;
- ; NZCOM loaded, find XBIOS page from ENV pointer to const routine
- ;
- a1: ld hl,nzbiopg ; point to hi byte
- a01com: ld de,xbbase+1 ; point to buffer
- ld a,(hl) ; save byte
- ld (de),a
- ld c,prbuff ; use bdos to print banner
- ld de,signon
- jp bdos ; remember, call pending
- ;
- ; New system in place, patch return in XBIOS and jump in DOS
- ; First, test for XBIOS & ZSDOS
- ;
- a3: ld hl,(xbbase) ; get XBIOS base addr
- ld de,xbtag ; offset to XBIOS string
- add hl,de ; form address
- ld de,xbstr ; point to baseline string
- ld a,(xbct) ; byte counter
- ld b,a ; where we need it
- ckxb: ld a,(de) ; get good character
- cp a,(hl) ; compare to BIOS character
- ret nz ; not a match, gong this routine
- inc de ; point to next character
- inc hl
- djnz ckxb ; check them all
- ;
- ld hl,(nzdos) ; get DOS base addr
- ld de,dosstr ; point to baseline string
- ld a,(dosct) ; character count
- ld b,a ; where we need it
- ckdos: ld a,(de) ; get good character
- cp a,(hl) ; compare to DOS character
- ret nz ; not a match, gong this routine
- inc de ; point to next character
- inc hl
- djnz ckdos ; check them all
- ;
- ; Everything looks ok, patch jump target at DOS+7 into XBIOS return,
- ; and XBIOS BSX entry into DOS+7
- ;
- ld hl,(xbbase) ; get XBIOS base addr
- ld de,xbret ; offset to XBIOS return
- add hl,de ; form complete addr
- push hl ; save on stack
- ld hl,(nzdos) ; get DOS base addr
- ld de,dosoff ; offset to jump loc
- add hl,de ; complete addr
- pop de ; XBIOS addr now in de
- push hl ; save DOS addr
- ldi ; move 1 byte twice
- ldi ; from DOS to XBIOS
- ;
- ld hl,(xbbase) ; get XBIOS base addr
- ld de,xbent ; offset to entry
- add hl,de ; form complete addr
- ld (xbbsx),hl ; and save
- ld hl,xbbsx ; point to entry
- pop de ; get DOS jump addr
- ldi ; move bytes
- ldi
- ;
- ret ; fini
- ;
- ; data storage
- ;
- xbbase: dw 0f200H ; True location of bios
- xbbsx: dw 0f24eH ; xbios entry for BSX
- ;
- signon: db cr,lf,'Patching BSX entry and return',cr,lf,'$'
- xbstr: db 'XBIOS'
- xbct: db $-xbstr ; char count
- dosstr: db 'ZSDOS'
- dosct: db $-dosstr
- ;
- ;---------------------------------------------------------------------
- ;
- ; Patch path to be B0: $$ b0:
- ;
- ;---------------------------------------------------------------------
- ;
- org patch2
- ;
- pat2: db 02,00 ; B0:
- db '$$' ; curently logged drive
- db 02,00
- db 0,-1 ; terminator
- ;
- ;---------------------------------------------------------------------
- ;
- ; Patch command line
- ;
- ;---------------------------------------------------------------------
- ;
- org patch3
- ;
- pat3 db 'B0:STARTZCM'
- db 0,-1 ; terminator
- ;
- end