summaryrefslogtreecommitdiff
path: root/src/lopcodes.js
diff options
context:
space:
mode:
Diffstat (limited to 'src/lopcodes.js')
-rw-r--r--src/lopcodes.js15
1 files changed, 14 insertions, 1 deletions
diff --git a/src/lopcodes.js b/src/lopcodes.js
index b7dfb0f..8df67a3 100644
--- a/src/lopcodes.js
+++ b/src/lopcodes.js
@@ -86,6 +86,16 @@ const MAXARG_A = ((1 << SIZE_A) - 1);
const MAXARG_B = ((1 << SIZE_B) - 1);
const MAXARG_C = ((1 << SIZE_C) - 1);
+const BITRK = (1 << (SIZE_B - 1));
+
+const ISK = function (x) {
+ return x & BITRK;
+};
+
+const INDEXK = function (r) {
+ return r & ~BITRK;
+}
+
module.exports = {
OpCodes: OpCodes,
SIZE_C: SIZE_C,
@@ -105,5 +115,8 @@ module.exports = {
MAXARG_Ax: MAXARG_Ax,
MAXARG_A: MAXARG_A,
MAXARG_B: MAXARG_B,
- MAXARG_C: MAXARG_C
+ MAXARG_C: MAXARG_C,
+ BITRK: BITRK,
+ ISK: ISK,
+ INDEXK: INDEXK
}; \ No newline at end of file