Sistemate grandezze + unused imports

This commit is contained in:
Giulio De Pasquale 2017-05-26 11:46:32 +02:00
parent 7cae011023
commit 0ac0e08c9e
3 changed files with 3 additions and 12 deletions

View File

@ -114,7 +114,6 @@ INSTRUCTION SIZE TYPES
*/ */
#define REG2REG 2 #define REG2REG 2
#define IMM2REG 4 #define IMM2REG 4
#define REG2IMM 4
#define BYT2REG 3 #define BYT2REG 3
#define REGONLY 2 #define REGONLY 2
#define IMMONLY 3 #define IMMONLY 3
@ -156,8 +155,6 @@ INSTRUCTION SIZES
#define CMPB_SIZE BYT2REG #define CMPB_SIZE BYT2REG
#define CMPW_SIZE IMM2REG #define CMPW_SIZE IMM2REG
#define CMPR_SIZE REG2REG #define CMPR_SIZE REG2REG
#define JMPI_SIZE IMMONLY
#define JMPR_SIZE REGONLY
#define JPAI_SIZE IMMONLY #define JPAI_SIZE IMMONLY
#define JPAR_SIZE REGONLY #define JPAR_SIZE REGONLY
#define JPBI_SIZE IMMONLY #define JPBI_SIZE IMMONLY
@ -166,8 +163,6 @@ INSTRUCTION SIZES
#define JPER_SIZE REGONLY #define JPER_SIZE REGONLY
#define JPNI_SIZE IMMONLY #define JPNI_SIZE IMMONLY
#define JPNR_SIZE REGONLY #define JPNR_SIZE REGONLY
#define RETN_SIZE SINGLE
#define SHIT_SIZE SINGLE
#define NOPE_SIZE SINGLE #define NOPE_SIZE SINGLE
#define GRMN_SIZE SINGLE #define GRMN_SIZE SINGLE
#define DEBG_SIZE SINGLE #define DEBG_SIZE SINGLE

View File

@ -1,13 +1,11 @@
#include "vm.h" #include "vm.h"
#include "debug.h" #include "debug.h"
#include "opcodes.h" #include "opcodes.h"
#include "vmas.h"
#include <string.h> #include <string.h>
#include <unistd.h>
void VM::encryptOpcodes(uint8_t *key) { void VM::encryptOpcodes(uint8_t *key) {
uint8_t arr[256]; uint8_t arr[256], i, j;
uint32_t i, j, tmp, keysize; uint32_t tmp, keysize;
keysize = strlen((char *)key); keysize = strlen((char *)key);
/* /*
@ -27,7 +25,6 @@ void VM::encryptOpcodes(uint8_t *key) {
OPS[i] = arr[i]; OPS[i] = arr[i];
} }
#ifdef DBG #ifdef DBG
//#TODO ASSEGNARE I NOMI AGLI OPCODES
DBG_INFO(("~~~~~~~~~~\nOPCODES:\n")); DBG_INFO(("~~~~~~~~~~\nOPCODES:\n"));
for (i = 0; i < NUM_OPS; i++) { for (i = 0; i < NUM_OPS; i++) {
DBG_INFO(("0x%x: 0x%x\n", i, 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) { void VM::initVariables(void) {
uint32_t i; uint8_t i;
for (i = R0; i < NUM_REGS; i++) { for (i = R0; i < NUM_REGS; i++) {
this->regs[i] = 0; this->regs[i] = 0;

View File

@ -33,7 +33,6 @@ private:
*/ */
bool execMOVI(void); bool execMOVI(void);
bool execMOVR(void); bool execMOVR(void);
bool execMOVM(void);
bool execLODI(void); bool execLODI(void);
bool execLODR(void); bool execLODR(void);
bool execSTRI(void); bool execSTRI(void);