23 March 2022, 19:46 | #1 |
Registered User
Join Date: Jun 2009
Location: United States
Posts: 57
|
vasm - Use defined object code in macros/expressions?
I'm currently working on simplifying my workflow and was wondering if something like this is possible.
Code:
SomeLabel: dc.b $3f ;Can this value be used in expressions? INCBIN "data.bin" ;Same as above, but externally sourced, so no constants SomeValue = INCBIN "data.bin" ;Obviously doesn't work, but it's basically what I'm trying to do I know that macros can retrieve the decimal/hex value of SomeLabel, but I don't know if they can retrieve the data present *at* SomeLabel. I know it would be easy if the data is always a constant that's directly present in code, but if I'm loading data via INCBIN then I'm not sure if it's possible. Thanks for any insight! |
24 March 2022, 01:18 | #2 | ||
Natteravn
Join Date: Nov 2009
Location: Herford / Germany
Posts: 2,537
|
No. A symbol, like
SomeLabel, is either an absolute number (equate) or a label (memory address). You can make your macro generate code, which reads and permutates data at SomeLabel, but that would execute only at run-time. Quote:
Quote:
data.binyou could generate a source file data.inclike this: Code:
SomeValue = $3f include "data.inc"and use SomeValuein your macros? But maybe you can give some more details? There may be other ways to help you, if we knew what you are trying to achieve. |
||
24 March 2022, 01:38 | #3 |
Registered User
Join Date: Jun 2009
Location: United States
Posts: 57
|
Thank you for your help. It was more of a curiosity rather than something I'm stuck on. The use case that first came to mind was to generate mirrored versions of sprites. Right now, I run my sprites through a script to generate mirrored versions, but I thought if I could do it in vasm using an expression (a very long one), I could eliminate that step. I know it sounds silly! It might make more sense to mirror the sprites at runtime anyway, and save myself the disk space.
|
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
Thread Tools | |
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
About VASM expressions | JuanLuis | Coders. Asm / Hardware | 6 | 07 June 2020 10:28 |
vasm/mot: macros | sparhawk | Coders. Asm / Hardware | 8 | 06 January 2020 18:32 |
Macros for debugging in VASM | mcgeezer | Coders. Asm / Hardware | 11 | 14 May 2019 15:27 |
does VASM support a pre-defined symbol identifying itself | Apollo | Coders. Asm / Hardware | 2 | 09 December 2013 16:07 |
Help linking VASM object code | clenched | Coders. Asm / Hardware | 2 | 24 May 2013 22:32 |
|
|