-
Notifications
You must be signed in to change notification settings - Fork 23
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
ARM Native copro *DIS command calculates negative offset ADR addresses incorrectly? #172
Labels
Comments
Disassembling this with an Online Disassembler I get:
But I agree there is something wrong here. |
The issue is the disassembler is using banch calculations in the table
[I_ADR] = {"cdb"}," in armv7-tbl.c which is only good for forward address
calculations.
…On Wed, 21 Jun 2023 at 07:42, David Banks ***@***.***> wrote:
Disassembling this with an Online Disassembler
<https://shell-storm.org/online/Online-Assembler-and-Disassembler/?opcodes=87654321%0D%0AE24F100C&arch=arm&endianness=big&baddr=0x00009018&dis_with_addr=True&dis_with_raw=True&dis_with_ins=True#disassembly>
I get:
0x0000000000009018: 87 65 43 21 strbhi r4, [r5, -r1, lsr #6]!
0x000000000000901c: E2 4F 10 0C sub r1, pc, #0xc
But I agree there is something wrong here.
—
Reply to this email directly, view it on GitHub
<#172 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AEVVFIU7SWUOQAVEKESMEM3XMKJTTANCNFSM6AAAAAAZN56LJY>
.
You are receiving this because you are subscribed to this thread.Message
ID: ***@***.***>
|
So I think in the 'b' case in darm.c ( line 463) the d->U flag needs to be
used to select if the (8+ d->imm) is subtracted instead of added.
On Wed, 21 Jun 2023 at 07:49, Dominic Plunkett ***@***.***>
wrote:
… The issue is the disassembler is using banch calculations in the table
[I_ADR] = {"cdb"}," in armv7-tbl.c which is only good for forward address
calculations.
On Wed, 21 Jun 2023 at 07:42, David Banks ***@***.***>
wrote:
> Disassembling this with an Online Disassembler
> <https://shell-storm.org/online/Online-Assembler-and-Disassembler/?opcodes=87654321%0D%0AE24F100C&arch=arm&endianness=big&baddr=0x00009018&dis_with_addr=True&dis_with_raw=True&dis_with_ins=True#disassembly>
> I get:
>
> 0x0000000000009018: 87 65 43 21 strbhi r4, [r5, -r1, lsr #6]!
> 0x000000000000901c: E2 4F 10 0C sub r1, pc, #0xc
>
> But I agree there is something wrong here.
>
> —
> Reply to this email directly, view it on GitHub
> <#172 (comment)>,
> or unsubscribe
> <https://github.com/notifications/unsubscribe-auth/AEVVFIU7SWUOQAVEKESMEM3XMKJTTANCNFSM6AAAAAAZN56LJY>
> .
> You are receiving this because you are subscribed to this thread.Message
> ID: ***@***.***>
>
|
OK, I'll fix this now in hognose-fixes and merge across to indigo-dev. Dominic, can I also merge indigo-dev-dp back to indigo-dev? |
Yes I'm happy for indigo-dev-dp to be merged into indigo-dev
…On Wed, 21 Jun 2023 at 10:21, David Banks ***@***.***> wrote:
OK, I'll fix this now in hognose-fixes and merge across to indigo-dev.
Dominic, can I also merge indigo-dev-dp back to indigo-dev?
—
Reply to this email directly, view it on GitHub
<#172 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AEVVFIV4PTJLMAYJJRYDGR3XMK4IFANCNFSM6AAAAAAZN56LJY>
.
You are receiving this because you commented.Message ID:
***@***.***>
|
hoglet67
added a commit
that referenced
this issue
Jun 21, 2023
Change-Id: Icbfd68adad233ed99a552876214e0ddf37060d2d
OK, this should now be fixed in hognose-fixes: |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I'm not an expert on ARM but I think the *DIS command in the ARMv7 Native Coprocessor calculates the address used in an ADR instruction incorrectly, when the offset is negative.
For example, if I assemble (in BBC BASIC V) at &9018:
Then I do
*DIS 9018
, I get:... the ADR instruction is actually a SUB with an offset of &C, minus 8 for the pipeline so should be &9018; I think the offset is always being added and not subtracted, when the instruction is determined to be an ADR.
By comparison,
*MEMORYI
on RISC OS gives (assembled at &901C):... same encoding but the address is correctly shown as &901C (in this case).
The text was updated successfully, but these errors were encountered: