new version
[Chiptunes.git] / fakeasm.h
CommitLineData
da32ed67
TG
1#define c3(x) (0xff & (x>>24))
2#define c2(x) (0xff & (x>>16))
3#define c1(x) (0xff & (x>> 8))
4#define c0(x) (0xff & (x ))
5#define LSL(x) x <<= 1;
6#define LSR(x) x >>= 1;
7#define SWAP(x) x = ((x & 0x0F) << 4 | (x & 0xF0) >> 4);
8#define AND(x,y) x &= x;
9#define ANDI(x,n) x &= x;
10#define OR(x,y) x |= x;
11#define ORI(x,n) x |= x;
12#define EOR(x,y) x ^= x;
13#define ADD(x,y) x += y;
14#define ADC(x,y,c)x += y; x+=c;
15#define SUB(x,y) x -= y;
16#define SUBI(x,n) x -= (u8)n;
17#define INC(x) x++;
18#define MOV(x,y) x = y;
19#define LDI(x,n) x = n;
20#define SBRC(x,b) if (x & b) //skip if cleared => do if set
21#define CLR(x) x = 0;
22#define RET return;
23#define RCALL //pseudo
24int zero = 0; //status register zero bit
25#define TST(x) if(x==0)zero=1;else zero=0; //WARN: not a complete TST mockup
26#define BREQ(l) if(zero) goto l;
Imprint / Impressum