1
0
mirror of https://gitlab.com/camelot/kickc.git synced 2024-11-26 12:49:21 +00:00

Added missing c-file.

This commit is contained in:
jespergravgaard 2020-06-05 17:02:38 +02:00
parent 60f344fd5f
commit 709039de87

View File

@ -0,0 +1,24 @@
// Demonstrates problems with local labels overwriting global labels
// This should produce "abca" - but produces "abcc" because the local variable containing "c" overrides the global variable containing "a"
void main () {
print("a");
print("b");
print1();
}
void print1() {
print("c");
print("a");
}
// Screen pointer and index
char* const SCREEN = 0x0400;
char idx = 0;
void print(char* msg) {
while(*msg)
SCREEN[idx++] = *msg++;
}