This project provides an assembly compiler (in the sense that generates mips32 assembly) for a basic and hig-level limited domain specific language (DSL). To execute the "pic" code you will still need the assembler provided in MPLAB IDE.
Currently the language supports the following features.
Define the value 1/0 of the leds:
LDn = < 1 | 0 >;
where n is the number of the pin
See the leds.pic in the pics directory.
Creating infinite loop:
loop{
...
}
See the loop.pic in the pics directory.
Time delay:
DELAY(<secs in int value>);
See the delay.pic in the pics directory.
Assigning switches to leds:
LD0 = SW0;
In this way the led behaviour will change accordingly to the switch. See the switches.pic in the pics directory.
It's possible change program flow by checking the value of the switch:
IF (SW0) {
...
}
See the if.pic in the pics directory.
- Run the
Makefilewithmake. - ./pic <pic-file> <dst-asm-file>