mirror of
https://gitlab.com/camelot/kickc.git
synced 2025-08-09 20:25:17 +00:00
19 lines
424 B
C
19 lines
424 B
C
// Test declaring a variable as "memory", meaning it will be stored in memory and accessed through an implicit pointer (using load/store)
|
|
// Test a memory variable struct value
|
|
|
|
struct foo {
|
|
char thing1;
|
|
char thing2;
|
|
};
|
|
|
|
notregister __mem struct foo bar = { 'a', 'b' };
|
|
|
|
void main(void) {
|
|
struct foo* barp = &bar;
|
|
const char* SCREEN = 0x0400;
|
|
char i=0;
|
|
SCREEN[i++] = barp->thing1;
|
|
SCREEN[i++] = barp->thing2;
|
|
|
|
}
|