View Full Version: Will the real opcode 0x92 please come forward

camerahacks >>Applications / Developers >>Will the real opcode 0x92 please come forward


<< Prev | Next >>

zapped- 07-30-2005
Will the real opcode 0x92 please come forward
If someone is looking at http://www.ece.neu.edu/info/vhdl/class/actual/FullDocument.htm they may think they can doBR0 3,offset to branch if the negative bit of the program status register is not set, however the pv2devkit assembler is looking for BNN offset and the v8sim and v8dis both represent it as BPL offset

daBass- 07-30-2005

BNN (Branch Not Negative), BPL (Branch if PLus), BR0 3,offset (Branch if bit 3 is not set). They all say the same thing to me :-).

radarman- 07-30-2005

Bottom line? They all are. Looking at the opcode chart, $90 corresponds to BR0 (branch if flag is NOT set) $92 would correspond to BR on PSR#2, which is the NEGATIVE flag. So, BNN OFFSET would be a correct interpretation, as would BR0 3,OFFSET. BPL would indicate that the branch should be taken if the result is positive. More accurately, it would branch if the previous calculation did not set the negative flag. (which is also true if the answer was zero) I would suggest BNN is the better opcode symbol, as BPL is a bit ambiguous. It will branch on a zero result as well as positive results. However, in a sense, all are technically correct. -radarman

Forumer™ is Voted #1 Free Forum Hosting provider
Build your own community today with the largest message board hosting company.