risc-v-tlm/C/stdlibs/stdlibs.c

18 lines
244 B
C
Raw Normal View History

2018-09-21 15:26:02 +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++;
}
}
void main(void) {
char msg[50];
print("hello");
sprintf(msg, "%i", 5);
}