Skip to content

Commit 3b237d7

Browse files
committed
Move IDE/compiler ZP variables to it's own section.
This ensures that interpreter ZP locations don't change between versions.
1 parent 98eff7b commit 3b237d7

5 files changed

Lines changed: 5 additions & 4 deletions

File tree

compiler/fastbasic.cfg

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,7 @@ FORMATS {
4747

4848
SEGMENTS {
4949
ZEROPAGE: load = ZP, type = zp, optional = yes;
50+
IDEZP: load = ZP, type = zp, optional = yes;
5051
PREHEAD: load = PREMAIN, type = rw, optional = yes, define = yes;
5152
JUMPTAB: load = MAIN, type = ro, define = yes, align = $100;
5253
RUNTIME: load = MAIN, type = rw, define = yes;

src/actions.asm

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@ loop_stk = $400
108108
var_stk = $480
109109

110110
;----------------------------------------------------------
111-
.zeropage
111+
.segment "IDEZP": zeropage
112112
; Relocation amount
113113
reloc_addr: .res 2
114114
last_label_num: .res 1

src/memptr.asm

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@
3030
.exportzp prog_ptr, array_ptr, var_buf, var_ptr, mem_end
3131
.exportzp label_buf, label_ptr, laddr_buf, laddr_ptr, end_ptr
3232

33-
.zeropage
33+
.segment "IDEZP": zeropage
3434

3535
; End of program to parse
3636
end_ptr: .res 2

src/parse.asm

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@
4747
.import error_msg_list
4848
.importzp ERR_PARSE, ERR_NO_ELOOP, ERR_LABEL, ERR_TOO_LONG
4949

50-
.zeropage
50+
.segment "IDEZP": zeropage
5151
buf_ptr:.res 2
5252
bmax: .res 1
5353
pptr: .res 2

src/vars.asm

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ CIX = $F2
4040
INBUFF = $F3
4141

4242
; Our internal pointers:
43-
.zeropage
43+
.segment "IDEZP": zeropage
4444
name: .res 2
4545
var: .res 2
4646
len: .res 1

0 commit comments

Comments
 (0)