2
0

hello.c 511 B

12345678910111213141516171819202122232425262728293031323334
  1. #include <stddef.h>
  2. #include <stdint.h>
  3. #define IODEVB(d,r) (*(volatile uint8_t *)(0xfffffc00+((d) << 6)+((r) << 2)))
  4. #define LED IODEVB(0,0)
  5. #define CONSOLE IODEVB(1,0)
  6. void die(void)
  7. {
  8. while (1)
  9. ;
  10. }
  11. void _start(void)
  12. {
  13. static const char hello[] = "Hello, World!\r\n";
  14. const char *p;
  15. uint8_t led = 0;
  16. LED = led = 0;
  17. for (p = hello; *p; p++)
  18. CONSOLE = *p;
  19. while ( 1 ) {
  20. for (int x = 0; x < 1000000; x++)
  21. /* nothing */;
  22. LED = ++led;
  23. }
  24. die();
  25. }