----- Original Message ----- From: "Norman Dunbar" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Friday, January 17, 2003 11:30 AM Subject: RE: [ql-users] Assembly question
Norman, could it be you have some problems with signs??? > Interesting question - and code ! > > harpo equ $160 > chico equ $140 > elem_size equ $0c > > clr.l a1 A1 = 0 > moveq.l #4,d2 > lea harpo(a1),a1 A1 = A1 + $160 = $160 > myloop: > adda.w elem_size,a1 A1 = A1 + (5 * $0c) = $19c > dbra d2,myloop > > lea chico-4*elem_size(a1),a1 A1 = $140 - $19c + (4 * $0c) > = $140 - $1cc Would this not be $140 - (4 * $0c) + $19c ??? > BUT it depends upong how good your assembler is, does it do expressions > evaluation correctly so that the multiplication is done before the addition, > or does it do it in-line ? Very good point !! Bettr not to make to many assumptions ! > My answer above shows what it should be (!) assuming correct precedence, > but if the assembler is in-line, then it will be : Joachim
