From 2dc9d118efb64de6ea54a5a9eb4474f8e5ef3145 Mon Sep 17 00:00:00 2001 From: Paul Oliver Date: Thu, 29 Feb 2024 01:50:44 +0100 Subject: Initial commit --- include/instset.h | 93 +++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 93 insertions(+) create mode 100644 include/instset.h (limited to 'include/instset.h') diff --git a/include/instset.h b/include/instset.h new file mode 100644 index 0000000..e819ff3 --- /dev/null +++ b/include/instset.h @@ -0,0 +1,93 @@ +#ifndef SALIS_INSTSET_H +#define SALIS_INSTSET_H + +#define SINST_COUNT 64 + +#define SINST_LIST \ + SINST(SNOOP, ' ') \ + SINST(SNOP0, '0') \ + SINST(SNOP1, '1') \ + SINST(SNOP2, '2') \ + SINST(SNOP3, '3') \ + \ + SINST(SJMPB, '(') \ + SINST(SJMPF, ')') \ + SINST(SADRB, '[') \ + SINST(SADRF, ']') \ + SINST(SIFNZ, '?') \ + \ + SINST(SALLB, '{') \ + SINST(SALLF, '}') \ + SINST(SBSWP, '%') \ + SINST(SBCLR, '|') \ + SINST(SSPLT, '$') \ + \ + SINST(SADDN, '+') \ + SINST(SSUBN, '-') \ + SINST(SMULN, '*') \ + SINST(SDIVN, '/') \ + SINST(SINCN, '^') \ + SINST(SDECN, 'v') \ + SINST(SNOTN, '!') \ + SINST(SSHFL, '<') \ + SINST(SSHFR, '>') \ + SINST(SZERO, 'z') \ + SINST(SUNIT, 'u') \ + \ + SINST(SPSHN, '#') \ + SINST(SPOPN, '~') \ + \ + SINST(SLOAD, '.') \ + SINST(SWRTE, ':') \ + SINST(SDUPL, '"') \ + SINST(SSWAP, 'x') \ + \ + SINST(SKEYA, 'a') \ + SINST(SKEYB, 'b') \ + SINST(SKEYC, 'c') \ + SINST(SKEYD, 'd') \ + SINST(SKEYE, 'e') \ + SINST(SKEYF, 'f') \ + SINST(SKEYG, 'g') \ + SINST(SKEYH, 'h') \ + SINST(SKEYI, 'i') \ + SINST(SKEYJ, 'j') \ + SINST(SKEYK, 'k') \ + SINST(SKEYL, 'l') \ + SINST(SKEYM, 'm') \ + SINST(SKEYN, 'n') \ + SINST(SKEYO, 'o') \ + SINST(SKEYP, 'p') \ + \ + SINST(SLOKA, 'A') \ + SINST(SLOKB, 'B') \ + SINST(SLOKC, 'C') \ + SINST(SLOKD, 'D') \ + SINST(SLOKE, 'E') \ + SINST(SLOKF, 'F') \ + SINST(SLOKG, 'G') \ + SINST(SLOKH, 'H') \ + SINST(SLOKI, 'I') \ + SINST(SLOKJ, 'J') \ + SINST(SLOKK, 'K') \ + SINST(SLOKL, 'L') \ + SINST(SLOKM, 'M') \ + SINST(SLOKN, 'N') \ + SINST(SLOKO, 'O') \ + SILST(SLOKP, 'P') + +enum sinst { +#define SINST(name, symb) name, +#define SILST(name, symb) name + SINST_LIST +#undef SINST +#undef SILST +}; + +sbool si_isInst (sbyte inst); +sbool si_isMod (sbyte inst); +sbool si_isKey (sbyte inst); +sbool si_isLock (sbyte inst); +sbool si_keyLockMatch (sbyte key, sbyte lock); + +#endif -- cgit v1.2.1