Skip to content

Commit 21bafda

Browse files
committed
Fix missing labels in epilogue
Needed for SAVE DATA
1 parent 7a359c2 commit 21bafda

2 files changed

Lines changed: 6 additions & 4 deletions

File tree

arch/zx48k/backend/__init__.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2289,6 +2289,8 @@ def emit_end():
22892289

22902290
output.append('; Defines USER DATA Length in bytes\n' +
22912291
'ZXBASIC_USER_DATA_LEN EQU ZXBASIC_USER_DATA_END - ZXBASIC_USER_DATA')
2292+
output.append('.__LABEL__.ZXBASIC_USER_DATA_LEN EQU ZXBASIC_USER_DATA_LEN')
2293+
output.append('.__LABEL__.ZXBASIC_USER_DATA EQU ZXBASIC_USER_DATA')
22922294

22932295
if OPTIONS.autorun.value:
22942296
output.append('END %s' % START_LABEL)

libzxbc/zxbparser.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2209,10 +2209,10 @@ def p_save_data(p):
22092209
else:
22102210
length = make_number(entry.type_.size, lineno=p.lineno(4))
22112211
else:
2212-
access = SYMBOL_TABLE.access_id('.ZXBASIC_USER_DATA', p.lineno(3))
2212+
access = SYMBOL_TABLE.access_label('.ZXBASIC_USER_DATA', p.lineno(3), 0)
22132213
start = make_unary(p.lineno(3), 'ADDRESS', access, type_=TYPE.uinteger)
22142214

2215-
access = SYMBOL_TABLE.access_id('.ZXBASIC_USER_DATA_LEN', p.lineno(3))
2215+
access = SYMBOL_TABLE.access_label('.ZXBASIC_USER_DATA_LEN', p.lineno(3), 0)
22162216
length = make_unary(p.lineno(3), 'ADDRESS', access, type_=TYPE.uinteger)
22172217

22182218
p[0] = make_sentence(p[1], p[2], start, length)
@@ -2278,10 +2278,10 @@ def p_load_data(p):
22782278
else:
22792279
length = make_number(entry.type_.size, lineno=p.lineno(4))
22802280
else:
2281-
entry = SYMBOL_TABLE.access_id('.ZXBASIC_USER_DATA', p.lineno(3))
2281+
entry = SYMBOL_TABLE.access_label('.ZXBASIC_USER_DATA', p.lineno(3), 0)
22822282
start = make_unary(p.lineno(3), 'ADDRESS', entry, type_=TYPE.uinteger)
22832283

2284-
entry = SYMBOL_TABLE.access_id('.ZXBASIC_USER_DATA_LEN', p.lineno(3))
2284+
entry = SYMBOL_TABLE.access_label('.ZXBASIC_USER_DATA_LEN', p.lineno(3), 0)
22852285
length = make_unary(p.lineno(3), 'ADDRESS', entry, type_=TYPE.uinteger)
22862286

22872287
p[0] = make_sentence(p[1], p[2], start, length)

0 commit comments

Comments
 (0)