diff --git a/CHANGELOG.md b/CHANGELOG.md index 7a71beb90..a7cea1212 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -9,6 +9,7 @@ All notable changes to this project will be documented in this file. ### Breaking Changed ### Changed +- Berry class `int64` made immutable ### Fixed diff --git a/lib/libesp32/berry_int64/src/be_int64_class.c b/lib/libesp32/berry_int64/src/be_int64_class.c index 4e06354ea..48dfc923a 100644 --- a/lib/libesp32/berry_int64/src/be_int64_class.c +++ b/lib/libesp32/berry_int64/src/be_int64_class.c @@ -62,22 +62,23 @@ int64_t* int64_fromstring(bvm *vm, const char* s) { } BE_FUNC_CTYPE_DECLARE(int64_fromstring, "int64", "@s") +// is the int64 within int32 range? +bbool int64_isint(int64_t *i64) { + return (*i64 >= INT32_MIN && *i64 <= INT32_MAX); +} +BE_FUNC_CTYPE_DECLARE(int64_isint, "b", ".") + int32_t int64_toint(int64_t *i64) { return (int32_t) *i64; } BE_FUNC_CTYPE_DECLARE(int64_toint, "i", ".") -void int64_set(int64_t *i64, int32_t high, int32_t low) { - *i64 = ((int64_t)high << 32) | ((int64_t)low & 0xFFFFFFFF); -} -BE_FUNC_CTYPE_DECLARE(int64_set, "", ".ii") - -int64_t* int64_fromu32(bvm *vm, uint32_t low) { +int64_t* int64_fromu32(bvm *vm, uint32_t low, uint32_t high) { int64_t* r64 = (int64_t*)be_malloc(vm, sizeof(int64_t)); - *r64 = low; + *r64 = low | (((int64_t)high) << 32); return r64; } -BE_FUNC_CTYPE_DECLARE(int64_fromu32, "int64", "@i") +BE_FUNC_CTYPE_DECLARE(int64_fromu32, "int64", "@i[i]") int64_t* int64_add(bvm *vm, int64_t *i64, int64_t *j64) { int64_t* r64 = (int64_t*)be_malloc(vm, sizeof(int64_t)); @@ -87,6 +88,14 @@ int64_t* int64_add(bvm *vm, int64_t *i64, int64_t *j64) { } BE_FUNC_CTYPE_DECLARE(int64_add, "int64", "@(int64)(int64)") +int64_t* int64_add32(bvm *vm, int64_t *i64, int32_t j32) { + int64_t* r64 = (int64_t*)be_malloc(vm, sizeof(int64_t)); + // it's possible that arg j64 is nullptr, since class type does allow NULLPTR to come through. + *r64 = *i64 + j32; + return r64; +} +BE_FUNC_CTYPE_DECLARE(int64_add32, "int64", "@(int64)i") + int64_t* int64_sub(bvm *vm, int64_t *i64, int64_t *j64) { int64_t* r64 = (int64_t*)be_malloc(vm, sizeof(int64_t)); // it's possible that arg j64 is nullptr, since class type does allow NULLPTR to come through. @@ -179,22 +188,90 @@ bbool int64_lte(int64_t *i64, int64_t *j64) { } BE_FUNC_CTYPE_DECLARE(int64_lte, "b", ".(int64)") +bbool int64_tobool(int64_t *i64) { + return *i64 != 0; +} +BE_FUNC_CTYPE_DECLARE(int64_tobool, "b", ".") + void* int64_tobytes(int64_t *i64, size_t *len) { if (len) { *len = sizeof(int64_t); } return i64; } BE_FUNC_CTYPE_DECLARE(int64_tobytes, "&", ".") -void int64_frombytes(int64_t *i64, uint8_t* ptr, size_t len, int32_t idx) { +int64_t* int64_frombytes(bvm *vm, uint8_t* ptr, size_t len, int32_t idx) { + int64_t* r64 = (int64_t*)be_malloc(vm, sizeof(int64_t)); if (idx < 0) { idx = len + idx; } // support negative index, counting from the end if (idx < 0) { idx = 0; } // sanity check if (idx > len) { idx = len; } uint32_t usable_len = len - idx; if (usable_len > sizeof(int64_t)) { usable_len = sizeof(int64_t); } - *i64 = 0; // start with 0 - memmove(i64, ptr + idx, usable_len); + *r64 = 0; // start with 0 + memmove(r64, ptr + idx, usable_len); + return r64; } -BE_FUNC_CTYPE_DECLARE(int64_frombytes, "", ".(bytes)~[i]") +BE_FUNC_CTYPE_DECLARE(int64_frombytes, "int64", "@(bytes)~[i]") + +/* + +def toint64(i) + if (type(i) == 'int') return int64.fromu32(i) end + if (type(i) == 'instance') && isinstance(i, int64) return i end + return nil +end + +*/ + +/******************************************************************** +** Solidified function: toint64 +********************************************************************/ +be_local_closure(toint64, /* name */ + be_nested_proto( + 4, /* nstack */ + 1, /* argc */ + 0, /* varg */ + 0, /* has upvals */ + NULL, /* no upvals */ + 0, /* has sup protos */ + NULL, /* no sub protos */ + 1, /* has constants */ + ( &(const bvalue[ 4]) { /* constants */ + /* K0 */ be_nested_str(int), + /* K1 */ be_nested_str(int64), + /* K2 */ be_nested_str(fromu32), + /* K3 */ be_nested_str(instance), + }), + &be_const_str_to64, + &be_const_str_solidified, + ( &(const binstruction[23]) { /* code */ + 0x60040004, // 0000 GETGBL R1 G4 + 0x5C080000, // 0001 MOVE R2 R0 + 0x7C040200, // 0002 CALL R1 1 + 0x1C040300, // 0003 EQ R1 R1 K0 + 0x78060004, // 0004 JMPF R1 #000A + 0xB8060200, // 0005 GETNGBL R1 K1 + 0x8C040302, // 0006 GETMET R1 R1 K2 + 0x5C0C0000, // 0007 MOVE R3 R0 + 0x7C040400, // 0008 CALL R1 2 + 0x80040200, // 0009 RET 1 R1 + 0x60040004, // 000A GETGBL R1 G4 + 0x5C080000, // 000B MOVE R2 R0 + 0x7C040200, // 000C CALL R1 1 + 0x1C040303, // 000D EQ R1 R1 K3 + 0x78060005, // 000E JMPF R1 #0015 + 0x6004000F, // 000F GETGBL R1 G15 + 0x5C080000, // 0010 MOVE R2 R0 + 0xB80E0200, // 0011 GETNGBL R3 K1 + 0x7C040400, // 0012 CALL R1 2 + 0x78060000, // 0013 JMPF R1 #0015 + 0x80040000, // 0014 RET 1 R0 + 0x4C040000, // 0015 LDNIL R1 + 0x80040200, // 0016 RET 1 R1 + }) + ) +); +/*******************************************************************/ + #include "be_fixed_be_class_int64.h" @@ -203,13 +280,16 @@ class be_class_int64 (scope: global, name: int64) { _p, var init, ctype_func(int64_init) deinit, ctype_func(int64_deinit) - set, ctype_func(int64_set) fromu32, static_ctype_func(int64_fromu32) + toint64, static_closure(toint64_closure) tostring, ctype_func(int64_tostring) fromstring, static_ctype_func(int64_fromstring) + isint, ctype_func(int64_isint) toint, ctype_func(int64_toint) + tobool, ctype_func(int64_tobool) + add, ctype_func(int64_add32) +, ctype_func(int64_add) -, ctype_func(int64_sub) *, ctype_func(int64_mul) @@ -224,6 +304,6 @@ class be_class_int64 (scope: global, name: int64) { <=, ctype_func(int64_lte) tobytes, ctype_func(int64_tobytes) - frombytes, ctype_func(int64_frombytes) + frombytes, static_ctype_func(int64_frombytes) } @const_object_info_end */ diff --git a/lib/libesp32/berry_int64/tests/int64.be b/lib/libesp32/berry_int64/tests/int64.be index 047330085..311b0f72c 100644 --- a/lib/libesp32/berry_int64/tests/int64.be +++ b/lib/libesp32/berry_int64/tests/int64.be @@ -8,15 +8,9 @@ assert(int(int64(-5)) == -5) assert(str(int64(-5)) == "-5") # testing large numbers -a = int64() -a.set(0x7FFFFFFF,0xFFFFFFFF) # max positive number -assert(str(a) == "9223372036854775807") - -a.set(0x80000000,0x00000000) -assert(str(a) == "-9223372036854775808") - -a.set(10,10) -assert(str(a) == "42949672970") +assert(str(int64.fromu32(0xFFFFFFFF, 0x7FFFFFFF)) == "9223372036854775807") # max positive number +assert(str(int64.fromu32(0x00000000, 0x80000000)) == "-9223372036854775808") +assert(str(int64.fromu32(10,10)) == "42949672970") # addition assert(str(int64(10) + int64(20)) == "30") @@ -97,19 +91,18 @@ assert(a.tobytes() == bytes("0000000000000080")) assert(int64(-1).tobytes() == bytes("FFFFFFFFFFFFFFFF")) # frombytes -a = int64() -a.frombytes(bytes("0A00000000000000"), 0) -assert(a.tobytes() == bytes("0A00000000000000")) -a.frombytes(bytes("0A00000000000000")) # with implicit index 0 -assert(a.tobytes() == bytes("0A00000000000000")) -a.frombytes(bytes("0A00000000000000"), 1) # index 1 and incomplete (7 bytes) -assert(a.tobytes() == bytes("0000000000000000")) +assert(int64.frombytes(bytes("0A00000000000000"), 0) == bytes("0A00000000000000")) # with implicit index 0 +assert(int64.frombytes(bytes("0A00000000000000")) == bytes("0A00000000000000")) +assert(int64.frombytes(bytes("0A00000000000000"), 1) == bytes("0000000000000000")) # index 1 and incomplete (7 bytes) -a.frombytes(bytes("00FFFFFFFFFFFFFFFF"), 1) # index 1 and incomplete (7 bytes) -assert(a.tobytes() == bytes("FFFFFFFFFFFFFFFF")) -a.frombytes(bytes("00FFFFFFFFFFFFFFFF"), -2) # from end -assert(a.tobytes() == bytes("FFFF000000000000")) -a.frombytes(bytes("")) # empty -assert(a.tobytes() == bytes("0000000000000000")) -a.frombytes(bytes(""),4) # empty with wrong index -assert(a.tobytes() == bytes("0000000000000000")) +assert(int64.frombytes(bytes("00FFFFFFFFFFFFFFFF"), 1) == bytes("FFFFFFFFFFFFFFFF")) # index 1 and incomplete (7 bytes) +assert(int64.frombytes(bytes("00FFFFFFFFFFFFFFFF"), -2) == bytes("FFFF000000000000")) # from end +assert(int64.frombytes(bytes("")) == bytes("0000000000000000")) # empty +assert(int64.frombytes(bytes(""),4) == bytes("0000000000000000")) # empty with wrong index + +# fromu32 +assert(int64.fromu32(0).tobytes() == bytes("0000000000000000")) +assert(int64.fromu32(0xFFFFFFFF).tobytes() == bytes("FFFFFFFF00000000")) +assert(int64.fromu32(0xFFFFFFFF, 1).tobytes() == bytes("FFFFFFFF01000000")) +assert(int64.fromu32(-1, 1).tobytes() == bytes("FFFFFFFF01000000")) +assert(int64.fromu32(-1, -1).tobytes() == bytes("FFFFFFFFFFFFFFFF")) diff --git a/lib/libesp32/berry_matter/src/embedded/Matter_Fabric.be b/lib/libesp32/berry_matter/src/embedded/Matter_Fabric.be index a2f3daa00..92a4c04a5 100644 --- a/lib/libesp32/berry_matter/src/embedded/Matter_Fabric.be +++ b/lib/libesp32/berry_matter/src/embedded/Matter_Fabric.be @@ -98,14 +98,10 @@ class Matter_Fabric : Matter_Expirable def get_fabric_index() return self.fabric_index end def get_fabric_id_as_int64() - var i64 = int64() - i64.frombytes(self.fabric_id) - return i64 + return int64.frombytes(self.fabric_id) end def get_device_id_as_int64() - var i64 = int64() - i64.frombytes(self.device_id) - return i64 + return int64.frombytes(self.device_id) end def get_admin_vendor_name() diff --git a/lib/libesp32/berry_matter/src/embedded/Matter_TLV.be b/lib/libesp32/berry_matter/src/embedded/Matter_TLV.be index 9c19e0b36..cd8ee187a 100644 --- a/lib/libesp32/berry_matter/src/embedded/Matter_TLV.be +++ b/lib/libesp32/berry_matter/src/embedded/Matter_TLV.be @@ -241,8 +241,7 @@ class Matter_TLV var item_len = TLV._len[item_type] if item_len == 8 # i64 / u64 / double - self.val = int64() - self.val.frombytes(b, idx) + self.val = int64.frombytes(b, idx) idx += 8 elif item_type == TLV.BFALSE || item_type == TLV.BTRUE # bool self.val = (item_type == TLV.BTRUE) diff --git a/lib/libesp32/berry_matter/src/solidify/solidified_Matter_Fabric.h b/lib/libesp32/berry_matter/src/solidify/solidified_Matter_Fabric.h index 434360b2f..a650382d4 100644 --- a/lib/libesp32/berry_matter/src/solidify/solidified_Matter_Fabric.h +++ b/lib/libesp32/berry_matter/src/solidify/solidified_Matter_Fabric.h @@ -11,7 +11,7 @@ extern const bclass be_class_Matter_Fabric; ********************************************************************/ be_local_closure(Matter_Fabric_get_device_id_as_int64, /* name */ be_nested_proto( - 5, /* nstack */ + 4, /* nstack */ 1, /* argc */ 2, /* varg */ 0, /* has upvals */ @@ -26,13 +26,12 @@ be_local_closure(Matter_Fabric_get_device_id_as_int64, /* name */ }), be_str_weak(get_device_id_as_int64), &be_const_str_solidified, - ( &(const binstruction[ 6]) { /* code */ + ( &(const binstruction[ 5]) { /* code */ 0xB8060000, // 0000 GETNGBL R1 K0 - 0x7C040000, // 0001 CALL R1 0 - 0x8C080301, // 0002 GETMET R2 R1 K1 - 0x88100102, // 0003 GETMBR R4 R0 K2 - 0x7C080400, // 0004 CALL R2 2 - 0x80040200, // 0005 RET 1 R1 + 0x8C040301, // 0001 GETMET R1 R1 K1 + 0x880C0102, // 0002 GETMBR R3 R0 K2 + 0x7C040400, // 0003 CALL R1 2 + 0x80040200, // 0004 RET 1 R1 }) ) ); @@ -1065,7 +1064,7 @@ be_local_closure(Matter_Fabric_get_ipk_group_key, /* name */ ********************************************************************/ be_local_closure(Matter_Fabric_get_fabric_id_as_int64, /* name */ be_nested_proto( - 5, /* nstack */ + 4, /* nstack */ 1, /* argc */ 2, /* varg */ 0, /* has upvals */ @@ -1080,13 +1079,12 @@ be_local_closure(Matter_Fabric_get_fabric_id_as_int64, /* name */ }), be_str_weak(get_fabric_id_as_int64), &be_const_str_solidified, - ( &(const binstruction[ 6]) { /* code */ + ( &(const binstruction[ 5]) { /* code */ 0xB8060000, // 0000 GETNGBL R1 K0 - 0x7C040000, // 0001 CALL R1 0 - 0x8C080301, // 0002 GETMET R2 R1 K1 - 0x88100102, // 0003 GETMBR R4 R0 K2 - 0x7C080400, // 0004 CALL R2 2 - 0x80040200, // 0005 RET 1 R1 + 0x8C040301, // 0001 GETMET R1 R1 K1 + 0x880C0102, // 0002 GETMBR R3 R0 K2 + 0x7C040400, // 0003 CALL R1 2 + 0x80040200, // 0004 RET 1 R1 }) ) ); diff --git a/lib/libesp32/berry_matter/src/solidify/solidified_Matter_TLV.h b/lib/libesp32/berry_matter/src/solidify/solidified_Matter_TLV.h index c829d0346..64a9aabfd 100644 --- a/lib/libesp32/berry_matter/src/solidify/solidified_Matter_TLV.h +++ b/lib/libesp32/berry_matter/src/solidify/solidified_Matter_TLV.h @@ -771,112 +771,110 @@ be_local_closure(Matter_TLV_item_parse, /* name */ }), be_str_weak(parse), &be_const_str_solidified, - ( &(const binstruction[105]) { /* code */ + ( &(const binstruction[103]) { /* code */ 0x880C0100, // 0000 GETMBR R3 R0 K0 0x88100101, // 0001 GETMBR R4 R0 K1 0x88140902, // 0002 GETMBR R5 R4 K2 0x94140A03, // 0003 GETIDX R5 R5 R3 0x541A0007, // 0004 LDINT R6 8 0x1C180A06, // 0005 EQ R6 R5 R6 - 0x781A000A, // 0006 JMPF R6 #0012 + 0x781A0008, // 0006 JMPF R6 #0010 0xB81A0800, // 0007 GETNGBL R6 K4 - 0x7C180000, // 0008 CALL R6 0 - 0x90020606, // 0009 SETMBR R0 K3 R6 - 0x88180103, // 000A GETMBR R6 R0 K3 - 0x8C180D05, // 000B GETMET R6 R6 K5 - 0x5C200200, // 000C MOVE R8 R1 - 0x5C240400, // 000D MOVE R9 R2 - 0x7C180600, // 000E CALL R6 3 - 0x541A0007, // 000F LDINT R6 8 - 0x00080406, // 0010 ADD R2 R2 R6 - 0x70020054, // 0011 JMP #0067 - 0x88180906, // 0012 GETMBR R6 R4 K6 - 0x1C180606, // 0013 EQ R6 R3 R6 - 0x741A0002, // 0014 JMPT R6 #0018 - 0x88180907, // 0015 GETMBR R6 R4 K7 - 0x1C180606, // 0016 EQ R6 R3 R6 - 0x781A0003, // 0017 JMPF R6 #001C - 0x88180907, // 0018 GETMBR R6 R4 K7 - 0x1C180606, // 0019 EQ R6 R3 R6 - 0x90020606, // 001A SETMBR R0 K3 R6 - 0x7002004A, // 001B JMP #0067 - 0x88180908, // 001C GETMBR R6 R4 K8 - 0x14180606, // 001D LT R6 R3 R6 - 0x781A000E, // 001E JMPF R6 #002E - 0x88180909, // 001F GETMBR R6 R4 K9 - 0x18180606, // 0020 LE R6 R3 R6 - 0x781A0004, // 0021 JMPF R6 #0027 - 0x8C18030A, // 0022 GETMET R6 R1 K10 - 0x5C200400, // 0023 MOVE R8 R2 - 0x5C240A00, // 0024 MOVE R9 R5 - 0x7C180600, // 0025 CALL R6 3 - 0x70020003, // 0026 JMP #002B - 0x8C18030B, // 0027 GETMET R6 R1 K11 - 0x5C200400, // 0028 MOVE R8 R2 - 0x5C240A00, // 0029 MOVE R9 R5 - 0x7C180600, // 002A CALL R6 3 - 0x90020606, // 002B SETMBR R0 K3 R6 - 0x00080405, // 002C ADD R2 R2 R5 - 0x70020038, // 002D JMP #0067 - 0x8818090C, // 002E GETMBR R6 R4 K12 - 0x1C180606, // 002F EQ R6 R3 R6 - 0x781A0006, // 0030 JMPF R6 #0038 - 0x8C18030D, // 0031 GETMET R6 R1 K13 - 0x5C200400, // 0032 MOVE R8 R2 - 0x7C180400, // 0033 CALL R6 2 - 0x90020606, // 0034 SETMBR R0 K3 R6 - 0x541A0003, // 0035 LDINT R6 4 - 0x00080406, // 0036 ADD R2 R2 R6 - 0x7002002E, // 0037 JMP #0067 - 0x5419FFF7, // 0038 LDINT R6 -8 - 0x28180A06, // 0039 GE R6 R5 R6 - 0x781A0016, // 003A JMPF R6 #0052 - 0x5419FFFE, // 003B LDINT R6 -1 - 0x18180A06, // 003C LE R6 R5 R6 - 0x781A0013, // 003D JMPF R6 #0052 - 0x8C18030B, // 003E GETMET R6 R1 K11 - 0x5C200400, // 003F MOVE R8 R2 - 0x44240A00, // 0040 NEG R9 R5 - 0x7C180600, // 0041 CALL R6 3 - 0x441C0A00, // 0042 NEG R7 R5 - 0x00080407, // 0043 ADD R2 R2 R7 - 0x001C0406, // 0044 ADD R7 R2 R6 - 0x041C0F0E, // 0045 SUB R7 R7 K14 - 0x401C0407, // 0046 CONNECT R7 R2 R7 - 0x941C0207, // 0047 GETIDX R7 R1 R7 - 0x90020607, // 0048 SETMBR R0 K3 R7 - 0x00080406, // 0049 ADD R2 R2 R6 - 0x881C090F, // 004A GETMBR R7 R4 K15 - 0x181C0607, // 004B LE R7 R3 R7 - 0x781E0003, // 004C JMPF R7 #0051 - 0x881C0103, // 004D GETMBR R7 R0 K3 - 0x8C1C0F10, // 004E GETMET R7 R7 K16 - 0x7C1C0200, // 004F CALL R7 1 - 0x90020607, // 0050 SETMBR R0 K3 R7 - 0x70020014, // 0051 JMP #0067 - 0x88180911, // 0052 GETMBR R6 R4 K17 - 0x1C180606, // 0053 EQ R6 R3 R6 - 0x781A0000, // 0054 JMPF R6 #0056 - 0x70020010, // 0055 JMP #0067 - 0x88180912, // 0056 GETMBR R6 R4 K18 - 0x1C180606, // 0057 EQ R6 R3 R6 - 0x781A0005, // 0058 JMPF R6 #005F - 0xB81A2600, // 0059 GETNGBL R6 K19 - 0x8C180D14, // 005A GETMET R6 R6 K20 - 0x58200015, // 005B LDCONST R8 K21 - 0x58240016, // 005C LDCONST R9 K22 - 0x7C180600, // 005D CALL R6 3 - 0x70020007, // 005E JMP #0067 - 0xB81A2600, // 005F GETNGBL R6 K19 - 0x8C180D14, // 0060 GETMET R6 R6 K20 - 0x60200008, // 0061 GETGBL R8 G8 - 0x5C240600, // 0062 MOVE R9 R3 - 0x7C200200, // 0063 CALL R8 1 - 0x00222E08, // 0064 ADD R8 K23 R8 - 0x58240016, // 0065 LDCONST R9 K22 - 0x7C180600, // 0066 CALL R6 3 - 0x90023002, // 0067 SETMBR R0 K24 R2 - 0x80040400, // 0068 RET 1 R2 + 0x8C180D05, // 0008 GETMET R6 R6 K5 + 0x5C200200, // 0009 MOVE R8 R1 + 0x5C240400, // 000A MOVE R9 R2 + 0x7C180600, // 000B CALL R6 3 + 0x90020606, // 000C SETMBR R0 K3 R6 + 0x541A0007, // 000D LDINT R6 8 + 0x00080406, // 000E ADD R2 R2 R6 + 0x70020054, // 000F JMP #0065 + 0x88180906, // 0010 GETMBR R6 R4 K6 + 0x1C180606, // 0011 EQ R6 R3 R6 + 0x741A0002, // 0012 JMPT R6 #0016 + 0x88180907, // 0013 GETMBR R6 R4 K7 + 0x1C180606, // 0014 EQ R6 R3 R6 + 0x781A0003, // 0015 JMPF R6 #001A + 0x88180907, // 0016 GETMBR R6 R4 K7 + 0x1C180606, // 0017 EQ R6 R3 R6 + 0x90020606, // 0018 SETMBR R0 K3 R6 + 0x7002004A, // 0019 JMP #0065 + 0x88180908, // 001A GETMBR R6 R4 K8 + 0x14180606, // 001B LT R6 R3 R6 + 0x781A000E, // 001C JMPF R6 #002C + 0x88180909, // 001D GETMBR R6 R4 K9 + 0x18180606, // 001E LE R6 R3 R6 + 0x781A0004, // 001F JMPF R6 #0025 + 0x8C18030A, // 0020 GETMET R6 R1 K10 + 0x5C200400, // 0021 MOVE R8 R2 + 0x5C240A00, // 0022 MOVE R9 R5 + 0x7C180600, // 0023 CALL R6 3 + 0x70020003, // 0024 JMP #0029 + 0x8C18030B, // 0025 GETMET R6 R1 K11 + 0x5C200400, // 0026 MOVE R8 R2 + 0x5C240A00, // 0027 MOVE R9 R5 + 0x7C180600, // 0028 CALL R6 3 + 0x90020606, // 0029 SETMBR R0 K3 R6 + 0x00080405, // 002A ADD R2 R2 R5 + 0x70020038, // 002B JMP #0065 + 0x8818090C, // 002C GETMBR R6 R4 K12 + 0x1C180606, // 002D EQ R6 R3 R6 + 0x781A0006, // 002E JMPF R6 #0036 + 0x8C18030D, // 002F GETMET R6 R1 K13 + 0x5C200400, // 0030 MOVE R8 R2 + 0x7C180400, // 0031 CALL R6 2 + 0x90020606, // 0032 SETMBR R0 K3 R6 + 0x541A0003, // 0033 LDINT R6 4 + 0x00080406, // 0034 ADD R2 R2 R6 + 0x7002002E, // 0035 JMP #0065 + 0x5419FFF7, // 0036 LDINT R6 -8 + 0x28180A06, // 0037 GE R6 R5 R6 + 0x781A0016, // 0038 JMPF R6 #0050 + 0x5419FFFE, // 0039 LDINT R6 -1 + 0x18180A06, // 003A LE R6 R5 R6 + 0x781A0013, // 003B JMPF R6 #0050 + 0x8C18030B, // 003C GETMET R6 R1 K11 + 0x5C200400, // 003D MOVE R8 R2 + 0x44240A00, // 003E NEG R9 R5 + 0x7C180600, // 003F CALL R6 3 + 0x441C0A00, // 0040 NEG R7 R5 + 0x00080407, // 0041 ADD R2 R2 R7 + 0x001C0406, // 0042 ADD R7 R2 R6 + 0x041C0F0E, // 0043 SUB R7 R7 K14 + 0x401C0407, // 0044 CONNECT R7 R2 R7 + 0x941C0207, // 0045 GETIDX R7 R1 R7 + 0x90020607, // 0046 SETMBR R0 K3 R7 + 0x00080406, // 0047 ADD R2 R2 R6 + 0x881C090F, // 0048 GETMBR R7 R4 K15 + 0x181C0607, // 0049 LE R7 R3 R7 + 0x781E0003, // 004A JMPF R7 #004F + 0x881C0103, // 004B GETMBR R7 R0 K3 + 0x8C1C0F10, // 004C GETMET R7 R7 K16 + 0x7C1C0200, // 004D CALL R7 1 + 0x90020607, // 004E SETMBR R0 K3 R7 + 0x70020014, // 004F JMP #0065 + 0x88180911, // 0050 GETMBR R6 R4 K17 + 0x1C180606, // 0051 EQ R6 R3 R6 + 0x781A0000, // 0052 JMPF R6 #0054 + 0x70020010, // 0053 JMP #0065 + 0x88180912, // 0054 GETMBR R6 R4 K18 + 0x1C180606, // 0055 EQ R6 R3 R6 + 0x781A0005, // 0056 JMPF R6 #005D + 0xB81A2600, // 0057 GETNGBL R6 K19 + 0x8C180D14, // 0058 GETMET R6 R6 K20 + 0x58200015, // 0059 LDCONST R8 K21 + 0x58240016, // 005A LDCONST R9 K22 + 0x7C180600, // 005B CALL R6 3 + 0x70020007, // 005C JMP #0065 + 0xB81A2600, // 005D GETNGBL R6 K19 + 0x8C180D14, // 005E GETMET R6 R6 K20 + 0x60200008, // 005F GETGBL R8 G8 + 0x5C240600, // 0060 MOVE R9 R3 + 0x7C200200, // 0061 CALL R8 1 + 0x00222E08, // 0062 ADD R8 K23 R8 + 0x58240016, // 0063 LDCONST R9 K22 + 0x7C180600, // 0064 CALL R6 3 + 0x90023002, // 0065 SETMBR R0 K24 R2 + 0x80040400, // 0066 RET 1 R2 }) ) );