[Coco] assembly language question.

jdaggett at gate.net jdaggett at gate.net
Wed Feb 3 22:16:21 EST 2010


Gene

The operation is always

R - M 

where R is the register and M is either a second register or memory. CCR is set according to 
the results and addressing mode. 

In your case the MPU would take $02FA and subtract $000A. The subtraction instruction will 
affect the N, Z, V or C bits. The BLO instruction tests the C bit and will issue a branch if and 
only if the CBIT = 1. In this case there is no borrow so the CBIT will be zero and no branch 
taken. 

james

On 3 Feb 2010 at 21:10, Gene Heskett 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





More information about the Coco mailing list