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

Function MOVN

arch/arm64/disassembler/decode2.c:17565–17599  ·  view source on GitHub ↗

movn.xml */

Source from the content-addressed store, hash-verified

17563
17564/* movn.xml */
17565int MOVN(context *ctx, Instruction *instr)
17566{
17567 int rc = DECODE_STATUS_UNMATCHED;
17568 /* class iclass_imm18_packed */
17569 /* sf=x|opc=00|100101|hw=xx|imm16=xxxxxxxxxxxxxxxx|Rd=xxxxx */
17570 if((INSWORD & 0x7F800000)==0x12800000) {
17571 decode_fields32(ENC_MOVN_32_MOVEWIDE, ctx, instr);
17572 ctx->d = UINT(ctx->Rd);
17573 ctx->datasize = (ctx->sf==1) ? 0x40 : 0x20;
17574 ctx->imm = ctx->imm16;
17575 if(!ctx->opc) {
17576 ctx->opcode = MoveWideOp_N;
17577 }
17578 else if(ctx->opc==2) {
17579 ctx->opcode = MoveWideOp_Z;
17580 }
17581 else if(ctx->opc==3) {
17582 ctx->opcode = MoveWideOp_K;
17583 }
17584 else {
17585 UNDEFINED;
17586 }
17587 if(ctx->sf==0 && SLICE(ctx->hw,1,1)==1) {
17588 UNDEFINED;
17589 }
17590 ctx->pos = UINT((ctx->hw<<4));
17591 /* regular aliases */
17592 bool encoding32 = ctx->sf==0 && !(ctx->hw&2);
17593 bool encoding64 = ctx->sf==1;
17594 if((!(IsZero(ctx->imm16) && ctx->hw!=0) && EncodingLabeled64Bit()) || (!(IsZero(ctx->imm16) && ctx->hw!=0) && !IsOnes(ctx->imm16,16) && EncodingLabeled32Bit())) return MOV_MOVN(ctx, instr);
17595 if(ctx->sf==0 && !(ctx->hw&2)) OK(ENC_MOVN_32_MOVEWIDE);
17596 if(ctx->sf==1) OK(ENC_MOVN_64_MOVEWIDE);
17597 }
17598 return rc;
17599}
17600
17601/* movs_ands_p_p_pp.xml */
17602int MOVS_ands_p_p_pp(context *ctx, Instruction *instr)

Callers 1

decode_iclass_movewideFunction · 0.85

Calls 4

decode_fields32Function · 0.85
IsZeroFunction · 0.85
IsOnesFunction · 0.85
MOV_MOVNFunction · 0.85

Tested by

no test coverage detected