2025-04-17 19:03:28 +08:00
|
|
|
#include "stdint.h"
|
|
|
|
|
|
|
|
|
|
|
|
#define PRINT_BASE_ADDR *(uint8_t *)0x40000000
|
|
|
|
|
|
|
|
int my_putc(int c) {
|
|
|
|
PRINT_BASE_ADDR = c;
|
|
|
|
return c;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
int my_puts(char *s) {
|
|
|
|
while (*s) {
|
|
|
|
my_putc(*s);
|
|
|
|
s++;
|
|
|
|
}
|
|
|
|
// for (int i = 0;i < 10;i++) {
|
|
|
|
// my_putc(*s);
|
|
|
|
// s++;
|
|
|
|
// }
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
2025-04-17 00:04:59 +08:00
|
|
|
|
|
|
|
|
2025-04-17 15:35:32 +08:00
|
|
|
int add(int a, int b) {
|
|
|
|
return a+b;
|
|
|
|
}
|
2025-04-17 00:04:59 +08:00
|
|
|
|
|
|
|
int main()
|
|
|
|
{
|
2025-04-17 19:03:28 +08:00
|
|
|
// int a=1;
|
|
|
|
// int b=2;
|
|
|
|
// int c = add(a, b);
|
|
|
|
my_puts("Hello World!\n");
|
|
|
|
return 0;
|
2025-04-17 00:04:59 +08:00
|
|
|
}
|