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

Function SUB_addsub_imm

arch/arm64/disassembler/decode2.c:27193–27216  ·  view source on GitHub ↗

sub_addsub_imm.xml */

Source from the content-addressed store, hash-verified

27191
27192/* sub_addsub_imm.xml */
27193int SUB_addsub_imm(context *ctx, Instruction *instr)
27194{
27195 int rc = DECODE_STATUS_UNMATCHED;
27196 /* class iclass_no_s */
27197 /* sf=x|op=1|S=0|100010|sh=x|imm12=xxxxxxxxxxxx|Rn=xxxxx|Rd=xxxxx */
27198 if((INSWORD & 0x7F800000)==0x51000000) {
27199 decode_fields32(ENC_SUB_32_ADDSUB_IMM, ctx, instr);
27200 ctx->d = UINT(ctx->Rd);
27201 ctx->n = UINT(ctx->Rn);
27202 ctx->datasize = (ctx->sf==1) ? 0x40 : 0x20;
27203 ctx->sub_op = (ctx->op==1);
27204 ctx->setflags = (ctx->S==1);
27205 instr->setflags = (ctx->S==1) ? FLAGEFFECT_SETS : FLAGEFFECT_NONE;
27206 if(!ctx->sh) {
27207 ctx->imm = ZeroExtend(ctx->imm12,ctx->datasize);
27208 }
27209 else if(ctx->sh) {
27210 ctx->imm = ZeroExtend(((ctx->imm12<<12)|0),ctx->datasize);
27211 }
27212 if(ctx->sf==0) OK(ENC_SUB_32_ADDSUB_IMM);
27213 if(ctx->sf==1) OK(ENC_SUB_64_ADDSUB_IMM);
27214 }
27215 return rc;
27216}
27217
27218/* sub_addsub_shift.xml */
27219int SUB_addsub_shift(context *ctx, Instruction *instr)

Callers 1

decode_iclass_addsub_immFunction · 0.85

Calls 1

decode_fields32Function · 0.85

Tested by

no test coverage detected