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

Function AND_log_imm

arch/arm64/disassembler/decode2.c:645–685  ·  view source on GitHub ↗

and_log_imm.xml */

Source from the content-addressed store, hash-verified

643
644/* and_log_imm.xml */
645int AND_log_imm(context *ctx, Instruction *instr)
646{
647 int rc = DECODE_STATUS_UNMATCHED;
648 /* class iclass_no_s */
649 /* sf=x|opc=00|100100|N=x|immr=xxxxxx|imms=xxxxxx|Rn=xxxxx|Rd=xxxxx */
650 if((INSWORD & 0x7F800000)==0x12000000) {
651 decode_fields32(ENC_AND_32_LOG_IMM, ctx, instr);
652 ctx->d = UINT(ctx->Rd);
653 ctx->n = UINT(ctx->Rn);
654 ctx->datasize = (ctx->sf==1) ? 0x40 : 0x20;
655 if(!ctx->opc) {
656 ctx->op = LogicalOp_AND;
657 ctx->setflags = FALSE;
658 instr->setflags = FLAGEFFECT_NONE;
659 }
660 else if(ctx->opc==1) {
661 ctx->op = LogicalOp_ORR;
662 ctx->setflags = FALSE;
663 instr->setflags = FLAGEFFECT_NONE;
664 }
665 else if(ctx->opc==2) {
666 ctx->op = LogicalOp_EOR;
667 ctx->setflags = FALSE;
668 instr->setflags = FLAGEFFECT_NONE;
669 }
670 else if(ctx->opc==3) {
671 ctx->op = LogicalOp_AND;
672 ctx->setflags = TRUE;
673 instr->setflags = FLAGEFFECT_SETS;
674 }
675 if(ctx->sf==0 && ctx->N!=0) {
676 UNDEFINED;
677 }
678 DecodeBitMasksCheckUndefined(ctx->N,ctx->imms);
679 DecodeBitMasks_ReturnType dbmrt = DecodeBitMasks(ctx->N,ctx->imms,ctx->immr);
680 ctx->imm = dbmrt.wmask;
681 if(ctx->sf==0 && ctx->N==0) OK(ENC_AND_32_LOG_IMM);
682 if(ctx->sf==1) OK(ENC_AND_64_LOG_IMM);
683 }
684 return rc;
685}
686
687/* and_log_shift.xml */
688int AND_log_shift(context *ctx, Instruction *instr)

Callers 1

decode_iclass_log_immFunction · 0.85

Calls 2

decode_fields32Function · 0.85
DecodeBitMasksFunction · 0.85

Tested by

no test coverage detected