jerod79 wrote:
Would you like to see the source code? I've found people have a better time understanding my problems with source code if they see it. It's also because I'm terrible at explaining my problems. In any case, I'm having a hard time conceptualizing how the branch instructions are to be implemented. I thought that it might be a simple matter of just using a move pseudoinstruction but that doesn't seem to work. I think it's little more involved than that(of course!). Maybe I have to have a couple subroutines or whatever you call them in MIPS.
It helps if you actually tell us, or even give us a hint of, what your problem actually
is.
You're proposing possible solutions above, but without any detail about where your confusion is coming from.
I'm assuming you're refering to how the 6502's branch instructions work. Basically, the operand to a branch instruction is an 8-bit, 2's-compliment signed offset from the
address following the branch instruction.
What this means is, if the condition tested by that branch instruction is true, it will
add the sign-extended offset operand to the current value of the program counter (remember: after fetching the offset byte, it points immediately after the branch instruction; therefore, if the branch instruction sits at $C000, the PC will point to $C002). Program execution will then resume at the new location. Otherwise, if the tested condition is false, it will continue execution immediately following the instruction ($C002 in my makeshift example above).
Does this help any?