|
|
1.1 ! root 1: /* ! 2: * UAE - The Un*x Amiga Emulator ! 3: * ! 4: * MC68000 emulation - machine dependent bits ! 5: * ! 6: * Copyright 1996 Bernd Schmidt, Samuel Devulder ! 7: */ ! 8: ! 9: ! 10: struct flag_struct { ! 11: /* tricky: be sure that bit-offset(x)=bit-offset(c) in word representation. */ ! 12: /* This depends heavily on the bit-order and the compiler used. I am not */ ! 13: /* sure the generated code is better than uae-0.6.1 */ ! 14: int :12; /* First word */ ! 15: unsigned int n:1; ! 16: unsigned int z:1; ! 17: unsigned int v:1; ! 18: unsigned int c:1; ! 19: ! 20: int :15; /* Second word */ ! 21: unsigned int x:1; ! 22: }; ! 23: ! 24: extern struct flag_struct regflags; ! 25: ! 26: #define ZFLG (regflags.z) ! 27: #define NFLG (regflags.n) ! 28: #define CFLG (regflags.c) ! 29: #define VFLG (regflags.v) ! 30: #define XFLG (regflags.x) ! 31: ! 32: static __inline__ int cctrue(const int cc) ! 33: { ! 34: switch(cc){ ! 35: case 0: return 1; /* T */ ! 36: case 1: return 0; /* F */ ! 37: case 2: return !CFLG && !ZFLG; /* HI */ ! 38: case 3: return CFLG || ZFLG; /* LS */ ! 39: case 4: return !CFLG; /* CC */ ! 40: case 5: return CFLG; /* CS */ ! 41: case 6: return !ZFLG; /* NE */ ! 42: case 7: return ZFLG; /* EQ */ ! 43: case 8: return !VFLG; /* VC */ ! 44: case 9: return VFLG; /* VS */ ! 45: case 10:return !NFLG; /* PL */ ! 46: case 11:return NFLG; /* MI */ ! 47: case 12:return NFLG == VFLG; /* GE */ ! 48: case 13:return NFLG != VFLG; /* LT */ ! 49: case 14:return !ZFLG && (NFLG == VFLG); /* GT */ ! 50: case 15:return ZFLG || (NFLG != VFLG); /* LE */ ! 51: } ! 52: abort(); ! 53: return 0; ! 54: } ! 55:
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.