From 0ac0e08c9e65de6a4f37ba58be3d6edf5ca68ef2 Mon Sep 17 00:00:00 2001 From: Giulio De Pasquale Date: Fri, 26 May 2017 11:46:32 +0200 Subject: [PATCH] Sistemate grandezze + unused imports --- vm/opcodes.h | 5 ----- vm/vm.cpp | 9 +++------ vm/vm.h | 1 - 3 files changed, 3 insertions(+), 12 deletions(-) diff --git a/vm/opcodes.h b/vm/opcodes.h index b6ce7cd..4f9512d 100644 --- a/vm/opcodes.h +++ b/vm/opcodes.h @@ -114,7 +114,6 @@ INSTRUCTION SIZE TYPES */ #define REG2REG 2 #define IMM2REG 4 -#define REG2IMM 4 #define BYT2REG 3 #define REGONLY 2 #define IMMONLY 3 @@ -156,8 +155,6 @@ INSTRUCTION SIZES #define CMPB_SIZE BYT2REG #define CMPW_SIZE IMM2REG #define CMPR_SIZE REG2REG -#define JMPI_SIZE IMMONLY -#define JMPR_SIZE REGONLY #define JPAI_SIZE IMMONLY #define JPAR_SIZE REGONLY #define JPBI_SIZE IMMONLY @@ -166,8 +163,6 @@ INSTRUCTION SIZES #define JPER_SIZE REGONLY #define JPNI_SIZE IMMONLY #define JPNR_SIZE REGONLY -#define RETN_SIZE SINGLE -#define SHIT_SIZE SINGLE #define NOPE_SIZE SINGLE #define GRMN_SIZE SINGLE #define DEBG_SIZE SINGLE \ No newline at end of file diff --git a/vm/vm.cpp b/vm/vm.cpp index ef0b69e..03efc58 100644 --- a/vm/vm.cpp +++ b/vm/vm.cpp @@ -1,13 +1,11 @@ #include "vm.h" #include "debug.h" #include "opcodes.h" -#include "vmas.h" #include -#include void VM::encryptOpcodes(uint8_t *key) { - uint8_t arr[256]; - uint32_t i, j, tmp, keysize; + uint8_t arr[256], i, j; + uint32_t tmp, keysize; keysize = strlen((char *)key); /* @@ -27,7 +25,6 @@ void VM::encryptOpcodes(uint8_t *key) { OPS[i] = arr[i]; } #ifdef DBG - //#TODO ASSEGNARE I NOMI AGLI OPCODES DBG_INFO(("~~~~~~~~~~\nOPCODES:\n")); for (i = 0; i < NUM_OPS; i++) { DBG_INFO(("0x%x: 0x%x\n", i, OPS[i])); @@ -152,7 +149,7 @@ VM::VM(uint8_t *key, uint8_t *code, uint32_t codesize) { } void VM::initVariables(void) { - uint32_t i; + uint8_t i; for (i = R0; i < NUM_REGS; i++) { this->regs[i] = 0; diff --git a/vm/vm.h b/vm/vm.h index 2400998..35f8fcc 100644 --- a/vm/vm.h +++ b/vm/vm.h @@ -33,7 +33,6 @@ private: */ bool execMOVI(void); bool execMOVR(void); - bool execMOVM(void); bool execLODI(void); bool execLODR(void); bool execSTRI(void);