Ok, I've run into this dilemma:
First off, I'm writing an NES emulator (obviously)
I originally thought that it was none of our business to worry about what notation the ROM/Programmer is using during any instruction (one's complement, two's complement, decimal notation, etc.). I realized this when I had to manipulate the processor status flag after an instruction and I was checking bits etc.
But heres where stuff confuses me. I came across an instruction:
0x10 0xfb
0x10 is Branch on N = 0.
But branching is the part I don't understand: how do I intrepret 0xfb? Do I convert it to twos complement and then add it to the program counter? Do I just intrpret it AS-IS? Is 0xfb signed or unsigned? Its confusing the hell out of me, and I don't know how the ROM wants me to branch.
Much Appreciated.
First off, I'm writing an NES emulator (obviously)
I originally thought that it was none of our business to worry about what notation the ROM/Programmer is using during any instruction (one's complement, two's complement, decimal notation, etc.). I realized this when I had to manipulate the processor status flag after an instruction and I was checking bits etc.
But heres where stuff confuses me. I came across an instruction:
0x10 0xfb
0x10 is Branch on N = 0.
But branching is the part I don't understand: how do I intrepret 0xfb? Do I convert it to twos complement and then add it to the program counter? Do I just intrpret it AS-IS? Is 0xfb signed or unsigned? Its confusing the hell out of me, and I don't know how the ROM wants me to branch.
Much Appreciated.