sbb.c File Reference

#include <stdint.h>
#include "emu/emu_cpu.h"
#include "emu/emu_cpu_data.h"
#include "emu/emu_memory.h"
Include dependency graph for sbb.c:

Defines

#define INSTR_CALC(bits, a, b, c, operation, cpu)
#define INSTR_SET_FLAG_OF(cpu, operand, bits)
#define INSTR_SET_FLAG_CF(cpu, operand)
#define INSTR_CALC_AND_SET_FLAGS(bits, cpu, a, b, c, operation)
#define TRACK_INIT_ALL_FLAGS(instruction_p)

Functions

int32_t instr_sbb_18 (struct emu_cpu *c, struct emu_cpu_instruction *i)
int32_t instr_sbb_19 (struct emu_cpu *c, struct emu_cpu_instruction *i)
int32_t instr_sbb_1a (struct emu_cpu *c, struct emu_cpu_instruction *i)
int32_t instr_sbb_1b (struct emu_cpu *c, struct emu_cpu_instruction *i)
int32_t instr_sbb_1c (struct emu_cpu *c, struct emu_cpu_instruction *i)
int32_t instr_sbb_1d (struct emu_cpu *c, struct emu_cpu_instruction *i)
int32_t instr_group_1_80_sbb (struct emu_cpu *c, struct emu_cpu_instruction *i)
int32_t instr_group_1_81_sbb (struct emu_cpu *c, struct emu_cpu_instruction *i)
int32_t instr_group_1_83_sbb (struct emu_cpu *c, struct emu_cpu_instruction *i)

Define Documentation

#define INSTR_CALC ( bits,
a,
b,
c,
operation,
cpu   ) 
Value:
UINTOF(bits) operand_a = a;                                                             \
UINTOF(bits) operand_b = b;                                                             \
UINTOF(bits) operation_result = operand_a operation operand_b operation ((cpu->eflags & (1 << f_cf))?1:0);      \
c = operation_result;
#define INSTR_CALC_AND_SET_FLAGS ( bits,
cpu,
a,
b,
c,
operation   ) 
Value:
INSTR_CALC(bits, a, b, c, operation, cpu)                                                       \
INSTR_SET_FLAG_ZF(cpu)                                                                                  \
INSTR_SET_FLAG_PF(cpu)                                                                                  \
INSTR_SET_FLAG_SF(cpu)                                                                                  \
INSTR_SET_FLAG_OF(cpu, operation, bits)                                                         \
INSTR_SET_FLAG_CF(cpu, operation)
#define INSTR_SET_FLAG_CF ( cpu,
operand   ) 
Value:
{                                                                                                                                                               \
        uint64_t ux = (uint64_t)operand_a;                                          \
        uint64_t uy = (uint64_t)operand_b;                                          \
        uint64_t uz = 0;                                                            \
        uz = ux operand uy operand ((cpu->eflags & (1 << f_cf))?1:0);                                   \
        /*printf("cf: ux %lli + uy %lli + cf %i = uz %lli \n", ux, uy, (cpu->eflags & (1 << f_cf))?1:0, uz);*/ \
                                                                                                                                                                \
        if (uz < max_inttype_borders[sizeof(operation_result)][1][0] || uz > max_inttype_borders[sizeof(operation_result)][1][1] \
        || uz != (uint64_t)operation_result )                                                                       \
        {                                                                           \
                CPU_FLAG_SET(cpu, f_cf);                                                 \
        }else                                                                       \
        {                                                                           \
                CPU_FLAG_UNSET(cpu, f_cf);                                               \
        }                                                                           \
}
#define INSTR_SET_FLAG_OF ( cpu,
operand,
bits   ) 
Value:
{                                                                                                                                                               \
        int64_t sx = (INTOF(bits))operand_a;                                            \
        int64_t sy = (INTOF(bits))operand_b;                                            \
        int64_t sz = 0;                                                             \
                                                                                                                                                                \
        sz = sx operand sy operand ((cpu->eflags & (1 << f_cf))?1:0);                                           \
        /* printf("of: sx %lli + sy %lli + cf %i = sz %lli \n", sx, sy, (cpu->eflags & (1 << f_cf))?1:0, sz); */ \
                                                                                                                                                        \
        if (sz < max_inttype_borders[sizeof(operation_result)][0][0] || sz > max_inttype_borders[sizeof(operation_result)][0][1] \
        || sz != (INTOF(bits))operation_result )                                                                            \
        {                                                                           \
                CPU_FLAG_SET(cpu, f_of);                                                 \
        }else                                                                       \
        {                                                                           \
                CPU_FLAG_UNSET(cpu, f_of);                                               \
        }                                                                           \
}
#define TRACK_INIT_ALL_FLAGS ( instruction_p   ) 
Value:
TRACK_INIT_EFLAG(instruction_p, f_zf); \
TRACK_INIT_EFLAG(instruction_p, f_pf); \
TRACK_INIT_EFLAG(instruction_p, f_sf); \
TRACK_INIT_EFLAG(instruction_p, f_of); \
TRACK_INIT_EFLAG(instruction_p, f_cf);

Function Documentation

int32_t instr_group_1_80_sbb ( struct emu_cpu c,
struct emu_cpu_instruction i 
)
int32_t instr_group_1_81_sbb ( struct emu_cpu c,
struct emu_cpu_instruction i 
)
int32_t instr_group_1_83_sbb ( struct emu_cpu c,
struct emu_cpu_instruction i 
)
int32_t instr_sbb_18 ( struct emu_cpu c,
struct emu_cpu_instruction i 
)
int32_t instr_sbb_19 ( struct emu_cpu c,
struct emu_cpu_instruction i 
)
int32_t instr_sbb_1a ( struct emu_cpu c,
struct emu_cpu_instruction i 
)
int32_t instr_sbb_1b ( struct emu_cpu c,
struct emu_cpu_instruction i 
)
int32_t instr_sbb_1c ( struct emu_cpu c,
struct emu_cpu_instruction i 
)
int32_t instr_sbb_1d ( struct emu_cpu c,
struct emu_cpu_instruction i 
)

Generated on Sun Jan 9 16:50:25 2011 for libemu by  doxygen 1.6.1