It is currently Mon Dec 11, 2017 11:45 pm

All times are UTC - 7 hours





Post new topic Reply to topic  [ 4 posts ] 
Author Message
 Post subject: asm6 1.6 released
PostPosted: Thu Nov 04, 2010 10:37 am 
Offline
User avatar

Joined: Mon Sep 27, 2004 8:33 am
Posts: 3715
Location: Central Texas, USA
Loopy has just posted an update to asm6 that incorporates several improvements I made:
  • PowerPC (big-endian) and 64-bit compatible.
  • Includes Dwedit's error-overload prevention code.
  • Supports quiet mode with -q, which prints nothing unless there's an error. Useful for scripts.
  • Returns non-zero exit status unless there are NO errors AND output file was successfully generated. This allows scripts to catch any errors, rather than thinking they have a valid file.
  • It's now an error to include extra arguments, rather than just warning.
  • All file writing is now checked for errors, including the final fclose().
  • Generates fewer compiler warnings, and avoids non-portable things like (char*)1.
If you see any problems or differences in output, please post here so I can look into it. If possible, try assembling your project with this version and the previous, and be sure the output files are exactly the same.


Top
 Profile  
 
 Post subject:
PostPosted: Thu Nov 04, 2010 10:49 am 
Offline
User avatar

Joined: Fri Nov 19, 2004 7:35 pm
Posts: 3968
I found a bug in ASM6. After adding a "JSR somelabel" to a label which appears later in the source file, some stuff involving the current address $ breaks. I would add ".org $" as a workaround, and that worked.

Edit:

So I'm using a series of INCBINS to make a patch.
When I have a construct like this:
Code:
$ = $8000
   OLDADDR = $

   $ = $6000
   incbin FILE.bin , $ - $6000, $70D2 - $
   ;some data here
   incbin FILE.bin , $ - $6000, $7461 - $
     LDA #$74
     jsr SomeLabel
   incbin FILE.bin , $ - $6000

   $ = OLDADDR + $ - $6000
.org $BAC0
   incbin FILE2.bin  , $ - $BAC0, $C000 - $
.org $C000

I get an error in the last incbin line. The error goes away if I put ".org $" after the jsr SomeLabel.

_________________
Here come the fortune cookies! Here come the fortune cookies! They're wearing paper hats!


Top
 Profile  
 
 Post subject:
PostPosted: Thu Nov 04, 2010 4:42 pm 
Offline
User avatar

Joined: Mon Sep 27, 2004 8:33 am
Posts: 3715
Location: Central Texas, USA
OK, I think I might have found the cause. It seems that the boolean dependant is set to true by eval() when the expression involves a label not yet defined. And apparently, eval() doesn't clear dependant otherwise, instead relying on the caller to do so. So sprinkled throughout the source are dependant=0 lines. I believe that there should be one of those in incbin(). I inserted one after seekpos=0 and it appears to work now. Doing .org $ has the side-effect of clearing dependant, and thus making incbin() work as well. Might be a good idea for me to add an extra fresh_eval() or something that clears dependant first, and then use that wherever dependant is cleared first.

BTW, this bug was in the previous version as well. I guess I was most interested in any bugs I introduced into the new version, but I might as well address others as well...


Top
 Profile  
 
 Post subject:
PostPosted: Thu Nov 04, 2010 5:03 pm 
Offline
User avatar

Joined: Fri Nov 19, 2004 7:35 pm
Posts: 3968
I'm surprised you were able to fix something in the jumbled spaghetti mess which is ASM6. :)

_________________
Here come the fortune cookies! Here come the fortune cookies! They're wearing paper hats!


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 4 posts ] 

All times are UTC - 7 hours


Who is online

Users browsing this forum: No registered users and 7 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron
Powered by phpBB® Forum Software © phpBB Group