picorv32/scripts/vivado/firmware.c

44 lines
720 B
C
Raw Normal View History

2015-07-08 20:48:14 -04:00
void putc(char c)
{
*(volatile char*)0x10000000 = c;
}
void puts(const char *s)
{
while (*s) putc(*s++);
}
void *memcpy(void *dest, const void *src, int n)
{
while (n) {
n--;
((char*)dest)[n] = ((char*)src)[n];
}
return dest;
}
2015-07-08 20:48:14 -04:00
void main()
{
char message[] = "$Uryyb+Jbeyq!+Vs+lbh+pna+ernq+guvf+zrffntr+gura$gur+CvpbEI32+PCH"
"+frrzf+gb+or+jbexvat+whfg+svar.$$++++++++++++++++GRFG+CNFFRQ!$$";
for (int i = 0; message[i]; i++)
switch (message[i])
{
case 'a' ... 'm':
case 'A' ... 'M':
message[i] += 13;
break;
case 'n' ... 'z':
case 'N' ... 'Z':
message[i] -= 13;
break;
case '$':
message[i] = '\n';
break;
case '+':
message[i] = ' ';
break;
}
puts(message);
2015-07-08 20:48:14 -04:00
}