The Rat - C-- compiler for AVR

Trolll's picture
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 1


The Rat compiler is an attempt to create a C-- like language for AVR.



You can look at the Rat compiler as an almost classic assembler language with a C preprocessor. All code can be written in almost "ordinary" assembler. 

In addition to assembly instructions, more human-readable variants from C-like languages can be used. 

The language allows you to declare expressions, loops and complex conditions just like in C, while manipulating machine registers.


The Rat compiler can generate both ready-made machine code (in hex or binary format) as well as an assembly listing in AVR GCC format (S-file). The first mode allows you to write all the code entirely in Rat, the second mode allows you to use Rat together with C (to write only critical sections of the code on Rat).


Also in the archive with the compiler there is a plugin for syntax highlighting in NetBeans 8.2 (see file /misc/netbeans/ru-trolsoft-therat-avr.nbm).


More details about the syntax of the language can be found on the project page.

You can also see a few examples included in the package.