tmr232/Sark

ARM indexing modes

Closed this issue · 5 comments

Currently, Sark does not provide information about ARM pre-index and post-index options.

This can be done using insn_t.auxpref:

Flag Meaning
0 Regular indexing
0x20 Pre-Index
0x80 Post-Index

The main issue is whether to add it as a property of the instruction (probably), the operand (less likely), or both.

I would go with the instruction only approach.

I uploaded a first draft of the API. Instruction objects now have a indexing_mode property of type IndexingMode. So you can use:

# Check for pre-indexing
sark.Line().insn.indexing_mode.is_pre

# Check for post-indexing
sark.Line().insn.indexing_mode.is_post

# Check for normal addressing
sark.Line().insn.indexing_mode.is_none

# Another check for normal addressing
bool(sark.Line().insn.indexing_mode)

@ronyrus , I'd appreciate it if you can check it out and see if it works as expected.

seems to be working well 👍

Any inputs on the API?

Looks fine to me. Is there something specific bothering you?