summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLeo C2020-03-16 14:16:49 +0100
committerLeo C2020-03-16 14:16:49 +0100
commitaa1cd3a9e22307c7f0733c3c80c85d3329f5038b (patch)
treea8a4f52aa90f776d34d50c4666651063dc222e4c
parente8a98308cd28da296993a9085df28dc5957de86d (diff)
downloadz180-stamp-cpm3-aa1cd3a9e22307c7f0733c3c80c85d3329f5038b.zip
b0call --> b0hlcall
function pointer in HL. A not saved
-rw-r--r--cbios/bioskrnl.18028
-rw-r--r--cbios/chario.18012
-rw-r--r--cbios/config.inc6
-rw-r--r--cbios/mm.180138
-rw-r--r--cbios/time.1804
5 files changed, 35 insertions, 153 deletions
diff --git a/cbios/bioskrnl.180 b/cbios/bioskrnl.180
index 0610b31..989b53c 100644
--- a/cbios/bioskrnl.180
+++ b/cbios/bioskrnl.180
@@ -79,7 +79,7 @@ ccp equ 0100h ; Console Command Processor gets loaded
public ?mltio,?flush,?mov,?tim,?bnksl,?stbnk,?xmov
extrn bs$stack
- extrn _b0call
+ extrn _b0hlcall
; BIOS Jump vector.
@@ -131,7 +131,7 @@ ccp equ 0100h ; Console Command Processor gets loaded
?ioctl jp ioctl ;
- rept 48
+ rept 32
db '|'
endm
boot$stack:
@@ -147,7 +147,7 @@ boot:
out0 (cbr),a
ld a,USR$CBAR
out0 (cbar),a
- ld sp,boot$stack
+ ld sp,bs$stack
call hwinit ; first time hardware initialisation
@@ -191,6 +191,7 @@ d$init$next:
cseg ; following in resident memory
boot$1:
+ ld sp,boot$stack
call set$jumps
call ?ldccp ; fetch CCP for first time
jp ccp
@@ -478,16 +479,15 @@ seldsk:
ld a,(hl)
ld (@RDRV),a
jr nz,notfirst ; examine login bit
- ld hl,-6
+
+ ld hl,-6 ; call LOGIN
add hl,de
ld a,(hl)
inc hl
ld h,(hl)
ld l,a
- ld (bs$stack),sp
- ld sp,bs$stack
- call ijphl ; call LOGIN
- ld sp,(bs$stack)
+ call _b0hlcall
+
notfirst:
ld hl,(@xdph) ; recover DPH pointer
ret
@@ -565,15 +565,13 @@ sectrn:
; extended disk parameter header (XDPH).
read:
- ld (bs$stack),sp
- ld sp,bs$stack
ld a,1
ld (@op),a
ld ix,(@xdph) ; get drive descriptor pointer
ld l,(ix-8) ; get read routine entry
ld h,(ix-7)
- call ijphl ; call LOGIN
- ld sp,(bs$stack)
+
+ call _b0hlcall
ret
; WRITE
@@ -582,15 +580,13 @@ read:
; extended disk parameter header (XDPH).
write:
- ld (bs$stack),sp
- ld sp,bs$stack
ld a,2
ld (@op),a
ld ix,(@xdph) ; get drive descriptor pointer
ld l,(ix-10) ; get write routine entry
ld h,(ix- 9)
- call ijphl ; call LOGIN
- ld sp,(bs$stack)
+
+ call _b0hlcall
ret
diff --git a/cbios/chario.180 b/cbios/chario.180
index 7133b77..930a86d 100644
--- a/cbios/chario.180
+++ b/cbios/chario.180
@@ -9,7 +9,7 @@
extrn ff_dev
extrn as0_dev,as1_dev
- extrn _b0call
+ extrn _b0hlcall
maclib z180reg.inc
maclib config.inc
@@ -74,7 +74,7 @@ null_dev:
ld b,c
ld c,0 ;
ioctl:
- b0call _ioctl
+ b0hlcall _ioctl
ret
dseg
@@ -90,7 +90,7 @@ _ioctl:
cseg
?ci: ; character input
- b0call _ci
+ b0hlcall _ci
ret
dseg
@@ -106,7 +106,7 @@ _ci:
cseg
?cist: ; character input
- b0call _cist
+ b0hlcall _cist
ret
dseg
@@ -123,7 +123,7 @@ _cist: ; character input status
cseg
?co: ; character input
- b0call _co
+ b0hlcall _co
ret
dseg
@@ -141,7 +141,7 @@ _co: ; character output
cseg
?cost: ; character input
- b0call _cost
+ b0hlcall _cost
ret
dseg
diff --git a/cbios/config.inc b/cbios/config.inc
index fe1b1f5..26158e4 100644
--- a/cbios/config.inc
+++ b/cbios/config.inc
@@ -212,9 +212,9 @@ inidate macro
;-----------------------------------------------------
-b0call macro address
- call _b0call
- dw address
+b0hlcall macro address
+ ld hl,address
+ call _b0hlcall
endm
;-----------------------------------------------------
diff --git a/cbios/mm.180 b/cbios/mm.180
index 0c3fc36..57f192b 100644
--- a/cbios/mm.180
+++ b/cbios/mm.180
@@ -221,113 +221,13 @@ phy2log:
; Switch stack pointer to "system" stack in top ram
; Save cbar
;
+; HL: function pointer
+;
cseg ; common!
- public _b0call
-
- if 0
-
-_b0call:
- push af
- in0 a,(bbr)
- jr nz,b0c_doit
- pop af
-
- ex (sp),hl ;16
- push de
- ld e,(hl)
- inc hl
- ld d,(hl)
- inc hl
- ld (b0c_fast_go),de
- pop de
- ex (sp),hl ;16
-b0c_fast_go equ $+1
- jp 0
-
-b0c_doit:
- ld (b0_save_hl),hl
- ld (b0_save_de),de
- pop hl
- ld (b0_save_af),hl
-
- pop de ;get ptr to 'function address' in de
- ld hl,2
- add hl,de
- push hl ;put return address on stack
-
- if 0 ; link80
-
- ld hl,0
- add hl,sp ;
- ld a,h
- cp high (bs$stack-bs$stack$size) ;link80 can't process this
- jr nc,$ + 5 ;skip if stack allready in common bios ram
-
- else
-
- ld hl,bs$stack-bs$stack$size
- ld a,h
- dec a
- ld hl,0
- add hl,sp ;
- cp h
- jr c,$ + 5 ;skip if stack allready in common bios ram
- endif
- ld sp,bs$stack ;
-
- push hl ;save user stack pointer
-
- in0 h,(bbr) ;
- push hl ;
- ld hl,b0c_ret
- push hl
- xor a
- out0 (bbr),a ;
- ex de,hl ;ptr
- ld e,(hl) ;get 'function address'
- inc hl ;
- ld d,(hl) ;
- push de ;put on (switched) stack
-
- ld hl,(b0_save_af) ;get back users registers
- push hl
- pop af
- ld de,(b0_save_de)
- ld hl,(b0_save_hl)
- ret ;go to function
-b0c_ret:
- ld (b0_save_hl),hl
-
- pop hl ;
- out0 (bbr),h ;
- pop hl ;
- ld sp,hl ;
- ld hl,(b0_save_hl)
- ret ;
- else
-
-_b0call:
- push af
- ld (b0_save_hl),hl
- ld (b0_save_de),de
- pop hl
- ld (b0_save_af),hl
-
- pop de ;get ptr to 'function address' in de
- ld hl,2
- add hl,de
- push hl ;put return address on stack
-
- if 0 ; link80
-
- ld hl,0
- add hl,sp ;
- ld a,h
- cp high (bs$stack-bs$stack$size) ;link80 can't process this
- jr nc,$ + 5 ;skip if stack allready in common bios ram
-
- else
+ public _b0hlcall
+_b0hlcall:
+ ld (b0_save_r),hl
ld hl,bs$stack-bs$stack$size
ld a,h
@@ -336,44 +236,30 @@ _b0call:
add hl,sp ;
cp h
jr c,$ + 5 ;skip if stack allready in common bios ram
- endif
ld sp,bs$stack ;
push hl ;save user stack pointer
in0 h,(bbr) ;
push hl ;
- ld hl,b0c_ret
+ ld hl,b0hlc_ret
push hl
xor a
out0 (bbr),a ;
- ex de,hl ;ptr
- ld e,(hl) ;get 'function address'
- inc hl ;
- ld d,(hl) ;
- push de ;put on (switched) stack
-
- ld hl,(b0_save_af) ;get back users registers
- push hl
- pop af
- ld de,(b0_save_de)
- ld hl,(b0_save_hl)
- ret ;go to function
-b0c_ret:
- ld (b0_save_hl),hl
+ ld hl,(b0_save_r)
+ jp (hl)
+b0hlc_ret:
+ ld (b0_save_r),hl
pop hl ;
out0 (bbr),h ;
pop hl ;
ld sp,hl ;
- ld hl,(b0_save_hl)
+ ld hl,(b0_save_r)
ret ;
- endif
-b0_save_hl: dw 0
-b0_save_de: dw 0
-b0_save_af: dw 0
+b0_save_r: dw 0
;--------------------------------------------------------------------
; Trampoline for interrupt routines in banked ram.
diff --git a/cbios/time.180 b/cbios/time.180
index 6b489e0..67fae73 100644
--- a/cbios/time.180
+++ b/cbios/time.180
@@ -8,7 +8,7 @@
extrn f_cpu
extrn ioiniml,div32_16
extrn msg.sm,msg.recv
- extrn _b0call
+ extrn _b0hlcall
maclib z180reg.inc
maclib config.inc
@@ -30,7 +30,7 @@
dec c
time_set:
- b0call gs_rtc
+ b0hlcall gs_rtc
ld a,0ffh
ld (time_to),a
ret