Lines Matching defs:byte
51 * the ModR/M byte is required to decode a particular instruction.
56 * @param opcode - The last byte of the instruction's opcode, not counting
58 * @return - TRUE if the ModR/M byte is required, FALSE otherwise.
97 * @param modRM - The ModR/M byte if required, or any value if not.
160 * byte from the instruction's memory and advance the cursor.
164 * @param byte - A pointer to a pre-allocated memory buffer to be populated
168 static int consumeByte(struct InternalInstruction* insn, uint8_t* byte) {
169 int ret = insn->reader(insn->readerArg, byte, insn->readerCursor);
181 * @param byte - See consumeByte().
184 static int lookAtByte(struct InternalInstruction* insn, uint8_t* byte) {
185 return insn->reader(insn->readerArg, byte, insn->readerCursor);
197 uint8_t byte; \
199 &byte, \
203 combined = combined | ((type)byte << ((type)offset * 8)); \
303 uint8_t byte = 0;
313 if (consumeByte(insn, &byte))
317 * If the first byte is a LOCK prefix break and let it be disassembled
320 * lock prefix if it is not the first byte.
322 if (insn->readerCursor - 1 == insn->startLocation && byte == 0xf0)
325 switch (byte) {
332 setPrefixPresent(insn, byte, prefixLocation);
340 switch (byte) {
366 setPrefixPresent(insn, byte, prefixLocation);
373 setPrefixPresent(insn, byte, prefixLocation);
380 setPrefixPresent(insn, byte, prefixLocation);
382 default: /* Not a prefix byte */
388 dbgprintf(insn, "Found prefix 0x%hhx", byte);
393 if (byte == 0xc4) {
397 dbgprintf(insn, "Couldn't read second byte of VEX");
411 insn->vexPrefix[0] = byte;
437 else if (byte == 0xc5) {
441 dbgprintf(insn, "Couldn't read second byte of VEX");
453 insn->vexPrefix[0] = byte;
475 if ((byte & 0xf0) == 0x40) {
483 insn->rexPrefix = byte;
486 dbgprintf(insn, "Found REX prefix 0x%hhx", byte);
530 * readOpcode - Reads the opcode (excepting the ModR/M byte in the case of
581 dbgprintf(insn, "Found a two-byte escape prefix (0x%hhx)", current);
589 dbgprintf(insn, "Found a three-byte escape prefix (0x%hhx)", current);
598 dbgprintf(insn, "Found a three-byte escape prefix (0x%hhx)", current);
607 dbgprintf(insn, "Found a three-byte escape prefix (0x%hhx)", current);
616 dbgprintf(insn, "Found a three-byte escape prefix (0x%hhx)", current);
625 dbgprintf(insn, "Didn't find a three-byte escape prefix");
645 * the ModR/M byte as appropriate for extended and escape opcodes,
714 * getID - Determines the ID of an instruction, consuming the ModR/M byte as
913 * readSIB - Consumes the SIB byte to determine addressing information for an
916 * @param insn - The instruction whose SIB byte is to be read.
917 * @return - 0 if the SIB byte was successfully read; nonzero otherwise.
998 debug("Cannot have Mod = 0b11 and a SIB byte");
1014 * @return - 0 if the displacement byte was successfully read; nonzero
1056 * readModRM - Consumes all addressing information (ModR/M byte, SIB byte, and
1616 * byte in the instruction.
1654 dbgprintf(insn, "Instruction exceeds 15-byte limit");