File tree 6 files changed +6
-18
lines changed
6 files changed +6
-18
lines changed Original file line number Diff line number Diff line change @@ -661,9 +661,7 @@ def emit_prologue() -> list[str]:
661
661
output .append ("exx" )
662
662
output .append ("push hl" )
663
663
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" )
667
665
output .append ("ei" )
668
666
669
667
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]:
75
75
output .append ("di" )
76
76
output .append ("push iy" )
77
77
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" )
81
79
output .append ("ei" )
82
80
83
81
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
27
27
ld (TMP) , hl
28
28
ld hl , __DIVBYZERO
29
29
push hl
30
- ld hl , 0
31
- add hl , sp
32
- ld (ERR_SP) , hl
30
+ ld (ERR_SP) , sp
33
31
34
32
; ------------- ROM DIV
35
33
rst 28h
Original file line number Diff line number Diff line change @@ -59,9 +59,7 @@ SET_MIN EQU 16B0h
59
59
;; Now put our error handler on ERR_SP
60
60
ld hl , __VAL_ERROR
61
61
push hl
62
- ld hl , 0
63
- add hl , sp
64
- ld (ERR_SP) , hl
62
+ ld (ERR_SP) , sp
65
63
66
64
call STK_STO_S ; Enter it on the stack
67
65
Original file line number Diff line number Diff line change @@ -27,9 +27,7 @@ ERR_SP EQU 23613
27
27
ld (TMP) , hl
28
28
ld hl , __DIVBYZERO
29
29
push hl
30
- ld hl , 0
31
- add hl , sp
32
- ld (ERR_SP) , hl
30
+ ld (ERR_SP) , sp
33
31
34
32
; ------------- ROM DIV
35
33
rst 28h
Original file line number Diff line number Diff line change @@ -59,9 +59,7 @@ SET_MIN EQU 16B0h
59
59
;; Now put our error handler on ERR_SP
60
60
ld hl , __VAL_ERROR
61
61
push hl
62
- ld hl , 0
63
- add hl , sp
64
- ld (ERR_SP) , hl
62
+ ld (ERR_SP) , sp
65
63
66
64
call STK_STO_S ; Enter it on the stack
67
65
You can’t perform that action at this time.
0 commit comments