On 17 Jan 2003, at 11:04, Jerome Grimbert wrote: > > 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!)
Ignoring the adda error (should be adda #elem_size,A1) the result should be :original content of A1 + harpo + chico + elem_size. which, using your values would be $160+ $140 + $c = $2AC (in the loop, you add 5 times elem_size, deduct it 4 times later) Wolfgang