Revert "Sistemate grandezze + unused imports"

This reverts commit 0ac0e08c9e.
This commit is contained in:
Giulio De Pasquale 2017-05-26 11:55:21 +02:00
parent d92de8ad9e
commit 40e93ae508
3 changed files with 12 additions and 3 deletions

View File

@ -114,6 +114,7 @@ INSTRUCTION SIZE TYPES
*/
#define REG2REG 2
#define IMM2REG 4
#define REG2IMM 4
#define BYT2REG 3
#define REGONLY 2
#define IMMONLY 3
@ -155,6 +156,8 @@ 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
@ -163,6 +166,8 @@ 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

View File

@ -1,11 +1,13 @@
#include "vm.h"
#include "debug.h"
#include "opcodes.h"
#include "vmas.h"
#include <string.h>
#include <unistd.h>
void VM::encryptOpcodes(uint8_t *key) {
uint8_t arr[256], i, j;
uint32_t tmp, keysize;
uint8_t arr[256];
uint32_t i, j, tmp, keysize;
keysize = strlen((char *)key);
/*
@ -25,6 +27,7 @@ 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]));
@ -149,7 +152,7 @@ VM::VM(uint8_t *key, uint8_t *code, uint32_t codesize) {
}
void VM::initVariables(void) {
uint8_t i;
uint32_t i;
for (i = R0; i < NUM_REGS; i++) {
this->regs[i] = 0;

View File

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