Mad-Pascal
Mad-Pascal copied to clipboard
Phase error detection code safe to alter?
The block of code surrounding line #15308 in src\mp.pas appears to detect phase errors during the the assembly process. How safe is it to change the $120 to $1 so that there is no deviance between the current assembly pass and the previous pass? Is there a possibility Mads could get stuck in an endless loop flip/flopping an address calculation?
https://github.com/tebe6502/Mad-Pascal/blob/65e009feb12bb3b4b42317db9234c337515aaf66/src/mp.pas#L15308
I'm trying to output to a PGZ file format but it requires the known length of Mads' final .OBX file to be used in the file header written before the object file. I have all the extra code in place and inserted a new line after the Fastmul detection, line #15042, asm65('F256BINARYSIZE'#9'= * - CODEORIGIN');. However, with the $120 value in line #15308 the value is off by several bytes for my game. Changing the value to $1 resulted in an extra pass and the correct size calculation for a working PGZ file.
The value $120 is not random, for other values there may be an endless loop, it depends on the complexity of the example