Lines Matching refs:byte

49  *   the ModR/M byte is required to decode a particular instruction.
54 * @param opcode - The last byte of the instruction's opcode, not counting
56 * @return - TRUE if the ModR/M byte is required, FALSE otherwise.
104 * @param modRM - The ModR/M byte if required, or any value if not.
180 * byte from the instruction's memory and advance the cursor.
184 * @param byte - A pointer to a pre-allocated memory buffer to be populated
188 static int consumeByte(struct InternalInstruction* insn, uint8_t* byte) {
189 int ret = insn->reader(insn->readerArg, byte, insn->readerCursor);
201 * @param byte - See consumeByte().
204 static int lookAtByte(struct InternalInstruction* insn, uint8_t* byte) {
205 return insn->reader(insn->readerArg, byte, insn->readerCursor);
217 uint8_t byte; \
219 &byte, \
223 combined = combined | ((uint64_t)byte << (offset * 8)); \
323 uint8_t byte = 0;
335 if (consumeByte(insn, &byte))
339 * If the byte is a LOCK/REP/REPNE prefix and not a part of the opcode, then
342 if (insn->readerCursor - 1 == insn->startLocation && byte == 0xf0)
346 && (byte == 0xf2 || byte == 0xf3)
350 * If the byte is 0xf2 or 0xf3, and any of the following conditions are
356 if ((byte == 0xf2 || byte == 0xf3) &&
361 * Also if the byte is 0xf3, and the following condition is met:
366 if (byte == 0xf3 &&
381 switch (byte) {
388 setPrefixPresent(insn, byte, prefixLocation);
396 switch (byte) {
422 setPrefixPresent(insn, byte, prefixLocation);
429 setPrefixPresent(insn, byte, prefixLocation);
436 setPrefixPresent(insn, byte, prefixLocation);
438 default: /* Not a prefix byte */
444 dbgprintf(insn, "Found prefix 0x%hhx", byte);
449 if (byte == 0xc4) {
453 dbgprintf(insn, "Couldn't read second byte of VEX");
467 insn->vexXopPrefix[0] = byte;
495 else if (byte == 0xc5) {
499 dbgprintf(insn, "Couldn't read second byte of VEX");
511 insn->vexXopPrefix[0] = byte;
531 else if (byte == 0x8f) {
535 dbgprintf(insn, "Couldn't read second byte of XOP");
549 insn->vexXopPrefix[0] = byte;
579 if ((byte & 0xf0) == 0x40) {
587 insn->rexPrefix = byte;
590 dbgprintf(insn, "Found REX prefix 0x%hhx", byte);
634 * readOpcode - Reads the opcode (excepting the ModR/M byte in the case of
697 dbgprintf(insn, "Found a two-byte escape prefix (0x%hhx)", current);
703 dbgprintf(insn, "Found a three-byte escape prefix (0x%hhx)", current);
710 dbgprintf(insn, "Found a three-byte escape prefix (0x%hhx)", current);
717 dbgprintf(insn, "Found a three-byte escape prefix (0x%hhx)", current);
724 dbgprintf(insn, "Found a three-byte escape prefix (0x%hhx)", current);
731 dbgprintf(insn, "Didn't find a three-byte escape prefix");
751 * the ModR/M byte as appropriate for extended and escape opcodes,
820 * getID - Determines the ID of an instruction, consuming the ModR/M byte as
999 * readSIB - Consumes the SIB byte to determine addressing information for an
1002 * @param insn - The instruction whose SIB byte is to be read.
1003 * @return - 0 if the SIB byte was successfully read; nonzero otherwise.
1083 debug("Cannot have Mod = 0b11 and a SIB byte");
1099 * @return - 0 if the displacement byte was successfully read; nonzero
1141 * readModRM - Consumes all addressing information (ModR/M byte, SIB byte, and
1705 * byte in the instruction.
1745 dbgprintf(insn, "Instruction exceeds 15-byte limit");