Friday, March 13, 2009

Total recall

First time ever syndome... When completing the flag handling and the decimal arithmetic mode I realized that my opcode implementations were inefficient. I had already used macros for such things as memory address decoding and memory retrieval, but still every opcode was around 4-6 lines of code, code that had to be correct and maintained. I have now rewritten it with better macros and the opcodes are now around 2-3 lines of code. The execution speed, mainly be using a more lazy flag approach, seems to be faster as well. Yesterday I implemented the decimal version of the ADC and ABC functions, allowing addition and subtraction decimally. I borrowed some idead, mainly the binary arithmetics, from Frodo here.

Plans now are to add a new thread to my emulator, allowing access to memory and registers during execution. I need something like that to test and debug my processor. 

After that I will implement some initial binary loading for my memory class. I should at least add a function that loads binaries to specified memory locations. There seems to be binary formats for this that I probably want to support as well. 

Good is that my CPU seems to be fully implemented! Now I need to investigate the rest!

No comments:

Post a Comment