[Coco] assembly language question.
devries.bob at gmail.com
Wed Feb 3 22:49:10 EST 2010
The 6809 CMP instruction can be either 8 bit or 16 bit. For 16 bit the
operation is: (quote)
Compares the 16-bit contents of the concatenated memory locations M:M+1 to
the contents of the specified register and sets the appropriate condition
codes. Neither the memory locations nor the specified register is modified
unless autoincrement or autodecrement are used. The carry flag represents a
borrow and is set to the inverse of the resulting binary carry.
Regards, Bob Devries
Soldier's Hills 2
Las Pinas City
Besides a mathematical inclination, an exceptionally good mastery of one's
native tongue is the most vital asset of a competent programmer.
Edsger W.Dijkstra, 18 June 1975
----- Original Message -----
From: "Arthur Flexser" <flexser at fiu.edu>
To: "CoCoList for Color Computer Enthusiasts" <coco at maltedmedia.com>
Sent: Thursday, February 04, 2010 2:00 PM
Subject: Re: [Coco] assembly language question.
> 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
> is greater than $0A by an unsigned comparison.
> 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
>> 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
>> 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
>> cmpx <LblName memory address in DP that holds the $000A above
>> blo somewhere else
>> 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
> Coco mailing list
> Coco at maltedmedia.com
More information about the Coco