Initial checkin. Basic build and runtime environment, prior to first
test on actual hardware.
This commit is contained in:
18
main.c
Normal file
18
main.c
Normal file
@@ -0,0 +1,18 @@
|
||||
|
||||
#define U0THR (*((volatile unsigned char *) 0xE000C000)) /* UART0 transmitter holding register */
|
||||
#define U0LSR (*((volatile unsigned char *) 0xE000C014)) /* UART0 line status register */
|
||||
#define U0THRE ((U0LSR & (1<<5))) /* UART0 transmitter holding register is empty */
|
||||
|
||||
void putch(char c) {
|
||||
while (!U0THRE);
|
||||
U0THR = c;
|
||||
}
|
||||
|
||||
void putstr(char *s) {
|
||||
while (*s) putch(*s++);
|
||||
}
|
||||
|
||||
int main(void) {
|
||||
putstr("Your entire life has been a mathematical error... a mathematical error I'm about to correct!\n");
|
||||
return 0;
|
||||
}
|
||||
Reference in New Issue
Block a user