Skip to content

Commit

Permalink
symbolic operators
Browse files Browse the repository at this point in the history
  • Loading branch information
samdoshi committed Mar 14, 2016
1 parent b6f41b0 commit 5cf6dd2
Showing 1 changed file with 15 additions and 2 deletions.
17 changes: 15 additions & 2 deletions teletype/teletype.c
Expand Up @@ -801,7 +801,7 @@ static void op_ER(void);




#define MAKEOP(name, params, returns, doc) {#name, op_ ## name, params, returns, doc} #define MAKEOP(name, params, returns, doc) {#name, op_ ## name, params, returns, doc}
#define OPS 54 #define OPS 67
// DO NOT INSERT in the middle. there's a hack in validate() for P and PN // DO NOT INSERT in the middle. there's a hack in validate() for P and PN
static const tele_op_t tele_ops[OPS] = { static const tele_op_t tele_ops[OPS] = {
MAKEOP(ADD, 2, 1,"[A B] ADD A TO B"), MAKEOP(ADD, 2, 1,"[A B] ADD A TO B"),
Expand Down Expand Up @@ -857,7 +857,20 @@ static const tele_op_t tele_ops[OPS] = {
MAKEOP(UNMUTE, 1, 0,"UNMUTE INPUT"), MAKEOP(UNMUTE, 1, 0,"UNMUTE INPUT"),
MAKEOP(SCALE, 5, 1,"SCALE NUMBER RANGES"), MAKEOP(SCALE, 5, 1,"SCALE NUMBER RANGES"),
MAKEOP(STATE, 1, 1,"GET INPUT STATE"), MAKEOP(STATE, 1, 1,"GET INPUT STATE"),
MAKEOP(ER, 3, 1,"EUCLIDEAN RHYTHMS") MAKEOP(ER, 3, 1,"EUCLIDEAN RHYTHMS"),
{"+", op_ADD, 2, 1, "[A B] ADD A TO B"},
{"-", op_SUB, 2, 1,"[A B] SUBTRACT B FROM A"},
{"*", op_MUL, 2, 1,"[A B] MULTIPLY TWO VALUES"},
{"/", op_DIV, 2, 1,"[A B] DIVIDE FIRST BY SECOND"},
{"%", op_MOD, 2, 1,"[A B] MOD FIRST BY SECOND"},
{"==", op_EQ, 2, 1,"LOGIC: EQUAL"},
{"!=", op_NE, 2, 1,"LOGIC: NOT EQUAL"},
{"<", op_LT, 2, 1,"LOGIC: LESS THAN"},
{">", op_GT, 2, 1,"LOGIC: GREATER THAN"},
{">>", op_RSH, 2, 1, "RIGHT SHIFT"},
{"<<", op_LSH, 2, 1, "LEFT SHIFT"},
{"&&", op_AND, 2, 1,"LOGIC: AND"},
{"||", op_OR, 2, 1,"LOGIC: OR"}
}; };


static void op_ADD() { static void op_ADD() {
Expand Down

1 comment on commit 5cf6dd2

@tehn
Copy link

@tehn tehn commented on 5cf6dd2 Mar 20, 2016

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

shall we do this? looks good for power users.

Please sign in to comment.