Joachim Van der Auwera makes some magical things to make me read
} >
} > ...
} > tst.l d2
} > beq.s first_place
} > second_place:
} > ...
} >
} > Now, if d2 is 0, would executing that code reach first_place or
} second_place ?
} > (I have my idea, but I do not want to influence the audience).
}
} Is this a trick question? Given that you haven't actually maked the label
} first_place it may just depend on where you put that.
No, no tricky thing. I did not show first_place to simplify, but
you can be sure that it exist (let's say, a few bytes later, like that;
first_place:
...
(ok, you have to lineup the previous code with that one))
} In general, the "tst x" instruction is the same as "cmp #0,x", so if d2 is
} zero, the branch will be taken.
Ok, Thanks. That's what I was thinking, but I wasn't 100% sure, and I need that 100%
for what I'm doing!
Also, if you do not mind, another (tricker ?) question:
harpo equ $160
chico equ $140
elem_size equ $0c
clr.l a1 ; (just to fixe a1 to 0 for the question,
; irrelevant "how to" if illegal)
; but once a1 has been modified, we cannot have it back
; to THIS value
moveq.l #4,d2
lea harpo(a1),a1
myloop:
... ; use a1 but keep it
adda.w elem_size,a1
... ; use a1 but keep it
dbra d2,myloop
lea chico-4*elem_size(a1),a1
Question: what is the value of a1 at the end ?
(I also have my idea, but I do not want to influence yet!)