>> It's probably easiest if you use parameterized #DEFINEs to define >> the shift-and-AND operations for each byte-position... Then you can >> just say: >> >> MOVLW LSB2(MYCONT) >> >> or whatever. >> >> By the way, it's best to use shift-and-AND macros instead of LOW and >> HIGH... In at least some versions of M >> > >Thanks for the reply, Andy. > >One phrase I didn't understand was "parameterized #DEFINEs". Can >you give me an example? hi Mike the #define - 'string substition engine' is a real powerful feature of MPASM, but apparently there is a bug with >> more than 15 bits see code snipped below, both #define are identical, but only one works. 00004 #define BYTE_2(a) (a >> 16) & 0xFF 00005 #define BYTE_2x(a) (a >> 8 >> 8) & 0xFF 00006 12345678 00007 mylong_thing = 0x12345678 00008 0000 3048 00009 movlw BYTE_2(mylong_thing) ; ^ this one messes up MPASM 1.40 bug??? 0001 3034 00010 movlw BYTE_2x(mylong_thing) ; ^ this one works fine antti -- Silicon Studio Ltd. -- http://www.sistudio.com