Skip to content

Sustituye "ld (xxxx), sp" #974

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

Closed
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
4 changes: 1 addition & 3 deletions src/arch/z80/backend/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -661,9 +661,7 @@ def emit_prologue() -> list[str]:
output.append("exx")
output.append("push hl")
output.append("exx")
output.append("ld hl, 0")
output.append("add hl, sp")
output.append(f"ld ({common.CALL_BACK}), hl")
output.append(f"ld ({common.CALL_BACK}), sp")
output.append("ei")

output.extend(f"call {x}" for x in sorted(common.INITS))
Expand Down
4 changes: 1 addition & 3 deletions src/arch/zxnext/backend/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -75,9 +75,7 @@ def emit_prologue() -> list[str]:
output.append("di")
output.append("push iy")
output.append("ld iy, 0x5C3A ; ZX Spectrum ROM variables address")
output.append("ld hl, 0")
output.append("add hl, sp")
output.append(f"ld ({common.CALL_BACK}), hl")
output.append(f"ld ({common.CALL_BACK}), sp")
output.append("ei")

output.extend(f"call {x}" for x in sorted(common.INITS))
Expand Down
4 changes: 1 addition & 3 deletions src/lib/arch/zx48k/runtime/arith/divf.asm
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,7 @@ ERR_SP EQU 23613
ld (TMP), hl
ld hl, __DIVBYZERO
push hl
ld hl, 0
add hl, sp
ld (ERR_SP), hl
ld (ERR_SP), sp

; ------------- ROM DIV
rst 28h
Expand Down
4 changes: 1 addition & 3 deletions src/lib/arch/zx48k/runtime/val.asm
Original file line number Diff line number Diff line change
Expand Up @@ -59,9 +59,7 @@ SET_MIN EQU 16B0h
;; Now put our error handler on ERR_SP
ld hl, __VAL_ERROR
push hl
ld hl, 0
add hl, sp
ld (ERR_SP), hl
ld (ERR_SP), sp

call STK_STO_S ; Enter it on the stack

Expand Down
4 changes: 1 addition & 3 deletions src/lib/arch/zxnext/runtime/arith/divf.asm
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,7 @@ ERR_SP EQU 23613
ld (TMP), hl
ld hl, __DIVBYZERO
push hl
ld hl, 0
add hl, sp
ld (ERR_SP), hl
ld (ERR_SP), sp

; ------------- ROM DIV
rst 28h
Expand Down
4 changes: 1 addition & 3 deletions src/lib/arch/zxnext/runtime/val.asm
Original file line number Diff line number Diff line change
Expand Up @@ -59,9 +59,7 @@ SET_MIN EQU 16B0h
;; Now put our error handler on ERR_SP
ld hl, __VAL_ERROR
push hl
ld hl, 0
add hl, sp
ld (ERR_SP), hl
ld (ERR_SP), sp

call STK_STO_S ; Enter it on the stack

Expand Down
Loading