Compiler Overview


CH Basic is a tool which simplifies the development, writing and debugging programs for Microchip PIC microcontrollers for the PIC12, 14 & 16 series. Instead of writing in PIC assembly language you can reduce time by writing in CH Basic which contains a subset of standard basic instructions along with some specific instructions for the PIC microcontroller. Using CH Basic as a tool for writing programs has the following benefits:


It's not necessary to learn PIC assembly instructions.Even if you have no knowledge of PIC assembly language you can write programs for PIC microcontrollers which can be used for any purpose. If you have some knowledge of PIC assembly language, it is possible to enter direct assembly code into the basic program using the in-line assembly function.

Great reduction in the time it takes to write programs for PIC microcontrollers

PIC microcontrollers have a RISC type core. This means it has a smaller number of instructions which execute faster, which makes the program execute faster. This is one of the benefits. A drawback is that the programs are longer than with a CISC microcontroller. With a RISC processor any complex operation requires the programmer to write more assembly instructions than with a CISC processor. The only arithmetic instructions available on the 12 & 16 series PIC's are addition and subtraction. This means a lot of programming for the assembly level programmer. CH Basic will allow the programmer achiev his goal in much shorter time.

Once the basic program is compiled, simply import it into Microchips freely available MPASM or MPLAB, and you're ready to program the PIC using your preffered programming device.

Ideal educational tool

Would you like to learn PIC assembly language and the relation between a higher level language and assembly ?

CH Basic is an ideal solution ! As soon as you enter a line of basic, the compiler immediately interprets the code and translates it into the equivalent assembly instructions which make up that basic instruction. Every change in basic code will be updated in the assembly code in real time.

Simple and intuitive instructions

The basic instructions that are used are simple, clear and similar to the spoken language in contrast to the cryptic assembly language. Entering instructions and the user interface itself are intuitive and made so that they are suitable for both beginners and professionals. Beginners will prefer to use the instruction buttons, which will reduce syntax errors. More advanced programmers will use the keyboard for entering basic code. Finally, professionals will use their preferred text editor, and use CH Basic for compiling the code.

Neater code which makes it easier to debug

A basic program is much smaller than the assembly program. Therefore it is neater and easier to understand. This makes it easier to debug and find various parts of the program.


Support for Microchip PIC12, PIC14 and PIC16 series microcontrollers.

8-bit and 16-bit signed and unsigned data types.

Addition, subtraction, multiplication, division, relational and logic operations for all supported data typesSupport for in-line assembly code.

Automatic setting of the correct bank and page.

Basic commands for I/O port operation.

User Interface

The screen is divided into several parts. On the left are the buttons which are used for entering the appropriate basic instructions. The instructions can also be entered from the menu or by typing on the keyboard. When using the keyboard, you can directly The basic window is the central part. There the whole basic program is listed. On the right is the assembly window. The appropriate assembly code is listed in this window. These windows are updated in real time after the entry of any instruction. The status window is on the top right. Here, information is displayed regarding the type of PIC chosen, the number of basic and assembly lines and the percentage of used program and data memory for the chosen PIC.

Specifications :

Basic Instructions:


Data types: 8-bit signed & unsigned integer, 16-bit signed & unsigned integer.

The compiler supports expressions containing all 4 data types.

The following relational operators are supported:
>, <, >=, <=, <>, =.

The following logical operations are supported:
& (and), | (or), ~(xor), !(not).

Bank and page issues are automatically resolved.

In-line assembly code is supported.
You can use PIC assembly instructions, but assembler directives are not supported.

(c) 2000-2021 - Celestial Horizons Pty. Ltd.

Home page