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

Function STRB_imm

arch/arm64/disassembler/decode2.c:25508–25584  ·  view source on GitHub ↗

strb_imm.xml */

Source from the content-addressed store, hash-verified

25506
25507/* strb_imm.xml */
25508int STRB_imm(context *ctx, Instruction *instr)
25509{
25510 int rc = DECODE_STATUS_UNMATCHED;
25511 /* class iclass_post_indexed */
25512 /* size=00|111|V=0|00|opc=00|0|imm9=xxxxxxxxx|01|Rn=xxxxx|Rt=xxxxx */
25513 if((INSWORD & 0xFFE00C00)==0x38000400) {
25514 decode_fields32(ENC_STRB_32_LDST_IMMPOST, ctx, instr);
25515 ctx->wback = TRUE;
25516 ctx->postindex = TRUE;
25517 ctx->scale = UINT(ctx->size);
25518 ctx->offset = SignExtend(ctx->imm9,9);
25519 OK(ENC_STRB_32_LDST_IMMPOST);
25520 }
25521 /* class iclass_pre_indexed */
25522 /* size=00|111|V=0|00|opc=00|0|imm9=xxxxxxxxx|11|Rn=xxxxx|Rt=xxxxx */
25523 if((INSWORD & 0xFFE00C00)==0x38000C00) {
25524 decode_fields32(ENC_STRB_32_LDST_IMMPRE, ctx, instr);
25525 ctx->wback = TRUE;
25526 ctx->postindex = FALSE;
25527 ctx->scale = UINT(ctx->size);
25528 ctx->offset = SignExtend(ctx->imm9,9);
25529 OK(ENC_STRB_32_LDST_IMMPRE);
25530 }
25531 /* class iclass_unsigned_scaled_offset */
25532 /* size=00|111|V=0|01|opc=00|imm12=xxxxxxxxxxxx|Rn=xxxxx|Rt=xxxxx */
25533 if((INSWORD & 0xFFC00000)==0x39000000) {
25534 decode_fields32(ENC_STRB_32_LDST_POS, ctx, instr);
25535 ctx->wback = FALSE;
25536 ctx->postindex = FALSE;
25537 ctx->scale = UINT(ctx->size);
25538 ctx->offset = LSL(ZeroExtend(ctx->imm12,0x40),ctx->scale);
25539 OK(ENC_STRB_32_LDST_POS);
25540 }
25541 /* post-decode pcode */
25542 ctx->n = UINT(ctx->Rn);
25543 ctx->t = UINT(ctx->Rt);
25544 ctx->acctype = ctx->AccType_NORMAL;
25545 if(SLICE(ctx->opc,1,1)==0) {
25546 if(SLICE(ctx->opc,0,0)==1) {
25547 ctx->memop = MemOp_LOAD;
25548 };
25549 if(ctx->size==3) {
25550 ctx->regsize = 0x40;
25551 };
25552 ctx->signed_ = FALSE;
25553 }
25554 else {
25555 if(ctx->size==3) {
25556 UNDEFINED;
25557 }
25558 else {
25559 ctx->memop = MemOp_LOAD;
25560 if(ctx->size==2 && SLICE(ctx->opc,0,0)==1) {
25561 UNDEFINED;
25562 }
25563 if(SLICE(ctx->opc,0,0)==1) {
25564 ctx->regsize = 0x20;
25565 };

Callers 3

decode_iclass_ldst_posFunction · 0.85

Calls 2

decode_fields32Function · 0.85
SignExtendFunction · 0.85

Tested by

no test coverage detected