[Coco] 6809 CC Reg Overflow bit

Neil Cherry ncherry at linuxha.com
Tue Nov 6 18:07:12 EST 2018


On 11/06/2018 05:14 PM, Salvador Garcia via Coco wrote:
> Hi all. I am reading William Barden's Assembly Language for the Color Computer and on
> the bottom of page 57 he presents the following code <snipped>:
> 
> LDA #100 ADDA #100   100 + 100 = 200  = V!
> 
> Then on the second paragraph below the code he states:
> 
> 
> "... The first ADD added an immediate 100 to the 100 in the A register for a result of
> 200. This is an overflow condition, and the V Condition Code should have been set to a
> 0, indicating no overflow:"
> 
> If the V Condition Code is set to a 1 to indicate overflow, and the 100 + 100 op caused
> an overflow, why is he saying that the V Condition code is set to a 0?
> 
> Am I missing something? As always, thanks! Salvador

I think this is unfortunate wording, it is my understanding that:

    100 +  100 =  200 (decimal)
   0x64 + 0x64 = 0xC8 (A is an 8 bit reg)

is not an overflow condition. Sorry about the extra comments my brain
like hex better than decimal when dealing with asm.

-- 
Linux Home Automation         Neil Cherry       ncherry at linuxha.com
http://www.linuxha.com/                         Main site
http://linuxha.blogspot.com/                    My HA Blog
Author of:    	Linux Smart Homes For Dummies


More information about the Coco mailing list