MCPcopy Create free account
hub / github.com/Vector35/binaryninja-api / LDRSB_imm

Function LDRSB_imm

arch/arm64/disassembler/decode2.c:14630–14709  ·  view source on GitHub ↗

ldrsb_imm.xml */

Source from the content-addressed store, hash-verified

14628
14629/* ldrsb_imm.xml */
14630int LDRSB_imm(context *ctx, Instruction *instr)
14631{
14632 int rc = DECODE_STATUS_UNMATCHED;
14633 /* class iclass_post_indexed */
14634 /* size=00|111|V=0|00|opc=1x|0|imm9=xxxxxxxxx|01|Rn=xxxxx|Rt=xxxxx */
14635 if((INSWORD & 0xFFA00C00)==0x38800400) {
14636 decode_fields32(ENC_LDRSB_32_LDST_IMMPOST, ctx, instr);
14637 ctx->wback = TRUE;
14638 ctx->postindex = TRUE;
14639 ctx->scale = UINT(ctx->size);
14640 ctx->offset = SignExtend(ctx->imm9,9);
14641 if(ctx->opc==3) OK(ENC_LDRSB_32_LDST_IMMPOST);
14642 if(ctx->opc==2) OK(ENC_LDRSB_64_LDST_IMMPOST);
14643 }
14644 /* class iclass_pre_indexed */
14645 /* size=00|111|V=0|00|opc=1x|0|imm9=xxxxxxxxx|11|Rn=xxxxx|Rt=xxxxx */
14646 if((INSWORD & 0xFFA00C00)==0x38800C00) {
14647 decode_fields32(ENC_LDRSB_32_LDST_IMMPRE, ctx, instr);
14648 ctx->wback = TRUE;
14649 ctx->postindex = FALSE;
14650 ctx->scale = UINT(ctx->size);
14651 ctx->offset = SignExtend(ctx->imm9,9);
14652 if(ctx->opc==3) OK(ENC_LDRSB_32_LDST_IMMPRE);
14653 if(ctx->opc==2) OK(ENC_LDRSB_64_LDST_IMMPRE);
14654 }
14655 /* class iclass_unsigned_scaled_offset */
14656 /* size=00|111|V=0|01|opc=1x|imm12=xxxxxxxxxxxx|Rn=xxxxx|Rt=xxxxx */
14657 if((INSWORD & 0xFF800000)==0x39800000) {
14658 decode_fields32(ENC_LDRSB_32_LDST_POS, ctx, instr);
14659 ctx->wback = FALSE;
14660 ctx->postindex = FALSE;
14661 ctx->scale = UINT(ctx->size);
14662 ctx->offset = LSL(ZeroExtend(ctx->imm12,0x40),ctx->scale);
14663 if(ctx->opc==3) OK(ENC_LDRSB_32_LDST_POS);
14664 if(ctx->opc==2) OK(ENC_LDRSB_64_LDST_POS);
14665 }
14666 /* post-decode pcode */
14667 ctx->n = UINT(ctx->Rn);
14668 ctx->t = UINT(ctx->Rt);
14669 ctx->acctype = ctx->AccType_NORMAL;
14670 if(SLICE(ctx->opc,1,1)==0) {
14671 if(SLICE(ctx->opc,0,0)==1) {
14672 ctx->memop = MemOp_LOAD;
14673 };
14674 if(ctx->size==3) {
14675 ctx->regsize = 0x40;
14676 };
14677 ctx->signed_ = FALSE;
14678 }
14679 else {
14680 if(ctx->size==3) {
14681 UNDEFINED;
14682 }
14683 else {
14684 ctx->memop = MemOp_LOAD;
14685 if(ctx->size==2 && SLICE(ctx->opc,0,0)==1) {
14686 UNDEFINED;
14687 }

Callers 3

decode_iclass_ldst_posFunction · 0.85

Calls 2

decode_fields32Function · 0.85
SignExtendFunction · 0.85

Tested by

no test coverage detected