> Hello, >=20 > Some time ago I wrote an Insertion sort algorithm for Mid-range PICs and= =20 > today decided to optimize it as much as possible. For this I need to=20 > load the negative value of an address of a variable. Using 'movlw 0 -=20 > var' or 'addlw 0 - var', where var is a file register is not accepted by= =20 > MPASM, and 'Error[151] : Operand contains unresolvable labels or is too=20 > complex' is issued. >=20 > Currently I found 2 workarounds - one needs an extra instruction to=20 > convert the loaded address to a negative number, and the other defines=20 > an absolute address of 'var' in RAM and then a precalculated negative=20 > value of that address is used in the code. >=20 > Both of these do not seem right, so I'm searching for a trick to negate=20 > the address of 'var' in the preprocessor, without triggering an error. >=20 The preprocessor doesn't know the address of var. /Ruben =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D Ruben J=F6nsson AB Liros Electronic Box 9124 200 39 Malm=F6 Sweden www.liros.se Tel +46 40142078 =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --=20 http://www.piclist.com/techref/piclist PIC/SX FAQ & list archive View/change your membership options at http://mailman.mit.edu/mailman/listinfo/piclist .