EASy68K
http://easy68k.com/EASy68Kforum/

how are relative branches handled in Easy68k
http://easy68k.com/EASy68Kforum/viewtopic.php?f=5&t=1323
Page 1 of 1

Author:  hancock [ Mon May 26, 2014 9:56 am ]
Post subject:  how are relative branches handled in Easy68k

Hi,

I am unclear how branches are assembled: I find branches assembled with 2 bytes, but also many with 4 Bytes, although 2 bytes would be possible.
And I could not find any flag to influence this behavior ("optimize" or "always use smallest instruction length" or the like) so I had to force a 2 bytes assembly by putting "Bcc.S" in lots of cases.

Can you please give some hints how the decisions is taken whether or not a branch will be assembled wit 2 of 4 bytes?

Thanks in advance

Author:  profkelly [ Mon May 26, 2014 4:10 pm ]
Post subject:  Re: how are relative branches handled in Easy68k

Bcc.S to force short branch.
Bcc.L to force long branch.

If no size designation is specified, the assembler will automatically optimize backward branches but not forward branches.

Author:  hancock [ Mon May 26, 2014 5:07 pm ]
Post subject:  Re: how are relative branches handled in Easy68k

Oh thanks - this criteria (backwards vs. forward) did not come to my mind. Would such an "optimizing flag" be an item for the wishlist? :-)

Rgds

Author:  profkelly [ Mon May 26, 2014 7:58 pm ]
Post subject:  Re: how are relative branches handled in Easy68k

Adding optimization of forward branches would require major modifications to the assembler. You may add it to the wish list but it is not something that I will have time to implement. Perhaps someone else will take up the challenge.

Author:  hancock [ Mon May 26, 2014 8:11 pm ]
Post subject:  Re: how are relative branches handled in Easy68k

Thanks, interesting; anyway, it was meant to be more a feedback than a requirement.
Just struggled with a 5000 lines listing and in this case it would have saved quite some time :-)
Next time some awk-script will do the remaining job, if the code size really justifies it.

Rgds

Page 1 of 1 All times are UTC
Powered by phpBB® Forum Software © phpBB Group
http://www.phpbb.com/