... | ... |
@@ -11,19 +11,20 @@ THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES |
11 | 11 |
WITH REGARD TO THIS SOFTWARE. |
12 | 12 |
*/ |
13 | 13 |
|
14 |
+#define T *ptr |
|
15 |
+#define N *(ptr - 1) |
|
16 |
+#define L *(ptr - 2) |
|
17 |
+#define T2 (N << 8 | T) |
|
18 |
+#define H2 (L << 8 | N) |
|
19 |
+#define N2 (*(ptr - 3) << 8 | L) |
|
20 |
+#define L2 (*(ptr - 5) << 8 | *(ptr - 4)) |
|
21 |
+ |
|
14 | 22 |
/* Registers |
15 | 23 |
[ . ][ . ][ . ][ L ][ N ][ T ] < |
16 | 24 |
[ . ][ . ][ . ][ H2 ][ T ] < |
17 | 25 |
[ L2 ][ N2 ][ T2 ] < |
18 | 26 |
*/ |
19 | 27 |
|
20 |
-#define T *ptr |
|
21 |
-#define N *(ptr - 1) |
|
22 |
-#define L *(ptr - 2) |
|
23 |
-#define T2 PEEK2((ptr - 1)) |
|
24 |
-#define H2 PEEK2((ptr - 2)) |
|
25 |
-#define N2 PEEK2((ptr - 3)) |
|
26 |
-#define L2 PEEK2((ptr - 5)) |
|
27 | 28 |
#define HALT(c) { return emu_halt(u, ins, c, pc - 1); } |
28 | 29 |
#define FLIP { s = ins & 0x40 ? &u->wst : &u->rst; } |
29 | 30 |
#define SET(x, y) { r = s->ptr; if(x > r) HALT(1) r += (x & k) + y; if(r > 254) HALT(2) ptr = s->dat + r - 1; s->ptr = r; } |