File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff 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 ))
Original file line number Diff line number Diff 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 ))
Original file line number Diff line number Diff 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
Original file line number Diff line number Diff 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
Original file line number Diff line number Diff 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
Original file line number Diff line number Diff 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
You can’t perform that action at this time.
0 commit comments