Skip to content
This repository has been archived by the owner on May 21, 2024. It is now read-only.

Commit

Permalink
Merged in bugfix/headerless_start_label (pull request boriel-basic#224)
Browse files Browse the repository at this point in the history
Bugfix: emmit start label in headless mode

Approved-by: Jose Rodriguez <boriel@gmail.com>
  • Loading branch information
boriel committed Oct 18, 2019
2 parents 3c2e340 + 2eccffd commit f57ed72
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 5 deletions.
6 changes: 3 additions & 3 deletions arch/zx48k/backend/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -2176,13 +2176,13 @@ def emit_start():
output = list()
output.append('org %s' % OPTIONS.org.value)

if OPTIONS.headerless.value:
return output

if REQUIRES.intersection(MEMINITS) or '__MEM_INIT' in INITS:
output.append('; Defines HEAP SIZE\n' + OPTIONS.heap_size_label.value + ' EQU ' + str(OPTIONS.heap_size.value))

output.append('%s:' % START_LABEL)
if OPTIONS.headerless.value:
return output

output.append('di')
output.append('push ix')
output.append('push iy')
Expand Down
4 changes: 2 additions & 2 deletions tests/functional/headerless.asm
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
org 32768
__START_PROGRAM:
ld hl, _a
inc (hl)
ld hl, 0
ld b, h
ld c, l
__END_PROGRAM:
ret

ZXBASIC_USER_DATA:
_a:
DEFB 02h
; Defines DATA END --> HEAP size is 0
ZXBASIC_USER_DATA_END EQU ZXBASIC_MEM_HEAP
; Defines USER DATA Length in bytes
ZXBASIC_USER_DATA_LEN EQU ZXBASIC_USER_DATA_END - ZXBASIC_USER_DATA
END
END __START_PROGRAM
1 change: 1 addition & 0 deletions tests/functional/headerless.bas
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
REM a headerless (no prologuqe in ASM) program
#pragma headerless=true
#pragma autorun=true

DIM a as UByte = 2
LET a = a + 1
Expand Down

0 comments on commit f57ed72

Please sign in to comment.