1
0
mirror of https://github.com/cc65/cc65.git synced 2024-06-07 23:29:39 +00:00

again, some TABs slipped into the code...

This commit is contained in:
Christian Groessler 2019-04-30 18:21:13 +02:00
parent 7b234d4497
commit 392e6e10fc
2 changed files with 43 additions and 43 deletions

View File

@ -2,54 +2,54 @@ static unsigned char val, val2;
static void act(const unsigned char op) { static void act(const unsigned char op) {
static const void * const arr[] = { static const void * const arr[] = {
&&op0, &&op0,
&&op1, &&op1,
&&op2, &&op2,
&&op3, &&op3,
&&op4, &&op4,
&&op5, &&op5,
&&op6, &&op6,
}; };
goto *arr[op]; goto *arr[op];
op0: op0:
val += 1; val += 1;
return; return;
op1: op1:
val += 2; val += 2;
return; return;
op2: op2:
val += 3; val += 3;
return; return;
op3: op3:
val2 += 1; val2 += 1;
return; return;
op4: op4:
val2 += 5; val2 += 5;
return; return;
op5: op5:
val2 += 7; val2 += 7;
return; return;
op6: op6:
val2 += 9; val2 += 9;
return; return;
} }
int main(void) { int main(void) {
val = val2 = 0; val = val2 = 0;
act(1); act(1);
act(3); act(3);
act(5); act(5);
return val == 2 && val2 == 8 ? 0 : 1; return val == 2 && val2 == 8 ? 0 : 1;
} }

View File

@ -1,21 +1,21 @@
static unsigned char val; static unsigned char val;
static void foo(void) { static void foo(void) {
val = 5; val = 5;
} }
static void wrap(void) { static void wrap(void) {
asm("lda #<%v", foo); asm("lda #<%v", foo);
asm("ldx #>%v", foo); asm("ldx #>%v", foo);
asm("jmp callax"); asm("jmp callax");
} }
int main(void) { int main(void) {
val = 0; val = 0;
wrap(); wrap();
return val == 5 ? 0 : 1; return val == 5 ? 0 : 1;
} }