View Single Post
Old 08 September 2020, 11:08   #1
meynaf
son of 68k
 
meynaf's Avatar
 
Join Date: Nov 2007
Location: Lyon / France
Age: 51
Posts: 5,323
shortest way to set z=0 in ccr

Hello, just some small question.

Very often i return ccr's z bit as boolean in my routines. This spares tst instructions.
Of course i could just use moveq but there is not always a data register available.
For setting z=1 no problem : cmp.b d0,d0 does the trick. Changing other ccr bits is no big deal in most cases.
If i didn't care about code size i could use simple andi.b #$fb,ccr but code size is important to me and this instruction is large (and not very readable either).
No assumption can be made about other register contents, as it needs to be a macro used everywhere. So we can't count on D0-D7/A0-A6 being nonzero.

So to set z=0 with single code word the only solution i found is tst.l a7 but this is 020+ and it looks real weird (even if a7 can hardly ever be 0, can it ?).

Any other idea ? Any coding trick i missed ?
meynaf is online now  
 
Page generated in 0.04461 seconds with 11 queries