asMSX bugfix 1: Ifs on .megarom

Published 2016-09-03 12:49:45

Hello!

Finally some improvements on asMSX. At the start of this project JamQue told me that he had issues using ifs when the “.megarom” clause is active. The issue correction can be seen here in Github.

The problem was that when generating a byte (for example, an LD instruction) it checks if it is able to generate it if the condition established for this level allows it.

Original:

guardar_byte(b)
{
if ((!conditional_level)||(conditional[conditional_level]))
if (type!=MEGAROM)
{
 ...some code...
}
if (type==MEGAROM)
{
 ...some code...
}

The first if will only affect the if(type!=MEGAROM) as it doesn’t provide brackets to define a block, therefore it will get only the next sentence. Also instead of doing if(type==MEGAROM) I just did an else.

Changes:

guardar_byte(b)
{
if ((!conditional_level)||(conditional[conditional_level])){
 if (type!=MEGAROM)
 {
  ...some code...
 }
 else
 {
  ...some code...
 }
}