From: Tobias Girstmair Date: Mon, 12 Nov 2018 23:11:46 +0000 (+0100) Subject: new version X-Git-Tag: attiny9~147 X-Git-Url: https://git.gir.st/Chiptunes.git/commitdiff_plain/cb4533d4555df03a6ce977d120787ef3fda63f42 new version --- diff --git a/fakeasm.h b/fakeasm.h index 6954a0f..4c15729 100644 --- a/fakeasm.h +++ b/fakeasm.h @@ -6,9 +6,9 @@ #define LSR(x) x >>= 1; #define SWAP(x) x = ((x & 0x0F) << 4 | (x & 0xF0) >> 4); #define AND(x,y) x &= y; -#define ANDI(x,n) x &= y; +#define ANDI(x,n) x &= n; #define OR(x,y) x |= y; -#define ORI(x,n) x |= y; +#define ORI(x,n) x |= n; #define EOR(x,y) x ^= y; #define ADD(x,y) x += y; #define ADC(x,y,c)x += y; x+=c; diff --git a/foo.c b/foo.c index c9fed96..a0c6eb2 100644 --- a/foo.c +++ b/foo.c @@ -7,7 +7,8 @@ int g(int i, u8 x, u8 t, u8 o) { SUBI (xxx, -51) xxx = (i*xxx) >> o; AND (xxx, x) - return ((3 & xxx)); + ANDI (xxx, 3) + return xxx; }; int main(void) {