Motorola Opcode Question
#1
Motorola Opcode Question
I want to error trap a value to make sure its not too big or too small.
If I load Acc A with say 100 dec and then add another 200 dec to it, I think this sets the overflow bit? I could then branch with either either BVC (overflow clear) or BVS (overflow set). IS this correct?
I know if I go below zero the carry bit is set, its just I have never used overflow commands before.
If I load Acc A with say 100 dec and then add another 200 dec to it, I think this sets the overflow bit? I could then branch with either either BVC (overflow clear) or BVS (overflow set). IS this correct?
I know if I go below zero the carry bit is set, its just I have never used overflow commands before.
#2
When you add or subtract add the sum is greater then 255 or the difference is less than 0 then the carry bit is set. For your example you would use BCC to jump around inscrutions on how to deal with the number greater than 255. Usually you would load 255 into the accumulator.
HTH
John
HTH
John
#3
I understand what you are saying. Basically if you are less than zero or higher than 255 the carry bit is set. I guess if the carry gets set after an additon then I went over 255 and if the carry is set after a subtraction then the value went below zero.
What is overflow for then? I am looking through Grand National code and the BVC opcode is used only once in the whole car after some 1's complement operation that I don't fully understand.
What is overflow for then? I am looking through Grand National code and the BVC opcode is used only once in the whole car after some 1's complement operation that I don't fully understand.
Thread
Thread Starter
Forum
Replies
Last Post