|
1 | 1 | # -*- coding: utf-8 -*- |
2 | 2 |
|
3 | | -from src.api.config import OPTIONS |
4 | | -from src.arch.z80 import backend |
| 3 | +from src.api.config import OPTIONS, Action |
| 4 | +from src.arch.z80.backend.runtime.namespace import NAMESPACE |
| 5 | + |
| 6 | +from src.arch.z80.backend import common |
| 7 | +from src.arch.z80.backend import engine |
5 | 8 | from src.arch.z80.backend import ICInfo |
6 | 9 |
|
| 10 | +from src.arch.zxnext.peephole import OPTS_PATH |
| 11 | + |
7 | 12 | from src.arch.zxnext.backend._8bit import _mul8 |
8 | 13 |
|
9 | 14 | from src.arch.z80.backend import tmp_label, _fpop, HI16, INITS, LO16, LABEL_COUNTER, MEMORY, MEMINITS |
|
41 | 46 | def init(): |
42 | 47 | # ZXNext asm enabled by default for this arch |
43 | 48 | OPTIONS.zxnext = True |
| 49 | + """Initializes this module""" |
| 50 | + |
| 51 | + common.init() |
| 52 | + |
| 53 | + # Default code ORG |
| 54 | + OPTIONS(Action.ADD_IF_NOT_DEFINED, name="org", type=int, default=32768) |
| 55 | + # Default HEAP SIZE (Dynamic memory) in bytes |
| 56 | + OPTIONS(Action.ADD_IF_NOT_DEFINED, name="heap_size", type=int, default=4768, ignore_none=True) # A bit more than 4K |
| 57 | + # Labels for HEAP START (might not be used if not needed) |
| 58 | + OPTIONS(Action.ADD_IF_NOT_DEFINED, name="heap_start_label", type=str, default=f"{NAMESPACE}.ZXBASIC_MEM_HEAP") |
| 59 | + # Labels for HEAP SIZE (might not be used if not needed) |
| 60 | + OPTIONS(Action.ADD_IF_NOT_DEFINED, name="heap_size_label", type=str, default=f"{NAMESPACE}.ZXBASIC_HEAP_SIZE") |
| 61 | + # Flag for headerless mode (No prologue / epilogue) |
| 62 | + OPTIONS(Action.ADD_IF_NOT_DEFINED, name="headerless", type=bool, default=False, ignore_none=True) |
44 | 63 |
|
45 | | - backend.init() |
| 64 | + engine.main([engine.OPTS_PATH, OPTS_PATH], force=True) # inits the optimizer |
0 commit comments