DIY PROM Do It Yourself PROM chip burning help. No PROM begging. No PROMs for sale. No commercial exchange. Not a referral service.

Motorola Opcode Question

Thread Tools
 
Search this Thread
 
Old 05-01-2004, 08:00 AM
  #1  
BJM
Junior Member
Thread Starter
 
BJM's Avatar
 
Join Date: Dec 2003
Posts: 46
Likes: 0
Received 0 Likes on 0 Posts
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.
Old 05-01-2004, 09:09 AM
  #2  
Member

 
32V_DOHC's Avatar
 
Join Date: Feb 2002
Posts: 156
Likes: 0
Received 0 Likes on 0 Posts
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
Old 05-01-2004, 12:53 PM
  #3  
BJM
Junior Member
Thread Starter
 
BJM's Avatar
 
Join Date: Dec 2003
Posts: 46
Likes: 0
Received 0 Likes on 0 Posts
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.
Related Topics
Thread
Thread Starter
Forum
Replies
Last Post
MustangBeater20
TBI
11
10-29-2022 09:20 PM
fasteddi
Organized Drag Racing and Autocross
15
09-10-2015 09:32 AM
Bubbajones_ya
Electronics
4
08-31-2015 12:02 PM
ezobens
DIY PROM
8
08-19-2015 10:29 PM
redmaroz
LTX and LSX
7
08-16-2015 11:40 PM



Quick Reply: Motorola Opcode Question



All times are GMT -5. The time now is 06:12 PM.