"The" fix
All checks were successful
/ deploy (push) Successful in 1m17s

Which is just one line... A basic arithmetic operation...
This commit is contained in:
Minecon724 2024-10-22 18:31:21 +02:00
parent 52882cb6a6
commit 53d03b32e0
Signed by: Minecon724
GPG key ID: 3CCC4D267742C8E8

View file

@ -239,7 +239,7 @@ int execute_instruction_on_cpu(CPU *cpu, uint32_t instruction) { // TODO conside
imm |= (instruction >> 12) & 0xFF << 12; // Extract imm[19:12]*/ imm |= (instruction >> 12) & 0xFF << 12; // Extract imm[19:12]*/
registers[rd] = cpu->programCounter + 4; registers[rd] = cpu->programCounter + 4;
cpu->programCounter += imm; cpu->programCounter += imm - 4; // program counter is incremented after this, and we have to execute the function we point to
printf("JAL: Jumped to %u + %d = 0x%X (inst %d)", registers[rd], imm, cpu->programCounter, cpu->programCounter / 4); printf("JAL: Jumped to %u + %d = 0x%X (inst %d)", registers[rd], imm, cpu->programCounter, cpu->programCounter / 4);
break; break;