First Spear Posted December 25, 2021 Share Posted December 25, 2021 Hey all. Merry Christmas to everyone that is celebrating! I built a dummy .bas file with 96 lines that look like this: Data $25 , $0 , $0 , $0 , $0 , $0 , $0 , $0 , $0 , $0 , $0 , $0 , $0 , $0 , $0 , $0 , $0 , $0 , $0 , $0 , $0 , $0 , $0 , $0 , $0 , $0 , $FFFF I then replaced the $0 with $9 and saved to a new file with lines that look like this: Data $25 , $9 , $9 , $9 , $9 , $9 , $9 , $9 , $9 , $9 , $9 , $9 , $9 , $9 , $9 , $9 , $9 , $9 , $9 , $9 , $9 , $9 , $9 , $9 , $9 , $9 , $FFFF I then replaced with $FFFF so the lines look like this: Data $25 , $FFFF , $FFFF , $FFFF , $FFFF , $FFFF , $FFFF , $FFFF , $FFFF , $FFFF , $FFFF , $FFFF , $FFFF , $FFFF , $FFFF , $FFFF , $FFFF , $FFFF , $FFFF , $FFFF , $FFFF , $FFFF , $FFFF , $FFFF , $FFFF , $FFFF , $FFFF When compiling the different programs first ASM is 330,501 bytes, second is 330,705 bytes, third is 368,768 bytes first LST 753,514 bytes, the second is 753,718 bytes, third is 771,781 bytes Final bin/cfg are the same exact size at 8,180 bytes in each. Does this mean that when the ROM fully compiles, binary size is based on the count of Words but not the values in the Words, so a $0 $9 $FFFF all take the same space? Or does it mean that my test is not meaningful enough, and I need to add something else to properly test? I am asking because my project will be easier to code if ROM storage is a constant. I have some sound data that is anywhere between 5 and 43 Words. I have 150+ lines of sound data. If I can make all of the sound data 43 Words, it will be easy to jump to a wanted sound with VARPTR. Thanks. Quote Link to comment Share on other sites More sharing options...
carlsson Posted December 25, 2021 Share Posted December 25, 2021 1 hour ago, First Spear said: so a $0 $9 $FFFF all take the same space? Yes, every DATA statement translates into a DECLE which is the assembler's way to store a word (remember decle comes from 10 bits, but nowadays we can store all 16 bits). You could use DATA PACKED to store two bytes (0-255) into one word if you want to save space, but it seems like you want to have a constant size of data so knowing that every value is stored as 16 bit probably is what you really want to hear. The reason that ASM and LST files vary in size is because those contain a copy of your source code that obviously is three characters bigger for each $0 that you replace by $FFFF. 2 Quote Link to comment Share on other sites More sharing options...
+DZ-Jay Posted December 26, 2021 Share Posted December 26, 2021 @carlsson already provided the full context of the answer, but in short: the size of the ROM is determined solely on the number of words it takes to store it. For code, it depends on the size of the opcodes to which each instruction assembles; and for data, it depends on the number of 16-bit words it takes to store it. dZ. 1 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.