Skip to content

Latest commit

 

History

3 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Repository description

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.

Language support

Currently the language supports the following features.

pin definition

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.

infinite loop

Creating infinite loop:

loop{
    ...
}

See the loop.pic in the pics directory.

delay

Time delay:

DELAY(<secs in int value>);

See the delay.pic in the pics directory.

switches assignment

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.

if on switches

It's possible change program flow by checking the value of the switch:

IF (SW0) {
        ...
    }

See the if.pic in the pics directory.

How to run the program

  1. Run the Makefile with make.
  2. ./pic <pic-file> <dst-asm-file>

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages