-
Notifications
You must be signed in to change notification settings - Fork 43
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
feat(rp2040): add missing opcodeXXX #18
Conversation
During debugging I found sometimes the LR register has LSB reset to 0 while on a real Pico at the same position it is always set as 1. This also matches the armv6-m reference manual pag 113-114.
Thank you! Can you also update the tests (rp2040.spec.ts) to use these functions instead of the hard-coded opcodes? |
src/instructions.spec.ts
Outdated
@@ -809,7 +825,7 @@ describe('Cortex-M0+ Instruction Set', () => { | |||
|
|||
it('should execute a `lsls r5, r5, #18` instruction with carry', async () => { | |||
await cpu.setPC(0x20000000); | |||
await cpu.writeUint16(0x20000000, 0x04ad); // lsls r5, r5, #18 | |||
await cpu.writeUint16(0x20000000, opcodeLSLSimm(r5,r5,18)); //)0x04ad); // lsls r5, r5, #18 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
duplicated test?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This one has carry (see the last assertion in this test)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ok
src/instructions.spec.ts
Outdated
@@ -786,7 +802,7 @@ describe('Cortex-M0+ Instruction Set', () => { | |||
|
|||
it('should execute a `lsls r5, r5, #18` instruction', async () => { | |||
await cpu.setPC(0x20000000); | |||
await cpu.writeUint16(0x20000000, 0x04ad); // lsls r5, r5, #18 | |||
await cpu.writeUint16(0x20000000, opcodeLSLSimm(r5,r5,18));// 0x04ad); // lsls r5, r5, #18 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you also remove the comment with the opcode at the end of the line?
We no longer need those since you can see the name and arguments of the opcode in the function call
No description provided.