mirror of
https://gitlab.com/camelot/kickc.git
synced 2025-08-08 13:25:12 +00:00
28 lines
448 B
C
28 lines
448 B
C
// Test effective live range and register allocation
|
|
// Here main::c, outsw::c and outw::c can all have the same allocation
|
|
|
|
const char* SCREEN = 0x0400;
|
|
char idx = 0;
|
|
|
|
void main() {
|
|
for(char c: 0..39 ) {
|
|
outsw(c);
|
|
}
|
|
}
|
|
|
|
void outsw(char c) {
|
|
out('-');
|
|
outw(c);
|
|
}
|
|
|
|
char[] HEXTAB = "0123456789abcdef";
|
|
|
|
void outw(char c) {
|
|
out(HEXTAB[c<<4]);
|
|
out(HEXTAB[c&0x0f]);
|
|
}
|
|
|
|
void out(char c) {
|
|
idx++;
|
|
SCREEN[idx] = c;
|
|
} |