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

Re: [MiNT] TAS in GFA Linker

Lonny Pursell <atari@bright.net> writes:

> ;original code
>     tas    (a1)
>     bpl.s  label
> ;alternate code    
> temp:       dc.w 0    ;add this somewhere or use a free register if you can
>     move.b  (a1),temp ;copy the byte in question (previous value)
>     bset    #7,(a1)   ;clobber bit 7 as tas would do
>     tst.b   temp      ;set Z and N based on prev value like tas
>     bpl.s   label     ;original branch instruction unchanged

This wouldn't be interrupt safe.  Testing N after tas is equivalent to
testing Z after bset #7, so no need for testing the whole byte.


Andreas Schwab, schwab@linux-m68k.org
GPG Key fingerprint = 58CA 54C7 6D53 942B 1756  01D3 44D5 214B 8276 4ED5
"And now for something completely different."