Skip to content

Patch 1 #975

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

Merged
merged 2 commits into from
Apr 13, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
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
@@ -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))
4 changes: 1 addition & 3 deletions src/arch/zxnext/backend/main.py
Original file line number Diff line number Diff line change
@@ -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))
4 changes: 1 addition & 3 deletions src/lib/arch/zx48k/runtime/arith/divf.asm
Original file line number Diff line number Diff line change
@@ -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
4 changes: 1 addition & 3 deletions src/lib/arch/zx48k/runtime/val.asm
Original file line number Diff line number Diff line change
@@ -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

4 changes: 1 addition & 3 deletions src/lib/arch/zxnext/runtime/arith/divf.asm
Original file line number Diff line number Diff line change
@@ -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
4 changes: 1 addition & 3 deletions src/lib/arch/zxnext/runtime/val.asm
Original file line number Diff line number Diff line change
@@ -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

4 changes: 1 addition & 3 deletions tests/functional/arch/zx48k/00.asm
Original file line number Diff line number Diff line change
@@ -6,9 +6,7 @@
exx
push hl
exx
ld hl, 0
add hl, sp
ld (.core.__CALL_BACK__), hl
ld (.core.__CALL_BACK__), sp
ei
jp .core.__MAIN_PROGRAM__
.core.__CALL_BACK__:
4 changes: 1 addition & 3 deletions tests/functional/arch/zx48k/02.asm
Original file line number Diff line number Diff line change
@@ -6,9 +6,7 @@
exx
push hl
exx
ld hl, 0
add hl, sp
ld (.core.__CALL_BACK__), hl
ld (.core.__CALL_BACK__), sp
ei
jp .core.__MAIN_PROGRAM__
.core.__CALL_BACK__:
4 changes: 1 addition & 3 deletions tests/functional/arch/zx48k/03.asm
Original file line number Diff line number Diff line change
@@ -6,9 +6,7 @@
exx
push hl
exx
ld hl, 0
add hl, sp
ld (.core.__CALL_BACK__), hl
ld (.core.__CALL_BACK__), sp
ei
jp .core.__MAIN_PROGRAM__
.core.__CALL_BACK__:
4 changes: 1 addition & 3 deletions tests/functional/arch/zx48k/04.asm
Original file line number Diff line number Diff line change
@@ -6,9 +6,7 @@
exx
push hl
exx
ld hl, 0
add hl, sp
ld (.core.__CALL_BACK__), hl
ld (.core.__CALL_BACK__), sp
ei
jp .core.__MAIN_PROGRAM__
.core.__CALL_BACK__:
4 changes: 1 addition & 3 deletions tests/functional/arch/zx48k/05.asm
Original file line number Diff line number Diff line change
@@ -6,9 +6,7 @@
exx
push hl
exx
ld hl, 0
add hl, sp
ld (.core.__CALL_BACK__), hl
ld (.core.__CALL_BACK__), sp
ei
jp .core.__MAIN_PROGRAM__
.core.__CALL_BACK__:
16 changes: 7 additions & 9 deletions tests/functional/arch/zx48k/053opt.asm
Original file line number Diff line number Diff line change
@@ -6,9 +6,7 @@
exx
push hl
exx
ld hl, 0
add hl, sp
ld (.core.__CALL_BACK__), hl
ld (.core.__CALL_BACK__), sp
ei
jp .core.__MAIN_PROGRAM__
.core.__CALL_BACK__:
@@ -77,7 +75,7 @@ _sail:
ld c, l
jp .core.__END_PROGRAM
;; --- end of user code ---
#line 1 "/zxbasic/src/arch/zx48k/library-asm/abs8.asm"
#line 1 "/zxbasic/src/lib/arch/zx48k/runtime/abs8.asm"
; Returns absolute value for 8 bit signed integer
;
push namespace core
@@ -87,9 +85,9 @@ __ABS8:
neg
ret
pop namespace
#line 55 "053opt.bas"
#line 1 "/zxbasic/src/arch/zx48k/library-asm/lti8.asm"
#line 1 "/zxbasic/src/arch/zx48k/library-asm/lei8.asm"
#line 55 "arch/zx48k/053opt.bas"
#line 1 "/zxbasic/src/lib/arch/zx48k/runtime/cmp/lti8.asm"
#line 1 "/zxbasic/src/lib/arch/zx48k/runtime/cmp/lei8.asm"
push namespace core
__LEI8: ; Signed <= comparison for 8bit int
; A <= H (registers)
@@ -111,6 +109,6 @@ checkParity:
ret
ENDP
pop namespace
#line 2 "/zxbasic/src/arch/zx48k/library-asm/lti8.asm"
#line 56 "053opt.bas"
#line 2 "/zxbasic/src/lib/arch/zx48k/runtime/cmp/lti8.asm"
#line 56 "arch/zx48k/053opt.bas"
END
4 changes: 1 addition & 3 deletions tests/functional/arch/zx48k/06.asm
Original file line number Diff line number Diff line change
@@ -6,9 +6,7 @@
exx
push hl
exx
ld hl, 0
add hl, sp
ld (.core.__CALL_BACK__), hl
ld (.core.__CALL_BACK__), sp
ei
jp .core.__MAIN_PROGRAM__
.core.__CALL_BACK__:
4 changes: 1 addition & 3 deletions tests/functional/arch/zx48k/07.asm
Original file line number Diff line number Diff line change
@@ -6,9 +6,7 @@
exx
push hl
exx
ld hl, 0
add hl, sp
ld (.core.__CALL_BACK__), hl
ld (.core.__CALL_BACK__), sp
ei
jp .core.__MAIN_PROGRAM__
.core.__CALL_BACK__:
4 changes: 1 addition & 3 deletions tests/functional/arch/zx48k/08.asm
Original file line number Diff line number Diff line change
@@ -6,9 +6,7 @@
exx
push hl
exx
ld hl, 0
add hl, sp
ld (.core.__CALL_BACK__), hl
ld (.core.__CALL_BACK__), sp
ei
jp .core.__MAIN_PROGRAM__
.core.__CALL_BACK__:
4 changes: 1 addition & 3 deletions tests/functional/arch/zx48k/09.asm
Original file line number Diff line number Diff line change
@@ -6,9 +6,7 @@
exx
push hl
exx
ld hl, 0
add hl, sp
ld (.core.__CALL_BACK__), hl
ld (.core.__CALL_BACK__), sp
ei
jp .core.__MAIN_PROGRAM__
.core.__CALL_BACK__:
4 changes: 1 addition & 3 deletions tests/functional/arch/zx48k/10.asm
Original file line number Diff line number Diff line change
@@ -6,9 +6,7 @@
exx
push hl
exx
ld hl, 0
add hl, sp
ld (.core.__CALL_BACK__), hl
ld (.core.__CALL_BACK__), sp
ei
jp .core.__MAIN_PROGRAM__
.core.__CALL_BACK__:
4 changes: 1 addition & 3 deletions tests/functional/arch/zx48k/11.asm
Original file line number Diff line number Diff line change
@@ -6,9 +6,7 @@
exx
push hl
exx
ld hl, 0
add hl, sp
ld (.core.__CALL_BACK__), hl
ld (.core.__CALL_BACK__), sp
ei
jp .core.__MAIN_PROGRAM__
.core.__CALL_BACK__:
4 changes: 1 addition & 3 deletions tests/functional/arch/zx48k/12.asm
Original file line number Diff line number Diff line change
@@ -6,9 +6,7 @@
exx
push hl
exx
ld hl, 0
add hl, sp
ld (.core.__CALL_BACK__), hl
ld (.core.__CALL_BACK__), sp
ei
jp .core.__MAIN_PROGRAM__
.core.__CALL_BACK__:
4 changes: 1 addition & 3 deletions tests/functional/arch/zx48k/13.asm
Original file line number Diff line number Diff line change
@@ -6,9 +6,7 @@
exx
push hl
exx
ld hl, 0
add hl, sp
ld (.core.__CALL_BACK__), hl
ld (.core.__CALL_BACK__), sp
ei
jp .core.__MAIN_PROGRAM__
.core.__CALL_BACK__:
4 changes: 1 addition & 3 deletions tests/functional/arch/zx48k/15.asm
Original file line number Diff line number Diff line change
@@ -6,9 +6,7 @@
exx
push hl
exx
ld hl, 0
add hl, sp
ld (.core.__CALL_BACK__), hl
ld (.core.__CALL_BACK__), sp
ei
jp .core.__MAIN_PROGRAM__
.core.__CALL_BACK__:
4 changes: 1 addition & 3 deletions tests/functional/arch/zx48k/16.asm
Original file line number Diff line number Diff line change
@@ -6,9 +6,7 @@
exx
push hl
exx
ld hl, 0
add hl, sp
ld (.core.__CALL_BACK__), hl
ld (.core.__CALL_BACK__), sp
ei
jp .core.__MAIN_PROGRAM__
.core.__CALL_BACK__:
4 changes: 1 addition & 3 deletions tests/functional/arch/zx48k/17.asm
Original file line number Diff line number Diff line change
@@ -6,9 +6,7 @@
exx
push hl
exx
ld hl, 0
add hl, sp
ld (.core.__CALL_BACK__), hl
ld (.core.__CALL_BACK__), sp
ei
jp .core.__MAIN_PROGRAM__
.core.__CALL_BACK__:
4 changes: 1 addition & 3 deletions tests/functional/arch/zx48k/18.asm
Original file line number Diff line number Diff line change
@@ -6,9 +6,7 @@
exx
push hl
exx
ld hl, 0
add hl, sp
ld (.core.__CALL_BACK__), hl
ld (.core.__CALL_BACK__), sp
ei
jp .core.__MAIN_PROGRAM__
.core.__CALL_BACK__:
4 changes: 1 addition & 3 deletions tests/functional/arch/zx48k/20.asm
Original file line number Diff line number Diff line change
@@ -6,9 +6,7 @@
exx
push hl
exx
ld hl, 0
add hl, sp
ld (.core.__CALL_BACK__), hl
ld (.core.__CALL_BACK__), sp
ei
jp .core.__MAIN_PROGRAM__
.core.__CALL_BACK__:
8 changes: 3 additions & 5 deletions tests/functional/arch/zx48k/21.asm
Original file line number Diff line number Diff line change
@@ -6,9 +6,7 @@
exx
push hl
exx
ld hl, 0
add hl, sp
ld (.core.__CALL_BACK__), hl
ld (.core.__CALL_BACK__), sp
ei
jp .core.__MAIN_PROGRAM__
.core.__CALL_BACK__:
@@ -44,7 +42,7 @@ _b:
ei
ret
;; --- end of user code ---
#line 1 "/zxbasic/src/arch/zx48k/library-asm/storef.asm"
#line 1 "/zxbasic/src/lib/arch/zx48k/runtime/storef.asm"
push namespace core
__PISTOREF: ; Indect Stores a float (A, E, D, C, B) at location stored in memory, pointed by (IX + HL)
push de
@@ -72,5 +70,5 @@ __STOREF: ; Stores the given FP number in A EDCB at address HL
ld (hl), b
ret
pop namespace
#line 22 "21.bas"
#line 22 "arch/zx48k/21.bas"
END
4 changes: 1 addition & 3 deletions tests/functional/arch/zx48k/22.asm
Original file line number Diff line number Diff line change
@@ -6,9 +6,7 @@
exx
push hl
exx
ld hl, 0
add hl, sp
ld (.core.__CALL_BACK__), hl
ld (.core.__CALL_BACK__), sp
ei
jp .core.__MAIN_PROGRAM__
.core.__CALL_BACK__:
4 changes: 1 addition & 3 deletions tests/functional/arch/zx48k/25.asm
Original file line number Diff line number Diff line change
@@ -6,9 +6,7 @@
exx
push hl
exx
ld hl, 0
add hl, sp
ld (.core.__CALL_BACK__), hl
ld (.core.__CALL_BACK__), sp
ei
jp .core.__MAIN_PROGRAM__
.core.__CALL_BACK__:
4 changes: 1 addition & 3 deletions tests/functional/arch/zx48k/26.asm
Original file line number Diff line number Diff line change
@@ -6,9 +6,7 @@
exx
push hl
exx
ld hl, 0
add hl, sp
ld (.core.__CALL_BACK__), hl
ld (.core.__CALL_BACK__), sp
ei
jp .core.__MAIN_PROGRAM__
.core.__CALL_BACK__:
4 changes: 1 addition & 3 deletions tests/functional/arch/zx48k/27.asm
Original file line number Diff line number Diff line change
@@ -6,9 +6,7 @@
exx
push hl
exx
ld hl, 0
add hl, sp
ld (.core.__CALL_BACK__), hl
ld (.core.__CALL_BACK__), sp
ei
call .core.__MEM_INIT
jp .core.__MAIN_PROGRAM__
4 changes: 1 addition & 3 deletions tests/functional/arch/zx48k/28.asm
Original file line number Diff line number Diff line change
@@ -6,9 +6,7 @@
exx
push hl
exx
ld hl, 0
add hl, sp
ld (.core.__CALL_BACK__), hl
ld (.core.__CALL_BACK__), sp
ei
call .core.__MEM_INIT
jp .core.__MAIN_PROGRAM__
4 changes: 1 addition & 3 deletions tests/functional/arch/zx48k/29.asm
Original file line number Diff line number Diff line change
@@ -6,9 +6,7 @@
exx
push hl
exx
ld hl, 0
add hl, sp
ld (.core.__CALL_BACK__), hl
ld (.core.__CALL_BACK__), sp
ei
call .core.__MEM_INIT
jp .core.__MAIN_PROGRAM__
Loading