Skip to content

Commit 1dd8015

Browse files
committed
refact: move mem runtime routines to mem/ folder
1 parent 7ca5246 commit 1dd8015

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

64 files changed

+1216
-1237
lines changed

src/arch/z80/backend/common.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,13 +7,12 @@
77
from src.api import global_, tmp_labels
88
from src.api.config import OPTIONS, OptimizationStrategy
99
from src.api.exception import TempAlreadyFreedError
10-
1110
from .runtime import LABEL_REQUIRED_MODULES, NAMESPACE, RUNTIME_LABELS
1211
from .runtime import Labels as RuntimeLabel
1312

1413
# List of modules (in alphabetical order) that, if included, should call MEM_INIT
1514
MEMINITS = {
16-
"alloc.asm",
15+
"mem/alloc.asm",
1716
"loadstr.asm",
1817
"storestr2.asm",
1918
"storestr.asm",

src/arch/z80/backend/runtime/core.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -195,7 +195,7 @@ class CoreLabels:
195195
CoreLabels.LTI16: "cmp/lti16.asm",
196196
CoreLabels.LTI8: "cmp/lti8.asm",
197197
CoreLabels.LTI32: "cmp/lti32.asm",
198-
CoreLabels.MEM_FREE: "free.asm",
198+
CoreLabels.MEM_FREE: "mem/free.asm",
199199
CoreLabels.MODF: "arith/modf.asm",
200200
CoreLabels.MODF16: "arith/modf16.asm",
201201
CoreLabels.MODI16: "arith/div16.asm",

src/arch/z80/optimizer/cpustate.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -410,9 +410,9 @@ def set(self, r: str, val: int | str | None) -> None:
410410

411411
if is_unknown8(val):
412412
val = f"{new_tmp_val()}{HL_SEP}{val}"
413-
assert is_num or is_unknown16(val) or is_label(val), (
414-
f"val '{val}' is neither a number, nor a label nor an unknown16"
415-
)
413+
assert (
414+
is_num or is_unknown16(val) or is_label(val)
415+
), f"val '{val}' is neither a number, nor a label nor an unknown16"
416416

417417
self.regs[r] = val
418418
if is_16bit_composed_register(r): # sp register is not included. Special case

src/lib/arch/zx48k/runtime/array/arrayalloc.asm

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11

2-
#include once <calloc.asm>
2+
#include once <mem/calloc.asm>
33

44

55
; ---------------------------------------------------------------------

src/lib/arch/zx48k/runtime/array/arraystrfree.asm

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
; HL = Pointer to start of array in memory
33
; Top of the stack = Number of elements of the array
44

5-
#include once <free.asm>
5+
#include once <mem/free.asm>
66

77
push namespace core
88

src/lib/arch/zx48k/runtime/asc.asm

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
; Returns the ascii code for the given str
2-
#include once <free.asm>
2+
#include once <mem/free.asm>
33

44
push namespace core
55

src/lib/arch/zx48k/runtime/chr.asm

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
; CHR$(x, y, x) returns the string CHR$(x) + CHR$(y) + CHR$(z)
22
;
33

4-
#include once <alloc.asm>
4+
#include once <mem/alloc.asm>
55

66
push namespace core
77

@@ -76,4 +76,3 @@ __CHR_END:
7676
ENDP
7777

7878
pop namespace
79-

src/lib/arch/zx48k/runtime/io/keyboard/inkey.asm

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
; containing the string.
44
; An empty string otherwise.
55

6-
#include once <alloc.asm>
6+
#include once <mem/alloc.asm>
77

88
push namespace core
99

src/lib/arch/zx48k/runtime/letsubstr.asm

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
; => Not 0 if HL must be freed from memory on exit
88
; TOP -3 B$ address
99

10-
#include once <free.asm>
10+
#include once <mem/free.asm>
1111

1212
push namespace core
1313

@@ -155,4 +155,3 @@ __FREE_STR:
155155
ENDP
156156

157157
pop namespace
158-

src/lib/arch/zx48k/runtime/load.asm

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#include once <free.asm>
1+
#include once <mem/free.asm>
22

33
#ifndef HIDE_LOAD_MSG
44
# include once <print.asm>

0 commit comments

Comments
 (0)