-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix PC-relative data accesses with LDR
We need to dereference twice, because we embed the address in a way that adds a layer of indirection.
- Loading branch information
1 parent
ddb2f44
commit 3cedd6a
Showing
1 changed file
with
12 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
3cedd6a
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.
Question and comment here.
Question: The original load from
[pc, #8]
was trying to load that.word
after the branch. Since there is an extra instruction inserted, is that not now 12 bytes away?Comment: the
DA.Bv4 14
is the condition field - in particular 14 is flagging unconditional execution. Can we give a name to that value for clarity?3cedd6a
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.
Good question! I made the additional load come after the
.word
inserted into the instruction stream specifically to not mess with that calculation. So I think it has no effect.Yes, I'll do that.
3cedd6a
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.
Ah, can we have the assembly in the comment reflect that too? I see it now, but was initially confused.
3cedd6a
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.
Oh, will do. My bad! Misleading comments are worse than no comments.