/* Macros */ #define readb(s, a) s = zmem->(a) #define readw(s, a) @add zmem a sp; @aloads sp 0 s #define writeb(a, v) (zmem->(a)) = (v) #define writew(a, v) @add zmem a sp; @astores sp 0 v #define Fetch_operand(A, B) switch (operand_types-->(B)) \ { \ VAR: \ A = operands-->(B); \ if (A == 0) \ A = (zstack-->--sp) & $0000ffff; \ else if (A < $10) \ A = (zstack-->(fp + (A - 1))) & $0000ffff; \ else \ { \ A = A - $10; \ @aloads zglobals A A; \ } \ LC, SC: \ A = operands-->(B); \ default: \ print "[type: ", type, "; op_code: ", (hex) op_code, "]^"; \ print "[pc = ", pc, "; num_operands = ", num_operands, "]^"; \ fatalError("Attempt to fetch non-existent operand."); \ }