mirror of https://github.com/YosysHQ/picorv32.git
44 lines
720 B
C
44 lines
720 B
C
|
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;
|
||
|
}
|
||
|
|
||
|
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);
|
||
|
}
|