1
0
mirror of https://github.com/RevCurtisP/C02.git synced 2024-11-30 23:50:04 +00:00
C02/work/define.c02
2018-08-11 00:18:23 -04:00

28 lines
551 B
Plaintext

/* Test C02 define directive */
#pragma origin 1000
#define TRUE $FF
#define FALSE 0
#define BITS %01010101
#define ZED 'Z'
enum {SOLO};
enum {ZERO, ONE, TWO, THREE, FOUR, FIVE, SIX, SEVEN, EIGHT, NINE, TEN};
const char b = {#TRUE, #FALSE};
char c, i;
const char f = #FALSE;
const char t = #TRUE;
char zed;
//b = #TRUE; ***Error: Illegal use of const variable 'B'
const char nums = {#ZERO, #ONE, #TWO, #THREE, #FOUR, #FIVE, #SIX, #SEVEN, #EIGHT, #NINE, #TEN};
for (i=#ZERO; i<#TEN; i++) {
c = (i = nums[i]) ? #TRUE : #FALSE;
putdec(c);
}