Added Missing OPCODE NOT

This commit is contained in:
Jeremiah Orians 2016-10-01 12:27:32 -04:00
parent dc376ad606
commit b14ab2c6a5
No known key found for this signature in database
GPG Key ID: 7457821534D2ACCD
4 changed files with 19 additions and 1 deletions

View File

@ -204,11 +204,12 @@
| 09 00 03 ab | SWAP a b | a <=> b |
| 09 00 04 ab | COPY a b | a = b |
| 09 00 05 ab | MOVE a b | a = b; b = 0 |
| 09 00 06 ab | NOT a b | a = !b |
**** Reserved Block 0
| Hex | Name |
|-------------+----------|
| 09 00 06 xx | Reserved |
| 09 00 07 xx | Reserved |
| ... | Reserved |
| 09 00 FF xx | Reserved |

1
vm.h
View File

@ -220,6 +220,7 @@ void XORI(struct lilith* vm, struct Instruction* c);
void NANDI(struct lilith* vm, struct Instruction* c);
void NORI(struct lilith* vm, struct Instruction* c);
void XNORI(struct lilith* vm, struct Instruction* c);
void NOT(struct lilith* vm, struct Instruction* c);
/* Prototypes for functions in vm_decode.c*/
struct lilith* create_vm(size_t size);

View File

@ -1189,6 +1189,17 @@ bool eval_2OP_Int(struct lilith* vm, struct Instruction* c)
MOVE(vm, c);
break;
}
case 0x0006: /* NOT */
{
#ifdef DEBUG
strncpy(Name, "NOT", 19);
#elif TRACE
record_trace("NOT");
#endif
NOT(vm, c);
break;
}
case 0x0100: /* BRANCH */
{
#ifdef DEBUG

View File

@ -1953,3 +1953,8 @@ void XNORI(struct lilith* vm, struct Instruction* c)
{
vm->reg[c->reg0] = ~(vm->reg[c->reg1] ^ c->raw_Immediate);
}
void NOT(struct lilith* vm, struct Instruction* c)
{
vm->reg[c->reg0] = ~(vm->reg[c->reg1]);
}