Marcel Kilgus makes some magical things to make me read
} Jerome Grimbert wrote:
} > 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
} 
} This is probably not the code you wanted. It adds the word at memory
} address $000000c to a1, i.e. a # is missing.

Obviously!
Sorry for that missing # typo!

} 
} >         ...            ; 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!)
} 
} Disregarding the bug it's $160 + 5 * $0c + $140 - 4 * $0c
} = $160 + $120 + $0c = $28c.

Yes... looks like there is two concordants view for that ending value.
At least, I can be sure that the value of a1 is at least harpo+chico!
(which is not what should be, in the spirit of the code and expected data,
 but that's my problem now to solve.)

Reply via email to