home *** CD-ROM | disk | FTP | other *** search
- ;************************************************************************
- ;* call the CBIOS to execute spec. function *
- ;************************************************************************
-
- .z80 ;
- entry _bioscall ;
-
- maclib BDOSCALL.MLB ; definition of the BDOS functions
-
- _bioscall: push hl ; save l, the first time we do
- ld hl,0 ; some checking
- ld a,(hl) ; first byte is start of wboot-vector
- cp 0c3h ; no JP-instruction?
- jp nz,bad_jp ; note we use 8080-Opcode
- inc hl ; in case you use BIOS INIT
- ld a,(hl) ; before CPU
- cp 003h ; correct offset?
- jp nz,bad_jp ; do not, if false
- inc hl ; point to high byte of vector
- ld a,(hl) ; read it
- ld hl,_bioscall ; point to sequence
- .8080 ; now we risk some program modification
- mvi m,(mvi h) ; store opcode
- .z80 ; back to good old Zilog
- inc hl ; next byte
- ld (hl),a ; and store high(CBIOS) where needed
- inc hl ; last byte
- .8080 ; I'm afraid we have to do it
- mvi m,(pchl) ; the JP (HL) Instruction
- .z80 ; huugh, it's done
- pop hl ; saved function number
- jp _bioscall ; may execute the function
- ; ld h,high(cbios)
- ; jp (hl)
- bad_jp: bdos print_string,bad_jp_msg
- bdos system_reset ; what never returns
-
- dseg ;
- bad_jp_msg: db 'bad WBOOT vector$' ;
- cseg ;
-
- end ;