cancel
Showing results for 
Search instead for 
Did you mean: 

error in asm math routines?

bernat_f
Associate II
Posted on September 22, 2009 at 12:55

error in asm math routines?

3 REPLIES 3
bernat_f
Associate II
Posted on September 22, 2009 at 09:35

Hi, I need to make a division of two longs so I used the application notes of asm math routines but even writing the same instructions as the example I get the following error:

***Demo.asm(2554): as1 : Error 54: Can't match Addressing mode ' sla {dividend+3}

it seems that I can use this addresing mode to move values like ''ld X,{dividend+3}'' but I can't use a direct instruction like in the example, perhaps I made something worng in the declaration of values?, it's the following:

WORDS

segment byte at 200-27F 'ram1'

.tempquot DS.B 4 ;4bytes

.quotient DS.B 2 ;

.dividend DS.B 4 ;4bytes

[ This message was edited by: bernat on 22-09-2009 13:06 ]

fggnrc
Associate II
Posted on September 22, 2009 at 12:49

The SLA instruction can only operate on short addresses, i.e. addresses which are one byte long.

The assembler can't translate your instruction because there isn't an opcode for something like

SLA $209

regards

EtaPhi

bernat_f
Associate II
Posted on September 22, 2009 at 12:55

ok, thanks for the answer, then I will make it in a different way.

but this means that there is a mistake on that application note, someone should correct it.