# We cut corners and calculate stuff manually.
return bytearray.fromhex("09") + bytearray([len(token_list[1]) / 2]) + bytearray.fromhex(token_list[1])
- elif token_list[0] == "title":
+ elif token_list[0] == "or":
if s != 2:
syn_err("invalid number of arguments")
- return bytearray.fromhex("0A") + bytearray([len(token_list[1]) / 2 / 8]) + bytearray.fromhex(token_list[1])
+ # We cut corners and calculate stuff manually.
+ return bytearray.fromhex("0A") + bytearray([len(token_list[1]) / 2]) + bytearray.fromhex(token_list[1])
+ elif token_list[0] == "xor":
+ if s != 2:
+ syn_err("invalid number of arguments")
+
+ # We cut corners and calculate stuff manually.
+ return bytearray.fromhex("0B") + bytearray([len(token_list[1]) / 2]) + bytearray.fromhex(token_list[1])
+ elif token_list[0] == "not":
+ if s != 2:
+ syn_err("invalid number of arguments")
+
+ # We cut corners and calculate stuff manually.
+ return bytearray.fromhex("09") + bytearray.fromhex(token_list[1])
def pad_zero_r(x, c):
while len(x) < c:
#define OP_JMP 0x07
#define OP_REWIND 0x08
#define OP_AND 0x09
-#define OP_TITLE 0x0A
+#define OP_OR 0x0A
+#define OP_XOR 0x0B
+#define OP_NOT 0x0C
+
#define OP_NEXT 0xFF
#ifdef LOADER
}
code += *(code - 1);
break;
+ case OP_OR:
+ if (debug)
+ log("or\n");
+ code += 2;
+ if (!test_was_false) {
+ for (i = 0; i < *(code - 1); i++) {
+ *(current_mode->memory + offset) |= code[i];
+ }
+ offset += *(code - 1);
+ } else {
+ test_was_false = 0;
+ }
+ code += *(code - 1);
+ break;
+ case OP_XOR:
+ if (debug)
+ log("xor\n");
+ code += 2;
+ if (!test_was_false) {
+ for (i = 0; i < *(code - 1); i++) {
+ *(current_mode->memory + offset) ^= code[i];
+ }
+ offset += *(code - 1);
+ } else {
+ test_was_false = 0;
+ }
+ code += *(code - 1);
+ break;
+ case OP_NOT:
+ if (debug)
+ log("not\n");
+ if (!test_was_false) {
+ for (i = 0; i < *(code + 1); i++) {
+ *(current_mode->memory + offset) = ~*(current_mode->memory + offset);
+ }
+ offset += *(code + 1);
+ } else {
+ test_was_false = 0;
+ }
+ code += 2;
+ break;
case OP_NEXT:
if (debug)
log("next\n");