indice fixato nell'assembler (saltava istruzioni)
This commit is contained in:
parent
b3d8ee9825
commit
b92a76944b
@ -88,7 +88,6 @@ class VMAssembler:
|
|||||||
prev_fun_tot_size = self.functions[i-1].size + self.functions[i-1].offset
|
prev_fun_tot_size = self.functions[i-1].size + self.functions[i-1].offset
|
||||||
cur_fun_size = self.functions[i].size
|
cur_fun_size = self.functions[i].size
|
||||||
self.functions[i].set_offset(prev_fun_tot_size)
|
self.functions[i].set_offset(prev_fun_tot_size)
|
||||||
|
|
||||||
return
|
return
|
||||||
|
|
||||||
def parse(self):
|
def parse(self):
|
||||||
@ -274,9 +273,9 @@ class VMFunction:
|
|||||||
i += 2
|
i += 2
|
||||||
elif ins:
|
elif ins:
|
||||||
self.instructions.append(VMInstruction(line))
|
self.instructions.append(VMInstruction(line))
|
||||||
|
i+= 1
|
||||||
else:
|
else:
|
||||||
raise InvalidOperation(line)
|
raise InvalidOperation(line)
|
||||||
i+=1
|
|
||||||
self.calc_size()
|
self.calc_size()
|
||||||
|
|
||||||
def calc_size(self):
|
def calc_size(self):
|
||||||
|
@ -591,11 +591,9 @@ bool VM::execJPBI(void) {
|
|||||||
DBG_INFO(("JPBI 0x%x\n", imm));
|
DBG_INFO(("JPBI 0x%x\n", imm));
|
||||||
if (flags.CF == 0) {
|
if (flags.CF == 0) {
|
||||||
regs[RP] = regs[IP] + 3;
|
regs[RP] = regs[IP] + 3;
|
||||||
printf("IP: 0x%x | RP: 0x%x\n", regs[IP], regs[RP]);
|
|
||||||
regs[IP] = imm;
|
regs[IP] = imm;
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
printf("YO");
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
bool VM::execJPBR(void) {
|
bool VM::execJPBR(void) {
|
||||||
|
Loading…
Reference in New Issue
Block a user