[Coco] 6809 CC Reg Overflow bit

Gene Heskett gheskett at shentel.net
Tue Nov 6 19:41:18 EST 2018


On Tuesday 06 November 2018 18:40:33 Neil Cherry wrote:

> On 11/06/2018 06:24 PM, Gene Heskett wrote:
> > On Tuesday 06 November 2018 17:58:22 Brendan Donahe wrote:
> >> Ok, dumb followup question then - if those 100s and 200s are
> >> decimal (I see no $) then why is this an overflow?  Is overflow for
> >> a signed byte?
> >
> > I think so, v is set (I think) if the result is >127, for 2's
> > complement math. This also explains the need for the SEX, or sign
> > extend instruction, something the C compiler goes crazy with.
>
> I think I had it wrong:
>
>
> .a400
> 0400 0000       NEG   $00	lda #100
> 0402 0000       NEG   $00	adda #100
> 0404 0000       NEG   $00	adda #100
> 0406 0000       NEG   $00	nop
> 0407 0000       NEG   $00	nop
> 0408 0000       NEG   $00	.
> .r
> X=0000 Y=0000 U=0000 S=0400 A=00 B=00 D=00 C=00
> P=0400 LDA   #$64
> .p
> X=0000 Y=0000 U=0000 S=0400 A=64 B=00 D=00 C=00
> P=0402 ADDA  #$64
> .p
> X=0000 Y=0000 U=0000 S=0400 A=C8 B=00 D=00 C=0A
> P=0404 ADDA  #$64
> .p
> X=0000 Y=0000 U=0000 S=0400 A=2C B=00 D=00 C=01
> P=0406 NOP
> .
>
> This is from the sbc09 emulator, I grabbed a copy and tossed it on my
> Linux box. C=0A (Negative set, Overflow set) then C=01 (Negative
> cleared, Overflow cleared).
>
> Sorry too many asm languages. :-)

I have to agree Neil. I was comfy writing asm (w/o an assembler) on an 
RCA 1802 way back in the late 70's and wrote a video production utility 
that the last time I checked, was still in use 17 years later, many 
times a day. In a tv control room thats equ to a couple of eons.  
Strange architecture but it made sense. The only other asm was the 6x09. 
Nothing else even comes close to making sense except the ti 9900 once 
you get your head into it, but it was a really strange design. I never 
really did get into it. Too expensive to get enough hardware lined up to 
write for it.


-- 
Cheers, Gene Heskett
--
"There are four boxes to be used in defense of liberty:
 soap, ballot, jury, and ammo. Please use in that order."
-Ed Howdershelt (Author)
Genes Web page <http://geneslinuxbox.net:6309/gene>


More information about the Coco mailing list