RobR, on Tue Mar 23, 2010 9:39 PM, said:
Then I added the -f3 switch and VOILA! It came up fine. Thanks, Michael.
You're welcome! The -f3 switch tells it to output a "raw" file, meaning it's just the compiled code, plus any "empty" space, between the address in the first ORG and the last address in the code. For example, if the first ORG starts the ROM at $F000, and the last address is $FFFF, that's 4K of ROM. If you leave off the -f switch, it defaults to -f1, which outputs two extra bytes in front of the ROM, to specify the starting address of the ROM in lo-byte/hi-byte order. So if the first ORG says to start at $F000, the first two bytes would be $00 and $F0, followed by the 4K ROM. Thus, the total size of the BIN would be 4098 bytes instead of 4096 bytes. Assuming the last six bytes all pointed to the same starting address, and assuming the emulator would read the first 4096 bytes and throw away the last two bytes, the start-up vector would still point to the same starting address, but all the code would be offset by two bytes, causing major problems.
Michael