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




All times are GMT -5. The time now is 06:52 AM.