Hi guys!
Wonder what you guys think of my code. Its purpose is to convert the value in register d7 to its absolute value:
Code:
swap d7 ; fetch x-acceleration
tst.w d7 ; test if negative
smi d4 ; Yes? Set d4
ext.w d4 ; create polarity converter
eor d4,d7 ; convert polarity (if x-acc is negative)
d7 is loaded with one longword-operation prior to this code, and contains x- (upper word) and y-acceleration (lower word) of a given sprite object. Code works. But this code is repeatedly executed a few times during one frame [in Reshoot Proxima 3], and I have a feeling that this can be optimized for speed. Any thoughts?