-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
Encoding Information for ARM #2031
Comments
Related to #1970 Now, for anyone who is interested in implementing this: The If anyone plans to work on this before the Capstone release which introduces But in general the operand information is easy to come by because the operands bits are defined in the target definition files (see for The tables for operand bit position and length should be generated in PrinterCapstone::asmMatcherEmitMatchTable() with a new function. Work on the |
So if I want to implement this myself for my own project, do I need to modify the updater, generate a new a table consisting of info about the instructions and then modify the source? |
Yes. It's probably better to extend the
If would be nice though if you implement it for all of us ;) |
Whenever you work with So for the
As you can the the I am not sure how to implemented this the best way in Capstone currently. But from the top of my head I would say it is useful to have the encoding in Capstone The upper 4 bits encode the type of the bit (opcode, reg op, imm op, predicate, invalid/not used etc.) and the lower 4bits encode the index of the operand. With index I mean not the index in a The For this scenario you would need to extend The actual bit width calculation of each operand within the instruction, can then be done in Capstone. Hope this helps and gives a few ideas :) |
But if you have an array which describes every bit, couldn't you just iterate over it and count the bits which belong to each operand?
Yes. Those are still operands and someone else might need them. Generally: The new encoding information should reside in the Mapping component I think. And whenever the detail for an operand is added via |
I like your
No need to be concerned about space. We should wrap this into
I would say that it is useful to have also the opcode bits in this array. Not just the operand bits. Because if we add this kind of info we can also add all of the known.
Yes, this is the better idea. But I do think that this definitely belongs into @XVilka @kabeor Any opinions? Or know someone who might has an opinion? Also cc @gogo2464. |
I think it definitely belongs to the |
Closed due to #2045 (comment) |
To my knowledge the api exposes encoding specific information (such as where immediates and displacements are located) for the x86 architecture via the
cs_x86_encoding
struct. While I have checked thearm.h
header file I was unable to find any struct that holds such information exposed to the public. Since my goal is to change the registers of some instructions I would like the api to provide information about their offsets if possible.The text was updated successfully, but these errors were encountered: