Skip to content
Snippets Groups Projects
Commit 5d435e49 authored by James, Ben's avatar James, Ben
Browse files

Revert "branch instruction"

This reverts commit 0eea7de6
parent 0eea7de6
No related branches found
No related tags found
1 merge request!2fixed a bug
......@@ -308,26 +308,6 @@ void dataProcessingInstr(struct ProcessorState *processor, int address)
}
}
void branchInstr(struct ProcessorState *processor, uint32_t instruction)
{
// Check if address is valid
verifyAddress(address);
uint32_t instr = processor->memory[address];
// Check if the instruction should be executed according to its condition codes
if(!validCond(getBits(instr, 28, 31), processor)){
return;
}
// Calculating offset and sign
int32_t offset = getBits(instr, 0, 23);
int sign = getBits(offset, 23, 23);
// Offset shifted and extended and new address (including +8 bytes) loaded to PC
processor->registers[14] = (((offset * 4) | 0) | ((sign) ? 0 : 0xFC000000)) + 64;
return;
}
// Steps through pipeline calling appropriate instruction method.
// Sets teminate if instruction is all-0.
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment