Re: A89: Re: how to test 2 keys at once? and another question.


[Prev][Next][Index][Thread]

Re: A89: Re: how to test 2 keys at once? and another question.




On Tue, Apr 25, 2000 at 18:18:53 -0400, Scott Noveck wrote:
> 
> wow, I like that code so much I just had to write in and say so - I've
> always wondered what makes some of those opcodes useful, but how does this
> compare speed wise?

Assuming four clocks for memory reads:

	cmp	foo,bar
	seq	d0		; 6/4 (true/false)
	ext.w	d0		; 4
	sub.w	d0,d1		; 4
	; *** total = 14/12 clocks (added/did not)


	cmp	foo,bar
	bne.s	\dont_add_1	; 10/8 (jump/no jump)
	addq.w	#1,d1		; 4
\dont_add_1
	; *** total = 12/10 (added/did not)


/Johan



References: