From: Tobias Girstmair Date: Tue, 13 Nov 2018 16:51:54 +0000 (+0100) Subject: new version X-Git-Tag: attiny9~71 X-Git-Url: https://git.gir.st/Chiptunes.git/commitdiff_plain/c3639d5b8a3f9e357d35eb9b720e7dfc83c6f6f2?hp=8d8c00e4909d9744682e557833a0a7abb071fb90;ds=sidebyside new version --- diff --git a/fakeasm.h b/fakeasm.h index cfb4598..cffa6d8 100644 --- a/fakeasm.h +++ b/fakeasm.h @@ -29,3 +29,6 @@ int asmtmp = 0; #define ROL(x) asmtmp = x>>7; x <<= 1; x |= carry; carry = asmtmp; #define ROR(x) asmtmp = x&0x1; x >>= 1; x |= carry<<7; carry = asmtmp; #define NEG(x) x *= -1; +int sr_neg = 0; +#define CPI(x,n) sr_neg = (x-n < 0); //WARN: not a complete CPI mockup +#define BRPL(l) if (sr_neg) goto l; diff --git a/foo.c b/foo.c index f227598..1265e77 100644 --- a/foo.c +++ b/foo.c @@ -41,7 +41,10 @@ void mod3(void) { LSR (tmp) ANDI (Ml, 0x03) ADD (Ml, tmp) - if (Ml > 2) Ml = Ml - 3; //TODO + CPI (Ml, 3) + BRPL (skip) + Ml = Ml - 3; //TODO + skip:; #undef tmp } void g(void) {