mirror of
https://github.com/mi57730/a2d.git
synced 2024-11-29 07:49:20 +00:00
PARAM_BLOCK macro: Save/Restore org manually
The `.feature org_per_seg` approach worked, but listing files had incorrect addresses following the end of the segment. Manually stash and restore the org at the end of the block. Also, add in a dec16.
This commit is contained in:
parent
8e5504f6bc
commit
a285a7413b
14
macros.inc
14
macros.inc
@ -441,6 +441,15 @@
|
||||
skip:
|
||||
.endmacro
|
||||
|
||||
;;; Decrement 16-bit value
|
||||
.macro dec16 arg
|
||||
.local skip
|
||||
lda arg
|
||||
bne skip
|
||||
dec arg+1
|
||||
skip: dec arg
|
||||
.endmacro
|
||||
|
||||
;;; Helper macros to set up a scoped block of parameters at a pre-determined
|
||||
;;; address.
|
||||
;;;
|
||||
@ -462,15 +471,16 @@ skip:
|
||||
.macro PARAM_BLOCK name, addr
|
||||
name := addr
|
||||
.scope name
|
||||
saved_org := *
|
||||
.pushseg
|
||||
.bss
|
||||
.feature org_per_seg
|
||||
.org addr
|
||||
start:
|
||||
start := *
|
||||
.endmacro
|
||||
|
||||
.macro END_PARAM_BLOCK
|
||||
size := * - start
|
||||
.popseg
|
||||
.org saved_org
|
||||
.endscope
|
||||
.endmacro
|
||||
|
Loading…
Reference in New Issue
Block a user