; HL = user address, BC = length, DE = kaddr
+; IX = page pointer
;
; On return
; Z HL = address to write to, BC = length, DE = kaddr
;
one_high_map:
res 7,h
- ld a,2(ix)
+ ld a,1(ix)
call map_page_low
xor a
ret
; load DE with destination address (in userspace)
ld e, 6(ix)
ld d, 7(ix)
+ ; And now load ix with our paging pointer
+ ld ix,#U_DATA__U_PAGE
ret
__uget:
ld a,b
or c
ret z
+ push ix
+ ld ix,#U_DATA__U_PAGE
call user_mapping
- jr z, zeroit
+ jr z, zeroit_1
call zeroit
exx
+zeroit_1:
call user_mapping
+ call zeroit
+ pop ix
+ ret
zeroit:
ld (hl),#0
dec bc
bit 7,(hl)
ld a,(U_DATA__U_PAGE)
jr z, ugetcl
- ld a,(U_DATA__U_PAGE + 2)
+ ld a,(U_DATA__U_PAGE + 1)
ugetcl:
call map_page_low
ld l,(hl)
push bc
bit 7,(hl)
jr z, ugetwl
- ld a,(U_DATA__U_PAGE + 2)
+ ld a,(U_DATA__U_PAGE + 1)
call map_page_low
res 7,h
ld a,(hl)
ld l,a
ld a,(0) ; Split can only mean one address
ld h,a
- ld a,(U_DATA__U_PAGE + 2)
+ ld a,(U_DATA__U_PAGE + 1)
jp map_kernel_low
__uputc:
bit 7,(hl)
ld a,(U_DATA__U_PAGE)
jr z, uputcl
- ld a,(U_DATA__U_PAGE + 2)
+ ld a,(U_DATA__U_PAGE + 1)
uputcl:
call map_page_low
ld (hl),e
push bc
bit 7,(hl)
jr z, uputwl
- ld a,(U_DATA__U_PAGE + 2)
+ ld a,(U_DATA__U_PAGE + 1)
call map_page_low
res 7,h
ld (hl),e
inc hl
bit 7,h
jr z, normal_pwl
- ld a,(U_DATA__U_PAGE + 2)
+ ld a,(U_DATA__U_PAGE + 1)
ld a,d
ld (0),a ; Split can only mean one address
jp map_kernel_low