How can I place variables in different banks?

TR 18037 standardized named address spaces, and MPC uses these to assist in placing variables in different banks.

In device header files, banks are declared like this:

0029 0047                         #pragma memory RAM bank0 [B0SIZE] @ B0START;
00A0 0050                         #pragma memory RAM bank1 [B1SIZE] @ B1START;
0110 0060                         #pragma memory RAM bank2 [B2SIZE] @ B2START;
0190 0060                         #pragma memory RAM bank3 [B3SIZE] @ B3START;

The SIZE and START symbols are calculated just above these declarations.

In your program, use the names as follows:

bank1 int8 one;
bank2 int8 two;
bank3 int8 three;

In previous versions of the compiler, the name came after the type:

int8 bank1 one;

...but this usage is deprecated.


The same goes for structures/enums/unions too, although you can simplify structures by declaring them separately from the implementing variables:

struct __mystruct {
  int a;
  int b;

bank2 struct __mystruct myvar;

I have an application developed with an old version. Will it compile properly with the latest version?

Yes. If you have written your program according to our recommended practices in the product documentation, upgrading should be seamless. All Byte Craft Limited Code Development Systems have backward compatibility with previous language constructs.

Please note:

  • Improvements in the compiler can alter the generated code; this may impact your testing.
  • Device header files may change between versions. If you've written customized device header files, they may require some revision. Simply examine the stock headers that we ship with the product.
  • Remember to recompile your libraries when you upgrade your Code Development System product. All libraries to be linked or included into a program must be compiled with the same compiler.

I use MPLAB-C. Can I upgrade to the latest version of MPC?

Byte Craft Limited developed MPC Code Development System as the first C compiler for Microchip PICmicros. MPLAB-C is a separate product developed by Microchip, who licensed the MPC source code from Byte Craft. The two products have been separately developed since the initial license.

Now that MPLAB-C is no longer supported by Microchip, Byte Craft is offering our normal upgrade pricing for the MPC Code Development System for any registered MPLAB-C customer. This is a substantial discount from our full list price for MPC. To get the discount, please specify your MPLAB-C serial number when you order MPC.

Pricing for MPC Code Development System is available from


There's more program data in my Intel Hex file than appears in the listing file. What is the extra data?

If you're working with MPC for a Microchip PIC, remember that the program words are longer than one byte. The extra size represents two bytes per instruction.


Who distributes your products?

See Distributors for an updated list of distributors.