Skip to content

Commit 80abefe

Browse files
authored
Merge pull request #975 from boriel-basic/patch-1
Patch 1
2 parents d1a2323 + bc3d5f1 commit 80abefe

File tree

1,048 files changed

+2666
-4766
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

1,048 files changed

+2666
-4766
lines changed

src/arch/z80/backend/main.py

+1-3
Original file line numberDiff line numberDiff line change
@@ -661,9 +661,7 @@ def emit_prologue() -> list[str]:
661661
output.append("exx")
662662
output.append("push hl")
663663
output.append("exx")
664-
output.append("ld hl, 0")
665-
output.append("add hl, sp")
666-
output.append(f"ld ({common.CALL_BACK}), hl")
664+
output.append(f"ld ({common.CALL_BACK}), sp")
667665
output.append("ei")
668666

669667
output.extend(f"call {x}" for x in sorted(common.INITS))

src/arch/zxnext/backend/main.py

+1-3
Original file line numberDiff line numberDiff line change
@@ -75,9 +75,7 @@ def emit_prologue() -> list[str]:
7575
output.append("di")
7676
output.append("push iy")
7777
output.append("ld iy, 0x5C3A ; ZX Spectrum ROM variables address")
78-
output.append("ld hl, 0")
79-
output.append("add hl, sp")
80-
output.append(f"ld ({common.CALL_BACK}), hl")
78+
output.append(f"ld ({common.CALL_BACK}), sp")
8179
output.append("ei")
8280

8381
output.extend(f"call {x}" for x in sorted(common.INITS))

src/lib/arch/zx48k/runtime/arith/divf.asm

+1-3
Original file line numberDiff line numberDiff line change
@@ -27,9 +27,7 @@ ERR_SP EQU 23613
2727
ld (TMP), hl
2828
ld hl, __DIVBYZERO
2929
push hl
30-
ld hl, 0
31-
add hl, sp
32-
ld (ERR_SP), hl
30+
ld (ERR_SP), sp
3331

3432
; ------------- ROM DIV
3533
rst 28h

src/lib/arch/zx48k/runtime/val.asm

+1-3
Original file line numberDiff line numberDiff line change
@@ -59,9 +59,7 @@ SET_MIN EQU 16B0h
5959
;; Now put our error handler on ERR_SP
6060
ld hl, __VAL_ERROR
6161
push hl
62-
ld hl, 0
63-
add hl, sp
64-
ld (ERR_SP), hl
62+
ld (ERR_SP), sp
6563

6664
call STK_STO_S ; Enter it on the stack
6765

src/lib/arch/zxnext/runtime/arith/divf.asm

+1-3
Original file line numberDiff line numberDiff line change
@@ -27,9 +27,7 @@ ERR_SP EQU 23613
2727
ld (TMP), hl
2828
ld hl, __DIVBYZERO
2929
push hl
30-
ld hl, 0
31-
add hl, sp
32-
ld (ERR_SP), hl
30+
ld (ERR_SP), sp
3331

3432
; ------------- ROM DIV
3533
rst 28h

src/lib/arch/zxnext/runtime/val.asm

+1-3
Original file line numberDiff line numberDiff line change
@@ -59,9 +59,7 @@ SET_MIN EQU 16B0h
5959
;; Now put our error handler on ERR_SP
6060
ld hl, __VAL_ERROR
6161
push hl
62-
ld hl, 0
63-
add hl, sp
64-
ld (ERR_SP), hl
62+
ld (ERR_SP), sp
6563

6664
call STK_STO_S ; Enter it on the stack
6765

tests/functional/arch/zx48k/00.asm

+1-3
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,7 @@
66
exx
77
push hl
88
exx
9-
ld hl, 0
10-
add hl, sp
11-
ld (.core.__CALL_BACK__), hl
9+
ld (.core.__CALL_BACK__), sp
1210
ei
1311
jp .core.__MAIN_PROGRAM__
1412
.core.__CALL_BACK__:

tests/functional/arch/zx48k/02.asm

+1-3
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,7 @@
66
exx
77
push hl
88
exx
9-
ld hl, 0
10-
add hl, sp
11-
ld (.core.__CALL_BACK__), hl
9+
ld (.core.__CALL_BACK__), sp
1210
ei
1311
jp .core.__MAIN_PROGRAM__
1412
.core.__CALL_BACK__:

tests/functional/arch/zx48k/03.asm

+1-3
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,7 @@
66
exx
77
push hl
88
exx
9-
ld hl, 0
10-
add hl, sp
11-
ld (.core.__CALL_BACK__), hl
9+
ld (.core.__CALL_BACK__), sp
1210
ei
1311
jp .core.__MAIN_PROGRAM__
1412
.core.__CALL_BACK__:

tests/functional/arch/zx48k/04.asm

+1-3
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,7 @@
66
exx
77
push hl
88
exx
9-
ld hl, 0
10-
add hl, sp
11-
ld (.core.__CALL_BACK__), hl
9+
ld (.core.__CALL_BACK__), sp
1210
ei
1311
jp .core.__MAIN_PROGRAM__
1412
.core.__CALL_BACK__:

tests/functional/arch/zx48k/05.asm

+1-3
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,7 @@
66
exx
77
push hl
88
exx
9-
ld hl, 0
10-
add hl, sp
11-
ld (.core.__CALL_BACK__), hl
9+
ld (.core.__CALL_BACK__), sp
1210
ei
1311
jp .core.__MAIN_PROGRAM__
1412
.core.__CALL_BACK__:

tests/functional/arch/zx48k/053opt.asm

+7-9
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,7 @@
66
exx
77
push hl
88
exx
9-
ld hl, 0
10-
add hl, sp
11-
ld (.core.__CALL_BACK__), hl
9+
ld (.core.__CALL_BACK__), sp
1210
ei
1311
jp .core.__MAIN_PROGRAM__
1412
.core.__CALL_BACK__:
@@ -77,7 +75,7 @@ _sail:
7775
ld c, l
7876
jp .core.__END_PROGRAM
7977
;; --- end of user code ---
80-
#line 1 "/zxbasic/src/arch/zx48k/library-asm/abs8.asm"
78+
#line 1 "/zxbasic/src/lib/arch/zx48k/runtime/abs8.asm"
8179
; Returns absolute value for 8 bit signed integer
8280
;
8381
push namespace core
@@ -87,9 +85,9 @@ __ABS8:
8785
neg
8886
ret
8987
pop namespace
90-
#line 55 "053opt.bas"
91-
#line 1 "/zxbasic/src/arch/zx48k/library-asm/lti8.asm"
92-
#line 1 "/zxbasic/src/arch/zx48k/library-asm/lei8.asm"
88+
#line 55 "arch/zx48k/053opt.bas"
89+
#line 1 "/zxbasic/src/lib/arch/zx48k/runtime/cmp/lti8.asm"
90+
#line 1 "/zxbasic/src/lib/arch/zx48k/runtime/cmp/lei8.asm"
9391
push namespace core
9492
__LEI8: ; Signed <= comparison for 8bit int
9593
; A <= H (registers)
@@ -111,6 +109,6 @@ checkParity:
111109
ret
112110
ENDP
113111
pop namespace
114-
#line 2 "/zxbasic/src/arch/zx48k/library-asm/lti8.asm"
115-
#line 56 "053opt.bas"
112+
#line 2 "/zxbasic/src/lib/arch/zx48k/runtime/cmp/lti8.asm"
113+
#line 56 "arch/zx48k/053opt.bas"
116114
END

tests/functional/arch/zx48k/06.asm

+1-3
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,7 @@
66
exx
77
push hl
88
exx
9-
ld hl, 0
10-
add hl, sp
11-
ld (.core.__CALL_BACK__), hl
9+
ld (.core.__CALL_BACK__), sp
1210
ei
1311
jp .core.__MAIN_PROGRAM__
1412
.core.__CALL_BACK__:

tests/functional/arch/zx48k/07.asm

+1-3
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,7 @@
66
exx
77
push hl
88
exx
9-
ld hl, 0
10-
add hl, sp
11-
ld (.core.__CALL_BACK__), hl
9+
ld (.core.__CALL_BACK__), sp
1210
ei
1311
jp .core.__MAIN_PROGRAM__
1412
.core.__CALL_BACK__:

tests/functional/arch/zx48k/08.asm

+1-3
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,7 @@
66
exx
77
push hl
88
exx
9-
ld hl, 0
10-
add hl, sp
11-
ld (.core.__CALL_BACK__), hl
9+
ld (.core.__CALL_BACK__), sp
1210
ei
1311
jp .core.__MAIN_PROGRAM__
1412
.core.__CALL_BACK__:

tests/functional/arch/zx48k/09.asm

+1-3
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,7 @@
66
exx
77
push hl
88
exx
9-
ld hl, 0
10-
add hl, sp
11-
ld (.core.__CALL_BACK__), hl
9+
ld (.core.__CALL_BACK__), sp
1210
ei
1311
jp .core.__MAIN_PROGRAM__
1412
.core.__CALL_BACK__:

tests/functional/arch/zx48k/10.asm

+1-3
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,7 @@
66
exx
77
push hl
88
exx
9-
ld hl, 0
10-
add hl, sp
11-
ld (.core.__CALL_BACK__), hl
9+
ld (.core.__CALL_BACK__), sp
1210
ei
1311
jp .core.__MAIN_PROGRAM__
1412
.core.__CALL_BACK__:

tests/functional/arch/zx48k/11.asm

+1-3
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,7 @@
66
exx
77
push hl
88
exx
9-
ld hl, 0
10-
add hl, sp
11-
ld (.core.__CALL_BACK__), hl
9+
ld (.core.__CALL_BACK__), sp
1210
ei
1311
jp .core.__MAIN_PROGRAM__
1412
.core.__CALL_BACK__:

tests/functional/arch/zx48k/12.asm

+1-3
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,7 @@
66
exx
77
push hl
88
exx
9-
ld hl, 0
10-
add hl, sp
11-
ld (.core.__CALL_BACK__), hl
9+
ld (.core.__CALL_BACK__), sp
1210
ei
1311
jp .core.__MAIN_PROGRAM__
1412
.core.__CALL_BACK__:

tests/functional/arch/zx48k/13.asm

+1-3
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,7 @@
66
exx
77
push hl
88
exx
9-
ld hl, 0
10-
add hl, sp
11-
ld (.core.__CALL_BACK__), hl
9+
ld (.core.__CALL_BACK__), sp
1210
ei
1311
jp .core.__MAIN_PROGRAM__
1412
.core.__CALL_BACK__:

tests/functional/arch/zx48k/15.asm

+1-3
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,7 @@
66
exx
77
push hl
88
exx
9-
ld hl, 0
10-
add hl, sp
11-
ld (.core.__CALL_BACK__), hl
9+
ld (.core.__CALL_BACK__), sp
1210
ei
1311
jp .core.__MAIN_PROGRAM__
1412
.core.__CALL_BACK__:

tests/functional/arch/zx48k/16.asm

+1-3
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,7 @@
66
exx
77
push hl
88
exx
9-
ld hl, 0
10-
add hl, sp
11-
ld (.core.__CALL_BACK__), hl
9+
ld (.core.__CALL_BACK__), sp
1210
ei
1311
jp .core.__MAIN_PROGRAM__
1412
.core.__CALL_BACK__:

tests/functional/arch/zx48k/17.asm

+1-3
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,7 @@
66
exx
77
push hl
88
exx
9-
ld hl, 0
10-
add hl, sp
11-
ld (.core.__CALL_BACK__), hl
9+
ld (.core.__CALL_BACK__), sp
1210
ei
1311
jp .core.__MAIN_PROGRAM__
1412
.core.__CALL_BACK__:

tests/functional/arch/zx48k/18.asm

+1-3
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,7 @@
66
exx
77
push hl
88
exx
9-
ld hl, 0
10-
add hl, sp
11-
ld (.core.__CALL_BACK__), hl
9+
ld (.core.__CALL_BACK__), sp
1210
ei
1311
jp .core.__MAIN_PROGRAM__
1412
.core.__CALL_BACK__:

tests/functional/arch/zx48k/20.asm

+1-3
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,7 @@
66
exx
77
push hl
88
exx
9-
ld hl, 0
10-
add hl, sp
11-
ld (.core.__CALL_BACK__), hl
9+
ld (.core.__CALL_BACK__), sp
1210
ei
1311
jp .core.__MAIN_PROGRAM__
1412
.core.__CALL_BACK__:

tests/functional/arch/zx48k/21.asm

+3-5
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,7 @@
66
exx
77
push hl
88
exx
9-
ld hl, 0
10-
add hl, sp
11-
ld (.core.__CALL_BACK__), hl
9+
ld (.core.__CALL_BACK__), sp
1210
ei
1311
jp .core.__MAIN_PROGRAM__
1412
.core.__CALL_BACK__:
@@ -44,7 +42,7 @@ _b:
4442
ei
4543
ret
4644
;; --- end of user code ---
47-
#line 1 "/zxbasic/src/arch/zx48k/library-asm/storef.asm"
45+
#line 1 "/zxbasic/src/lib/arch/zx48k/runtime/storef.asm"
4846
push namespace core
4947
__PISTOREF: ; Indect Stores a float (A, E, D, C, B) at location stored in memory, pointed by (IX + HL)
5048
push de
@@ -72,5 +70,5 @@ __STOREF: ; Stores the given FP number in A EDCB at address HL
7270
ld (hl), b
7371
ret
7472
pop namespace
75-
#line 22 "21.bas"
73+
#line 22 "arch/zx48k/21.bas"
7674
END

tests/functional/arch/zx48k/22.asm

+1-3
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,7 @@
66
exx
77
push hl
88
exx
9-
ld hl, 0
10-
add hl, sp
11-
ld (.core.__CALL_BACK__), hl
9+
ld (.core.__CALL_BACK__), sp
1210
ei
1311
jp .core.__MAIN_PROGRAM__
1412
.core.__CALL_BACK__:

tests/functional/arch/zx48k/25.asm

+1-3
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,7 @@
66
exx
77
push hl
88
exx
9-
ld hl, 0
10-
add hl, sp
11-
ld (.core.__CALL_BACK__), hl
9+
ld (.core.__CALL_BACK__), sp
1210
ei
1311
jp .core.__MAIN_PROGRAM__
1412
.core.__CALL_BACK__:

tests/functional/arch/zx48k/26.asm

+1-3
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,7 @@
66
exx
77
push hl
88
exx
9-
ld hl, 0
10-
add hl, sp
11-
ld (.core.__CALL_BACK__), hl
9+
ld (.core.__CALL_BACK__), sp
1210
ei
1311
jp .core.__MAIN_PROGRAM__
1412
.core.__CALL_BACK__:

tests/functional/arch/zx48k/27.asm

+1-3
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,7 @@
66
exx
77
push hl
88
exx
9-
ld hl, 0
10-
add hl, sp
11-
ld (.core.__CALL_BACK__), hl
9+
ld (.core.__CALL_BACK__), sp
1210
ei
1311
call .core.__MEM_INIT
1412
jp .core.__MAIN_PROGRAM__

tests/functional/arch/zx48k/28.asm

+1-3
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,7 @@
66
exx
77
push hl
88
exx
9-
ld hl, 0
10-
add hl, sp
11-
ld (.core.__CALL_BACK__), hl
9+
ld (.core.__CALL_BACK__), sp
1210
ei
1311
call .core.__MEM_INIT
1412
jp .core.__MAIN_PROGRAM__

tests/functional/arch/zx48k/29.asm

+1-3
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,7 @@
66
exx
77
push hl
88
exx
9-
ld hl, 0
10-
add hl, sp
11-
ld (.core.__CALL_BACK__), hl
9+
ld (.core.__CALL_BACK__), sp
1210
ei
1311
call .core.__MEM_INIT
1412
jp .core.__MAIN_PROGRAM__

0 commit comments

Comments
 (0)