Monday, March 9, 2009

Macros

Good progression this far! All the op-codes are now implemented. I have written more C macros than I ever thought I would do, but with 151 op codes with similar contents it really helps! I still need to go through them all to make sure they act correctly on flags, but I am able to run more and more advanced programs. It was very nice to see a nestled loop with software BRK-interrupts to work properly!

Some things still puzzle me. Why should the JSR instruction store only PC+2 (JSR uses 3 bytes) on stack and RTS add that one byte again? Especially since interrupts store the correct address to next instruction, so that RTI can directly read it to PC. If someone reads this and knows, please tell!

Another 6502 based beauty, the Apple II.

No comments:

Post a Comment