Hi, I am create bit manipulation macros on 32bit registers, and assumed that I could use local variables and operators like this: ld macro adr, bit ; Load local y = bit / 8 ; btfsc adr+y,bit-(8*y) ; If Low skip bsf STACK,0 ; Else SET TOS endm My reasoning being if I say: ld clk,7 the macro will produce: y = 7 / 8 btfsc clk + 0, 7 - (8 * 0) and if I say: ld INP,14 the macro will produce: y = 14 / 8 btfsc clk + 1, 14 - (8 * 1) and : ld clk,10 ld clk+1,2 should give identical results When I use it I get no errors but the OBJ code is incorrect as per this partial listing: 00003 ld clk,10 0002 M local y = 10 / 8 ; 007E 1845 M btfsc clk+y,10-(8*y) ; If Low skip 007F 143F M bsf STACK,0 ; Else SET TOS 00004 ld clk+1,2 0000 M local y = 2 / 8 ; 0080 1944 M btfsc clk+1+y,2-(8*y) ; If Low skip 0081 143F M bsf STACK,0 ; Else SET TOS the first opcode is 0x1845 the second 0x1944, clearly not the same instruction on the same address. I have spent hours in the the MPLAB IDE Help file and am finding it confuses me even more :) and suggestions, a pointer to a macro tutorial? or a hint as to how to address bits in multi-byte registers. Thanks Chris -- http://www.piclist.com PIC/SX FAQ & list archive View/change your membership options at http://mailman.mit.edu/mailman/listinfo/piclist