14 * function genAnd() and genOr() in z80/gen.c
15 * were not prepared to handle the special case where ifx == 0
18 void void_tand1(char x
)
20 char y
= (identity(x
) & 1) ? 42 : 43;
23 void void_tand0(char x
)
25 char y
= (identity(x
) & 0) ? 42 : 43;
28 void void_txor1(char x
)
30 char y
= (identity(x
) ^ 1) ? 42 : 43;
33 void void_txor0(char x
)
35 char y
= (identity(x
) ^ 0) ? 42 : 43;
40 * function genOr() in z80/gen.c
41 * assumed identity of "or a, literal" and "or a,a"
42 * that's definitely not so
47 char y
= (identity(x
) | 1) ? 42 : 43;
53 char y
= (identity(x
) | 0) ? 42 : 43;
59 char y
= (identity(x
) & 1) ? 42 : 43;
65 char y
= (identity(x
) & 0) ? 42 : 43;
71 char y
= (identity(x
) ^ 1) ? 42 : 43;
77 char y
= (identity(x
) ^ 0) ? 42 : 43;
82 * mcs51 segmentation fault
84 * function genOr() in mcs51/gen.c
85 * was not prepeared for ifx==0
88 void void_tor1(char x
)
90 char y
= (identity(x
) | 1) ? 42 : 43;
93 void void_tor0(char x
)
95 char y
= (identity(x
) | 0) ? 42 : 43;
100 char y
= (identity(x
) | x
) ? 42 : 43;
113 ASSERT(tor1(1) == 42);
114 ASSERT(tor1(0) == 42);
115 ASSERT(tor0(1) == 42);
116 ASSERT(tor0(0) == 43);
117 ASSERT(tand1(1) == 42);
118 ASSERT(tand1(0) == 43);
119 ASSERT(tand0(1) == 43);
120 ASSERT(tand0(0) == 43);
121 ASSERT(txor1(1) == 43);
122 ASSERT(txor1(0) == 42);
123 ASSERT(txor0(1) == 42);
124 ASSERT(txor0(0) == 43);