Skip to content

Commit c385784

Browse files
authored
Merge pull request #653 from boriel/bugfix/USR_preserve_IX
fix: preserve IX reg in USR
2 parents bb8be05 + 317bea2 commit c385784

3 files changed

Lines changed: 7 additions & 3 deletions

File tree

src/arch/zx48k/library-asm/usr.asm

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,11 @@
1111
push namespace core
1212

1313
USR:
14+
push ix ; must preserve IX
1415
call CALL_HL
16+
pop ix
1517
ld h, b
1618
ld l, c
1719
ret
1820

1921
pop namespace
20-

src/arch/zxnext/library-asm/usr.asm

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,11 @@
1111
push namespace core
1212

1313
USR:
14+
push ix ; must preserve IX
1415
call CALL_HL
16+
pop ix
1517
ld h, b
1618
ld l, c
1719
ret
1820

1921
pop namespace
20-

tests/functional/zx48k/opt1_usr.asm

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,10 +70,12 @@ CALL_HL:
7070
#line 10 "/zxbasic/src/arch/zx48k/library-asm/usr.asm"
7171
push namespace core
7272
USR:
73+
push ix ; must preserve IX
7374
call CALL_HL
75+
pop ix
7476
ld h, b
7577
ld l, c
7678
ret
7779
pop namespace
78-
#line 23 "opt1_usr.bas"
80+
#line 23 "zx48k/opt1_usr.bas"
7981
END

0 commit comments

Comments
 (0)