MCPcopy Create free account
hub / github.com/capstone-engine/capstone / XCore_getInstruction

Function XCore_getInstruction

arch/XCore/XCoreDisassembler.c:732–766  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

730#define GET_SUBTARGETINFO_ENUM
731#include "XCoreGenInstrInfo.inc"
732bool XCore_getInstruction(csh ud, const uint8_t *code, size_t code_len, MCInst *MI,
733 uint16_t *size, uint64_t address, void *info)
734{
735 uint16_t insn16;
736 uint32_t insn32;
737 DecodeStatus Result;
738
739 if (!readInstruction16(code, code_len, &insn16)) {
740 return false;
741 }
742
743 if (MI->flat_insn->detail) {
744 memset(MI->flat_insn->detail, 0, offsetof(cs_detail, xcore)+sizeof(cs_xcore));
745 }
746
747 // Calling the auto-generated decoder function.
748 Result = decodeInstruction_2(DecoderTable16, MI, insn16, address, info, 0);
749 if (Result != MCDisassembler_Fail) {
750 *size = 2;
751 return true;
752 }
753
754 if (!readInstruction32(code, code_len, &insn32)) {
755 return false;
756 }
757
758 // Calling the auto-generated decoder function.
759 Result = decodeInstruction_4(DecoderTable32, MI, insn32, address, info, 0);
760 if (Result != MCDisassembler_Fail) {
761 *size = 4;
762 return true;
763 }
764
765 return false;
766}
767
768void XCore_init(MCRegisterInfo *MRI)
769{

Callers

nothing calls this directly

Calls 2

readInstruction16Function · 0.70
readInstruction32Function · 0.70

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…