Skip to content

Commit 408d21f

Browse files
committed
Make LOAD to ignore BREAK
1 parent 153dc46 commit 408d21f

2 files changed

Lines changed: 36 additions & 1 deletion

File tree

library-asm/load.asm

Lines changed: 32 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,10 @@ HEAD1 EQU MEM0 + 8 ; Uses CALC Mem for temporary storage
2828
; PRINT routine
2929
TMP_HEADER EQU HEAD1 + 17 ; Temporary HEADER2 pointer storage
3030

31+
#ifdef __ENABLE_BREAK__
3132
LD_BYTES EQU 0556h ; ROM Routine LD-BYTES
33+
#endif
34+
3235
TMP_FLAG EQU 23655 ; Uses BREG as a Temporary FLAG
3336
3437
pop hl ; Return address
@@ -227,7 +230,35 @@ LOAD_END:
227230
pop ix ; Recovers stack frame pointer
228231
ld hl, (TMP_HEADER) ; Recovers tmp_header pointer
229232
jp MEM_FREE ; Returns via FREE_MEM, freeing tmp header
230-
233+
234+
#ifndef __ENABLE_BREAK__
235+
LOCAL LD_BYTES_RET
236+
LOCAL LD_BYTES_ROM
237+
LOCAL LD_BYTES_NOINTER
238+
239+
LD_BYTES_ROM EQU 0562h
240+
241+
LD_BYTES:
242+
243+
inc d
244+
ex af, af'
245+
dec d
246+
ld a, r
247+
push af
248+
di
249+
call 0562h
250+
251+
LD_BYTES_RET:
252+
; Restores DI / EI state
253+
ex af, af'
254+
pop af
255+
jp po, LD_BYTES_NOINTER
256+
ei
257+
258+
LD_BYTES_NOINTER:
259+
ex af, af'
260+
ret
261+
#endif
231262
ENDP
232263

233264

zxb.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -240,6 +240,10 @@ def main(args=None):
240240
OPTIONS.__DEFINES.value['__CHECK_ARRAY_BOUNDARY__'] = ''
241241
zxbpp.ID_TABLE.define('__CHECK_ARRAY_BOUNDARY__', lineno=0)
242242

243+
if OPTIONS.enableBreak.value:
244+
OPTIONS.__DEFINES.value['__ENABLE_BREAK__'] = ''
245+
zxbpp.ID_TABLE.define('__ENABLE_BREAK__', lineno=0)
246+
243247
OPTIONS.include_path.value = options.include_path
244248
OPTIONS.inputFileName.value = zxbparser.FILENAME = \
245249
os.path.basename(args[0])

0 commit comments

Comments
 (0)