#include <stdint.h>#include <errno.h>#include "emu/emu.h"#include "emu/emu_cpu.h"#include "emu/emu_cpu_data.h"#include "emu/emu_cpu_stack.h"#include "emu/emu_memory.h"
Defines | |
| #define | INSTR_CALC(bits, a, b, cpu) |
| #define | INSTR_CALC_AND_SET_FLAGS(bits, cpu, a, b) |
Functions | |
| int32_t | instr_group_2_c0_rcr (struct emu_cpu *c, struct emu_cpu_instruction *i) |
| int32_t | instr_group_2_c1_rcr (struct emu_cpu *c, struct emu_cpu_instruction *i) |
| int32_t | instr_group_2_d0_rcr (struct emu_cpu *c, struct emu_cpu_instruction *i) |
| int32_t | instr_group_2_d1_rcr (struct emu_cpu *c, struct emu_cpu_instruction *i) |
| int32_t | instr_group_2_d2_rcr (struct emu_cpu *c, struct emu_cpu_instruction *i) |
| int32_t | instr_group_2_d3_rcr (struct emu_cpu *c, struct emu_cpu_instruction *i) |
| #define INSTR_CALC | ( | bits, | |||
| a, | |||||
| b, | |||||
| cpu | ) |
UINTOF(bits) operation_result = (a); \ uint8_t operand_b = (b); \ { \ if( operand_b == 1 ) \ { \ if( (operation_result >> (bits - 1)) ^ (cpu->eflags >> f_cf) ) \ { \ CPU_FLAG_SET(cpu, f_of); \ } \ else \ { \ CPU_FLAG_UNSET(cpu, f_of); \ } \ } \ operand_b = (operand_b & 0x1f) % (sizeof(operation_result) * 8 + 1); \ operation_result = operation_result >> operand_b | operation_result << (bits - operand_b + 1); \ if( CPU_FLAG_ISSET(cpu, f_cf) && operand_b > 0 ) \ { \ operation_result |= 1 << (bits - operand_b); \ } \ if( (a) & (1 << (operand_b - 1)) && operand_b > 0 ) \ { \ CPU_FLAG_SET(cpu, f_cf); \ } \ a = operation_result; \ }
| #define INSTR_CALC_AND_SET_FLAGS | ( | bits, | |||
| cpu, | |||||
| a, | |||||
| b | ) |
INSTR_CALC(bits, a, b, cpu) \ INSTR_SET_FLAG_ZF(cpu) \ INSTR_SET_FLAG_PF(cpu) \ INSTR_SET_FLAG_SF(cpu)
| int32_t instr_group_2_c0_rcr | ( | struct emu_cpu * | c, | |
| struct emu_cpu_instruction * | i | |||
| ) |
| int32_t instr_group_2_c1_rcr | ( | struct emu_cpu * | c, | |
| struct emu_cpu_instruction * | i | |||
| ) |
References emu_cpu_instruction::ea, emu_cpu_instruction::imm8, INSTR_CALC_AND_SET_FLAGS, MEM_DWORD_READ, MEM_DWORD_WRITE, MEM_WORD_READ, MEM_WORD_WRITE, emu_cpu_instruction::mod, emu_cpu_instruction::modrm, PREFIX_OPSIZE, emu_cpu_instruction::prefixes, emu_cpu::reg, emu_cpu::reg16, and emu_cpu_instruction::rm.
Referenced by instr_group_2_c1().
| int32_t instr_group_2_d0_rcr | ( | struct emu_cpu * | c, | |
| struct emu_cpu_instruction * | i | |||
| ) |
References emu_cpu_instruction::ea, INSTR_CALC_AND_SET_FLAGS, MEM_BYTE_READ, MEM_BYTE_WRITE, emu_cpu_instruction::mod, emu_cpu_instruction::modrm, emu_cpu::reg8, and emu_cpu_instruction::rm.
Referenced by instr_group_2_d0().
| int32_t instr_group_2_d1_rcr | ( | struct emu_cpu * | c, | |
| struct emu_cpu_instruction * | i | |||
| ) |
References emu_cpu_instruction::ea, INSTR_CALC_AND_SET_FLAGS, MEM_DWORD_READ, MEM_DWORD_WRITE, MEM_WORD_READ, MEM_WORD_WRITE, emu_cpu_instruction::mod, emu_cpu_instruction::modrm, PREFIX_OPSIZE, emu_cpu_instruction::prefixes, emu_cpu::reg, emu_cpu::reg16, and emu_cpu_instruction::rm.
Referenced by instr_group_2_d1().
| int32_t instr_group_2_d2_rcr | ( | struct emu_cpu * | c, | |
| struct emu_cpu_instruction * | i | |||
| ) |
References cl, emu_cpu_instruction::ea, INSTR_CALC_AND_SET_FLAGS, MEM_BYTE_READ, MEM_BYTE_WRITE, emu_cpu_instruction::mod, emu_cpu_instruction::modrm, emu_cpu::reg8, and emu_cpu_instruction::rm.
Referenced by instr_group_2_d2().
| int32_t instr_group_2_d3_rcr | ( | struct emu_cpu * | c, | |
| struct emu_cpu_instruction * | i | |||
| ) |
References cl, emu_cpu_instruction::ea, INSTR_CALC_AND_SET_FLAGS, MEM_DWORD_READ, MEM_DWORD_WRITE, MEM_WORD_READ, MEM_WORD_WRITE, emu_cpu_instruction::mod, emu_cpu_instruction::modrm, PREFIX_OPSIZE, emu_cpu_instruction::prefixes, emu_cpu::reg, emu_cpu::reg16, emu_cpu::reg8, and emu_cpu_instruction::rm.
Referenced by instr_group_2_d3().
1.6.1