Jump to content
IGNORED

Display Remaining Rom Space


Recommended Posts

Is there some way to have disam display how much rom space remains everytime you compile your homebrew? I remember someone saying something allong the lines of:

echo "bytes free:" *-$F800

But thatonly produces garbage output. Any assistance in this matter would be greatly appreciated.

 

Sincerely,

 

Primordial Ooze

Link to comment
Share on other sites

You can do something like this:

 

 

 ECHO ([$FF00-*]d), "bytes free"

 ORG $FF00

;code continues

 

 

That will print the number of bytes left (in decimal). DASM will print it twice though, and if you have multiple banks it gets kind of ugly. One solution is to wrap each echo statement inside an IF statement, and have the condition that defined after the echo statement.

 

What happens is the first pass DASM doesn't know if the IF statement is true or false, so it doesn't execute it. On the second pass the IF statement is resolved, and DASM executes it, so it only prints once, not twice. Example:

 

 

 IF ECHO_1
  ECHO ([$FF00-*]d), "bytes free bank 1"
 ENDIF

 ECHO_1 = 1
  

 ORG $FF00
;code continues

 

 

The address in your echo statement should match the address in the org statement after it, and if you have multiple ECHO statements give them all unique conditions (I called mine ECHO_1 in the above example, call yours whatever you like).

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