-
Notifications
You must be signed in to change notification settings - Fork 26
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
Feature request: mark a 16-bit operand as being an address #64
Comments
In fact, this should not be limited to immediate value operands. LDA.W #$0006 I would be nice to get this output in the asm file (provided a label named 'MyString' is defined at address $06D372): |
Yes this is similar to #34 (I don't understand #17 though).
When generating asm source code, Diz could then combine the operand value + address hint to get the full address, search for the corresponding label and use it if present (and just output the value as it currently does if no label is defined)
|
I'd like the ability to mark a 16 bit immediate value operand as being the bank or offset of a label, so that the source assembly code generated by Diztinguish would refer to the label instead of the immediate values.
Let me give an example. Here is a short excerpt of asm code as output by Diztinguish from an actual SNES ROM:
LDA.W #$F714
LDX.W #$0006
STX.W $D3FE
STA.W $D3FC
This code stores the ROM address 06F714 in a 32 bit variable located in WRAM at addresses $7ED3FC and $7ED3FE.
In Diztinguish, I create a label named "MyData" at address 06F714, where the useful data is located.
Because #$F714 and #$0006 are immediate values, Diztinguish currently has no way to guess that these are actually two parts of an address.
I would like a way to tell Diztinguish:
LDA.W #$F714 "This operand is the offset of the label MyVar"
LDX.W #$0006 "This operand is the bank of the label MyVar"
With this additional information (supplied manually by the reverse engineer), Diztinguish could generate improved assembly code looking like this:
LDA.W #MyVar
LDX.W #bank(MyVar)
STX.W $D3FE
STA.W $D3FC
The code above assembles correctly with asar. It is more readable and easily updated (moving the data to another location does not require updating the code as there are no more hard coded values).
The text was updated successfully, but these errors were encountered: