Skip to content

Commit 860c98c

Browse files
authored
Merge pull request #232 from boriel/bugfix/headerless_start_label
Bugfix: emmit start label in headless mode
2 parents 4fc1d42 + 4e9c5d0 commit 860c98c

File tree

3 files changed

+6
-5
lines changed

3 files changed

+6
-5
lines changed

arch/zx48k/backend/__init__.py

+3-3
Original file line numberDiff line numberDiff line change
@@ -2176,13 +2176,13 @@ def emit_start():
21762176
output = list()
21772177
output.append('org %s' % OPTIONS.org.value)
21782178

2179-
if OPTIONS.headerless.value:
2180-
return output
2181-
21822179
if REQUIRES.intersection(MEMINITS) or '__MEM_INIT' in INITS:
21832180
output.append('; Defines HEAP SIZE\n' + OPTIONS.heap_size_label.value + ' EQU ' + str(OPTIONS.heap_size.value))
21842181

21852182
output.append('%s:' % START_LABEL)
2183+
if OPTIONS.headerless.value:
2184+
return output
2185+
21862186
output.append('di')
21872187
output.append('push ix')
21882188
output.append('push iy')

tests/functional/headerless.asm

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,17 @@
11
org 32768
2+
__START_PROGRAM:
23
ld hl, _a
34
inc (hl)
45
ld hl, 0
56
ld b, h
67
ld c, l
78
__END_PROGRAM:
89
ret
9-
1010
ZXBASIC_USER_DATA:
1111
_a:
1212
DEFB 02h
1313
; Defines DATA END --> HEAP size is 0
1414
ZXBASIC_USER_DATA_END EQU ZXBASIC_MEM_HEAP
1515
; Defines USER DATA Length in bytes
1616
ZXBASIC_USER_DATA_LEN EQU ZXBASIC_USER_DATA_END - ZXBASIC_USER_DATA
17-
END
17+
END __START_PROGRAM

tests/functional/headerless.bas

+1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
REM a headerless (no prologuqe in ASM) program
22
#pragma headerless=true
3+
#pragma autorun=true
34

45
DIM a as UByte = 2
56
LET a = a + 1

0 commit comments

Comments
 (0)