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

Lines changed: 1 addition & 3 deletions
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

Lines changed: 1 addition & 3 deletions
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

Lines changed: 1 addition & 3 deletions
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

Lines changed: 1 addition & 3 deletions
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

Lines changed: 1 addition & 3 deletions
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

Lines changed: 1 addition & 3 deletions
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

Lines changed: 1 addition & 3 deletions
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

Lines changed: 1 addition & 3 deletions
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

Lines changed: 1 addition & 3 deletions
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

Lines changed: 1 addition & 3 deletions
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__:

0 commit comments

Comments
 (0)