Jump to content
IGNORED

IntyBASIC and ROM Allocation with AS1600?


First Spear

Recommended Posts

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

  1. first ASM is 330,501 bytes, second is 330,705 bytes, third is 368,768 bytes
  2. first LST 753,514 bytes, the second is 753,718 bytes, third is 771,781 bytes
  3. 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.

 

 

 

 

 

 

 

 

Link to comment
Share on other sites

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.

  • Like 2
Link to comment
Share on other sites

@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.

  • Like 1
Link to comment
Share on other sites

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.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...