[Coco] assembly language question.

Gene Heskett gene.heskett at verizon.net
Wed Feb 3 22:58:18 EST 2010


On Wednesday 03 February 2010, Arthur Flexser wrote:
>The example seems a bit unusual in that you're comparing a 16-bit quantity
>(the X register) with an 8-bit one (due to the use of the 'less than'
>sign).  I'm guessing that that would cause only the LSB of X ($FA) to be
>compared to <$000A (=$0A) with the outcome that the BLO no branch since $FA
>is greater than $0A by an unsigned comparison.
>
I don't believe so Art, the rmb for that label is 2 bytes, and a cmpx is a 16 
bit compare, so I believe it will also read label+1 for the lower byte of the 
cmp.  I have used 16 bit compares previously in some of my code and its still 
working as expected.  That '<' forces an access via the DP register, whose 
contents are used as the MSByte of an address and the labelname rmb as the 
LSByte of the read or write address.  Yeah, that is how highly optimized this 
code is, its reaching for every byte a second that it can handle.

>Art
>
>On Wed, Feb 3, 2010 at 9:10 PM, Gene Heskett 
<gene.heskett at verizon.net>wrote:
>> Greets all;
>>
>> I've read through the moto programmers manual for the 6809 for the cmp
>> functions, and am still confused.  The cmp function is a subtract
>> function where the answer is thrown away, only affecting the CC flags so
>> that a following beq or blo will take the correct jump.  But somehow, it
>> isn't clear
>> which is subtracted from what.
>>
>> Given that regs.x contains $02FA, and that the integer memory location
>> referenced by LblName contains $000A, will the blo take, or be ignored
>> here?
>>
>>        cmpx  <LblName memory address in DP that holds the $000A above
>>        blo     somewhere else
>>
>> Thanks.
>>
>> --
>> Cheers, Gene
>> "There are four boxes to be used in defense of liberty:
>>  soap, ballot, jury, and ammo. Please use in that order."
>> -Ed Howdershelt (Author)
>>
>> <cesarb> Damn, every time I spawn, qf-client-x11 locks hard
>> <Zoid> Don't die?
>> <Knghtbrd> good incentive.
>>
>> --
>> Coco mailing list
>> Coco at maltedmedia.com
>> http://five.pairlist.net/mailman/listinfo/coco
>
>--
>Coco mailing list
>Coco at maltedmedia.com
>http://five.pairlist.net/mailman/listinfo/coco
>


-- 
Cheers, Gene
"There are four boxes to be used in defense of liberty:
 soap, ballot, jury, and ammo. Please use in that order."
-Ed Howdershelt (Author)

I might have gone to West Point, but I was too proud to speak to a 
congressman.
		-- Will Rogers



More information about the Coco mailing list