Today, I compiled simple C program with vbbc and then ran it on MARK-II successfully. So I finally have C compiler for my CPU!
Of course, there are a lot of bugs and there is plenty of work left, but, it simply works!
Next goals are:
- Port some C standard library (newlib?)
- Write peripheral library
- Improve CPU architecture to get better performance
- Find as many bugs as can and eliminate them.
Code that I ran is really simple:
#define TIME 0x2FFFF
static void delay(int time);
static unsigned int* DDRA = 0x101;
static unsigned int* PORTA = 0x100;
int main(){
*DDRA = 0xFF;
while(1){
*PORTA = 0xAA;
delay(TIME);
*PORTA = 0x55;
delay(TIME);
}
return 0;
}
static void delay(int time){
unsigned int i;
for(i = 0; i < time; i = i + 1);
}
It is hello world with LED. And I had a lot of problems with it. I discovered few bugs in emitting comparison code, I found out that loader isn't working correctly, and I spent a lot of time before I noticed I accidentally swap DDRA and PORTA registers addresses.
There is also link to commit that add vbcc into my project repository at github.
Discussions
Become a Hackaday.io Member
Create an account to leave a comment. Already have an account? Log In.