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.
> Use a `set if condition' instruction:
>
> cmp.w whatever,whatever
> seq d0 ; set d0.b to $FF if equal, $00 otherwise
> ext.w d0 ; extend to word: d0.w = $FFFF or $0000
> sub.w d0,x ; add $0001 (=sub $FFFF) or $0000 (=sub $0000)
>
> Of course there are `sne', `sgt', `sle', `shi', `slo', etc ... too.
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?
-Scott
Follow-Ups:
References: