Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

GPART: Fix for issue where IX and IY are not returned to caller #84

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 17 additions & 2 deletions source/command/msxdos/sys.mac
Original file line number Diff line number Diff line change
Expand Up @@ -1017,6 +1017,23 @@ zstr_slow:
;LD E,RELEASE##+(RELEASE##/256)*16
ret

@GPART: ; RETURN CORRECT IX, IY VALUES BY WALKING AND MODIFYING STACK
EXX
POP HL ; Get return address, and pop off the saved
POP DE ; values of IX and IY.
POP DE
PUSH HL
EXX
CALL KBDOS ; Call KBDOS, which returns stuff in IY & IX.
EXX ; Save returned values.
POP HL ; Get the return address again.
PUSH IX ; Push new 'saved' IX and IY values.
PUSH IY
PUSH HL
EXX
RET


FUNC_WITH_IXIY:
EXX
pop bc
Expand All @@ -1036,7 +1053,6 @@ FUNC_WITH_IXIY:
push bc
EXX
RET

;
;
;------------------------------------------------------------------------------
Expand Down Expand Up @@ -1263,7 +1279,6 @@ _KBSDE: LD DE,BUFF1 ; DE -> buffer containing FIB or string.
@RALLOC:
@DSPACE:
@LOCK:
@GPART:
@Z80MODE:

;
Expand Down
2 changes: 1 addition & 1 deletion source/kernel/bank0/bdos.mac
Original file line number Diff line number Diff line change
Expand Up @@ -935,7 +935,7 @@ STRCPY: LD A,(HL) ;Get character from string.
ld bc,64
ldir
pop hl
ret
ret
;
;------------------------------------------------------------------------------
;
Expand Down