2018-10-07 04:19:29 +08:00
|
|
|
#include <stdio.h>
|
|
|
|
|
|
|
|
#define TRACE (*(unsigned char *)0x40000000)
|
|
|
|
|
|
|
|
void print(char *msg) {
|
|
|
|
int i = 0;
|
|
|
|
while(msg[i] != '\0') {
|
|
|
|
TRACE = msg[i];
|
|
|
|
i++;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2019-01-10 06:03:08 +08:00
|
|
|
int main(void) {
|
2018-10-07 04:19:29 +08:00
|
|
|
char msg[50];
|
2019-01-10 06:03:08 +08:00
|
|
|
print("hello\n");
|
2018-10-07 04:19:29 +08:00
|
|
|
sprintf(msg, "%i", 5);
|
2019-01-10 06:03:08 +08:00
|
|
|
print(msg);
|
|
|
|
|
|
|
|
asm volatile ("ecall");
|
|
|
|
|
|
|
|
return 0;
|
|
|
|
|
2018-10-07 04:19:29 +08:00
|
|
|
}
|