31 | x | x | x | x | x | impossible
*/
-struct s {
- char m[100];
-} a;
-
+char sc[100];
+char* sc_pointers[100];
char c;
int main(int argc, char **argv)
return 0;
}
+/* Source address modes */
+
void load_01(void)
{
- c = a.m[0];
+ c = sc[0];
}
void load_03(void)
{
- c = a.m[1];
+ c = sc[1];
}
void load_16(char* base)
void load_17(int base)
{
- c = a.m[base];
+ c = sc[base];
}
void load_18(char* base)
void load_19(int base)
{
- c = a.m[base + 1];
+ c = sc[base + 1];
}
void load_20_add(char* base, int index)
c = base[4 * index];
}
-void load_21_add(int index)
+void load_21_add(int base, int index)
{
- c = a.m[2 * index];
+ c = sc[base + 2 * index];
}
-void load_21_shift(int index)
+void load_21_shift(int base, int index)
{
- c = a.m[4 * index];
+ c = sc[base + 4 * index];
}
void load_22_add(char* base, int index)
c = base[4 * index + 1];
}
-void load_23_add(int index)
+void load_23_add(int base, int index)
{
- c = a.m[2 * index + 1];
+ c = sc[base + 2 * index + 1];
}
-void load_23_shift(int index)
+void load_23_shift(int base, int index)
{
- c = a.m[4 * index + 1];
+ c = sc[base + 4 * index + 1];
}
void load_24(char* base, int index)
void load_25(int base, int index)
{
- c = a.m[base + index];
+ c = sc[base + index];
}
void load_26(char* base, int index)
void load_27(int base, int index)
{
- c = a.m[base + index + 1];
+ c = sc[base + index + 1];
+}
+
+/* Destination address modes */
+
+void store_immediate_01(void)
+{
+ sc_pointers[0] = sc + 42;
+}
+
+void store_immediate_03(void)
+{
+ sc_pointers[1] = sc + 42;
+}
+
+void store_immediate_16(char** base)
+{
+ base[0] = sc + 42;
+}
+
+void store_immediate_17(int base)
+{
+ sc_pointers[base] = sc + 42;
+}
+
+void store_immediate_18(char** base)
+{
+ base[1] = sc + 42;
+}
+
+void store_immediate_19(int base)
+{
+ sc_pointers[base + 1] = sc + 42;
+}
+
+void store_immediate_20_add(char** base, int index)
+{
+ base[2 * index] = sc + 42;
+}
+
+void store_immediate_20_shift(char** base, int index)
+{
+ base[4 * index] = sc + 42;
+}
+
+void store_immediate_21_add(int base, int index)
+{
+ sc_pointers[base + 2 * index] = sc + 42;
+}
+
+void store_immediate_21_shift(int base, int index)
+{
+ sc_pointers[base + 4 * index] = sc + 42;
+}
+
+void store_immediate_22_add(char** base, int index)
+{
+ base[2 * index + 1] = sc + 42;
+}
+
+void store_immediate_22_shift(char** base, int index)
+{
+ base[4 * index + 1] = sc + 42;
+}
+
+void store_immediate_23_add(int base, int index)
+{
+ sc_pointers[base + 2 * index + 1] = sc + 42;
+}
+
+void store_immediate_23_shift(int base, int index)
+{
+ sc_pointers[base + 4 * index + 1] = sc + 42;
+}
+
+void store_immediate_24(char** base, int index)
+{
+ base[index] = sc + 42;
+}
+
+void store_immediate_25(int base, int index)
+{
+ sc_pointers[base + index] = sc + 42;
+}
+
+void store_immediate_26(char** base, int index)
+{
+ base[index + 1] = sc + 42;
+}
+
+void store_immediate_27(int base, int index)
+{
+ sc_pointers[base + index + 1] = sc + 42;
}