>Is there a way i can define names for porta,0 and porta,1 so that in the >code i can use the names, instead of the pin names? Then if i move something >around, all i need to do is change the name -> pin assignment and recompile, >instead of searching all the code for porta,0 etc. Sure! Use the #define function in MPLAB. The following is snipped from working code. Note that I define all bit variables with a leading underscore - this is *MY* convention and not required by MPLAB. To change the pin assignment for any i/o line, all I have to do is change the #define in ONE location. ; PORT A Device Bits note: ra 0,1 a/d inputs so no labels for them #define _MUXCLK RA,2 ; RA2, a/d ext mux clk out (active LO) #define _MUXRST RA,3 ; RA3, a/d ext mux reset out (active HI) #define _PBWR RA,4 ; RA4, "WRITE" button (active LO) #define _PBRD RA,5 ; RA5, "READ" button (active LO) RA_INIT EQU b'00010000' ; DDR_A EQU b'00110011' ; ddr: ra 2,3==out, ra 0,1,4,5==in DIPWRMSK EQU b'00010000' ; DIPRDMSK EQU b'00100000' ; ; PORT B Device Bits #define _IPCRXD RB,0 ; RB0, IPC data input (active LO) #define _IPCTXD RB,1 ; RB1, IPC data out (active HI) #define _DHTRLD RB,2 ; RB2, display heater LEDs data output #define _DSTAT RB,3 ; RB3, display status & inputs (bi-dir) #define _STROBE RB,4 ; RB4, ctrl, DipSw, disp str, eeprom !CS #define _SERCLK RB,5 ; RB5, ctrl, DipSw, display CLOCK #define _EECLK RB,6 ; RB6, eeprom clock #define _SERDAT RB,7 ; RB7, ctrl, DipSw, eeprom DATA (bi-dir) RB_INIT EQU b'00000001' ;initial port B data status DDR_B EQU b'10001001' ;ddr: rb 1,2,4,5,6==out, rb 0,3,7==in DDR_BLO EQU b'10001001' ;AND 0s force bits LO DDR_BHI EQU b'00000001' ;OR 1s force bits HI Hope this helps. dwayne Dwayne Reid Trinity Electronics Systems Ltd Edmonton, AB, CANADA (780) 489-3199 voice (780) 487-6397 fax Celebrating 15 years of Engineering Innovation (1984 - 1999) * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * Do NOT send unsolicited commercial email to this email address. My posting messages to Usenet neither grants consent to receive unsolicited commercial email nor is intended to solicit commercial email.