Skip to content

Commit 7dd3cd3

Browse files
committed
Merged in bugfix/asm_label_lost (pull request #176)
Bugfix/asm label lost Approved-by: Jose Rodriguez <boriel@gmail.com>
2 parents 13a7656 + 25faf38 commit 7dd3cd3

6 files changed

Lines changed: 69 additions & 3 deletions

File tree

.bumpversion.cfg

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
[bumpversion]
2-
current_version = 1.8.6
2+
current_version = 1.8.7
33
files = version.py
44

ChangeLog

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,11 @@
1+
================================================================
2+
Changes from Version 1.8.6 to 1.8.7
3+
! Bugfix: do not remove ASM blocks (optimize)
4+
5+
================================================================
6+
Changes from Version 1.8.5 to 1.8.6
7+
! Bugfix: END instruction was not returning result. Fixed.
8+
19
================================================================
210
Changes from Version 1.8.4 to 1.8.5
311
! Bugfix: crash on bad array declaration

arch/zx48k/backend/__init__.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2716,7 +2716,8 @@ def output_join(output, new_chunk):
27162716
# <any inst>
27172717
# Into:
27182718
# jp XXX
2719-
if OPT31 and i1 == 'jp' and not condition(output[-1]) and i2 is not None and i2[-1] != ':':
2719+
if OPT31 and i1 == 'jp' and not condition(output[-1]) and i2 is not None and \
2720+
i2[-1] != ':' and new_chunk[0] not in ASMS:
27202721
new_chunk.pop(0)
27212722
changed = True
27222723
continue

tests/functional/opt1_nolabel.asm

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
org 32768
2+
__START_PROGRAM:
3+
di
4+
push ix
5+
push iy
6+
exx
7+
push hl
8+
exx
9+
ld hl, 0
10+
add hl, sp
11+
ld (__CALL_BACK__), hl
12+
ei
13+
#line 1
14+
ld hl, mygod
15+
#line 2
16+
jp __LABEL__finish
17+
mygod:
18+
nop
19+
#line 9
20+
__LABEL__finish:
21+
ld hl, 0
22+
ld b, h
23+
ld c, l
24+
__END_PROGRAM:
25+
di
26+
ld hl, (__CALL_BACK__)
27+
ld sp, hl
28+
exx
29+
pop hl
30+
exx
31+
pop iy
32+
pop ix
33+
ei
34+
ret
35+
__CALL_BACK__:
36+
DEFW 0
37+
38+
ZXBASIC_USER_DATA:
39+
; Defines DATA END --> HEAP size is 0
40+
ZXBASIC_USER_DATA_END EQU ZXBASIC_MEM_HEAP
41+
; Defines USER DATA Length in bytes
42+
ZXBASIC_USER_DATA_LEN EQU ZXBASIC_USER_DATA_END - ZXBASIC_USER_DATA
43+
END

tests/functional/opt1_nolabel.bas

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
2+
ASM
3+
ld hl, mygod
4+
END ASM
5+
6+
GOTO finish
7+
8+
ASM
9+
mygod:
10+
nop
11+
END ASM
12+
13+
finish:
14+

version.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
VERSION = '1.8.6'
1+
VERSION = '1.8.7'

0 commit comments

Comments
 (0)