mirror of
https://gitlab.com/camelot/kickc.git
synced 2024-06-03 07:29:37 +00:00
00df07b7bf
- Treat global variables of libraries, as part of the .asm library .namespace. - Fix bugs. - Assign meaningful struct names to .asm internal variables and labels. (Remove the $x notation).
23 lines
443 B
C
23 lines
443 B
C
#pragma encoding(screencode_mixed)
|
|
#pragma var_model(zp)
|
|
|
|
#include <print_lib_asm.h>
|
|
|
|
#include <plus_lib_asm.h>
|
|
#include <min_lib_asm.h>
|
|
|
|
#include <printf.h>
|
|
|
|
__export volatile char r; // Ensure that r does not get deleted by the optimizer by exporting it.
|
|
|
|
void main() {
|
|
clrscr();
|
|
r = 10;
|
|
r = plus(r, 2);
|
|
r = min(r, 1);
|
|
r = plus(r, 30);
|
|
r = plus(r, 11);
|
|
r = plus(r, min(r, 40));
|
|
|
|
printf("main r = %u\n", r);
|
|
} |