Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

adapter-bigbang: reduce amount of xfer instruction. #70

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 3 additions & 5 deletions adapter-bitbang.c
Original file line number Diff line number Diff line change
Expand Up @@ -765,19 +765,17 @@ static void bitbang_load_executive(adapter_t *adapter,
/* Step 5. */
unsigned opcode1 = 0x3c060000 | pic32_pe_loader[i];
unsigned opcode2 = 0x34c60000 | pic32_pe_loader[i+1];
unsigned opcode3 = 0xac860000 | (i * 2);

xfer_instruction(a, opcode1); // lui a2, PE_loader_hi++
xfer_instruction(a, opcode2); // ori a2, PE_loader_lo++
xfer_instruction(a, 0xac860000); // sw a2, 0(a0)
xfer_instruction(a, 0x24840004); // addiu a0, 4
xfer_instruction(a, opcode3); // sw a2, PE_offset(a0)
}
printf(" 5");
fflush(stdout);

/* Jump to PE loader (step 6). */
xfer_instruction(a, 0x3c19a000); // lui t9, 0xa000
xfer_instruction(a, 0x37390800); // ori t9, 0x800 - t9 has a0000800
xfer_instruction(a, 0x03200008); // jr t9
xfer_instruction(a, 0x00800008); // jr a0
xfer_instruction(a, 0x00000000); // nop
printf(" 6");
fflush(stdout);
Expand Down