new version
[Chiptunes-pms150c.git] / fakeasm.h
CommitLineData
42c6050e
TG
1int flag_z = 0;
2int flag_c = 0;
3//ignoring flag_ov, flag_ac
5ebb16dc 4#define MOV(dst, src) dst = src;
c004ed39
TG
5#define SL(dst) flag_c = (dst>>7); dst <<= 1;
6#define SR(dst) flag_c = (dst&01); dst >>= 1;
42c6050e
TG
7#define SWAP(dst) dst = (dst<<4 | dst>>4);
8#define AND(dst, src) dst &= src; flag_z = (dst==0);
9#define OR(dst, src) dst |= src; flag_z = (dst==0);
5ebb16dc 10#define CLEAR(dst) dst = 0;
7ad189e2 11#define ADD(dst, src) flag_c = (src+dst)>>8; dst += src; flag_z = (dst==0);
42c6050e
TG
12#define INC(dst) dst += 1; flag_c = flag_z = (dst==0);
13#define ADDC0(dst) dst += flag_c; flag_c = flag_z = (dst==0);
b2ed0598
TG
14#define CALL(addr) addr();
15#define XOR(dst, src) dst ^= src; flag_z = (dst==0);
16#define SUB(dst, src) flag_c = (src > dst); dst -= src; flag_z = (dst==0);
d17a26fd 17#define XCH(dst) acc ^= dst; dst ^= acc; acc ^= dst;
1d9b2eb7 18#define DEC(dst) dst -= 1; flag_c = flag_z = (dst==0);
abd85947 19#define NEG(dst) dst *= -1; flag_z = (dst==0);
23a7a348 20#define SET1(dst, n) dst |= 1<<n;
10b43527 21#define IDXM(dst, ix) dst = *(ix); //xxx: requires passing array+index
c8910ae3 22#define SRC(dst) dst >>= 1; dst |= flag_c<<7;
Imprint / Impressum