Skip to content

Commit

Permalink
fix i286x div (T.Yui)
Browse files Browse the repository at this point in the history
  • Loading branch information
yui committed Aug 3, 2004
1 parent 64e88e5 commit 9ed3bb1
Show file tree
Hide file tree
Showing 9 changed files with 345 additions and 158 deletions.
13 changes: 7 additions & 6 deletions i286x/i286x.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -343,7 +343,7 @@ LABEL void removeprefix(void) {
I286 _reserved(void) {

__asm {
inc si // 01/08/31
// inc si // 01/08/31
INT_NUM(6)
}
}
Expand Down Expand Up @@ -1695,7 +1695,7 @@ I286 _arpl(void) {
xor eax, eax
cmp bh, 0c0h
setc al
add si, ax
// add si, ax
add eax, 10
I286CLOCK(eax)
INT_NUM(6)
Expand Down Expand Up @@ -3660,7 +3660,8 @@ I286 _into(void) { // CE: into
GET_NEXTPRE1
ret

intovf: INT_NUM(4)
intovf: inc si // ver0.80
INT_NUM(4)
}
}

Expand Down Expand Up @@ -4348,7 +4349,7 @@ I286 _ope0xff(void) { // FF:

// -------------------------------------------------------------------------

void (*i286op[])(void) = {
const I286TBL i286op[256] = {
add_ea_r8, // 00: add EA, REG8
add_ea_r16, // 01: add EA, REG16
add_r8_ea, // 02: add REG8, EA
Expand Down Expand Up @@ -4672,7 +4673,7 @@ I286 repe_segprefix_ds(void) {
}
}

void (*i286op_repe[])(void) = {
const I286TBL i286op_repe[256] = {
add_ea_r8, // 00: add EA, REG8
add_ea_r16, // 01: add EA, REG16
add_r8_ea, // 02: add REG8, EA
Expand Down Expand Up @@ -4996,7 +4997,7 @@ I286 repne_segprefix_ds(void) {
}
}

void (*i286op_repne[])(void) = {
const I286TBL i286op_repne[256] = {
add_ea_r8, // 00: add EA, REG8
add_ea_r16, // 01: add EA, REG16
add_r8_ea, // 02: add REG8, EA
Expand Down
15 changes: 9 additions & 6 deletions i286x/i286x.h
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,9 @@
#define I286 __declspec(naked) static void
#define I286EXT __declspec(naked) void

typedef void (*I286TBL)(void);


#define I286IRQCHECKTERM \
__asm { xor eax, eax } \
__asm { cmp I286_REMCLOCK, eax } \
Expand All @@ -88,13 +91,13 @@ extern void __fastcall i286x_localint(void);
extern void __fastcall i286x_selector(void);
extern void removeprefix(void);

extern void (*i286op[])(void);
extern void (*i286op_repne[])(void);
extern void (*i286op_repe[])(void);
extern const I286TBL i286op[256];
extern const I286TBL i286op_repne[256];
extern const I286TBL i286op_repe[256];

extern void (*v30op[])(void);
extern void (*v30op_repne[])(void);
extern void (*v30op_repe[])(void);
extern I286TBL v30op[256];
extern I286TBL v30op_repne[256];
extern I286TBL v30op_repe[256];

void i286xadr_init(void);

12 changes: 6 additions & 6 deletions i286x/i286xadr.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -330,7 +330,7 @@ LABEL static void p2ea_bx_disp16(void) {
}
}

static void (* const peadst_tbl[])(void) = {
static const I286TBL peadst_tbl[] = {
p2ea_bx_si, p2ea_bx_di,
p2ea_bp_si, p2ea_bp_di,
p2ea_si, p2ea_di,
Expand Down Expand Up @@ -635,7 +635,7 @@ LABEL static void p2lea_bx_disp16(void) {
}
}

static void (* const plea_tbl[])(void) = {
static const I286TBL plea_tbl[] = {
p2lea_bx_si, p2lea_bx_di,
p2lea_bp_si, p2lea_bp_di,
p2lea_si, p2lea_di,
Expand Down Expand Up @@ -980,7 +980,7 @@ LABEL static void a_bx_disp16(void) {
}
}

static void (* const pgetea_tbl[])(void) = {
static const I286TBL pgetea_tbl[] = {
a_bx_si, a_bx_di,
a_bp_si, a_bp_di,
a_si, a_di,
Expand All @@ -999,9 +999,9 @@ static void (* const pgetea_tbl[])(void) = {

// --------------------------------------------------------------------------

void (*p_ea_dst[256])(void);
void (*p_lea[256])(void);
void (*p_get_ea[256])(void);
I286TBL p_ea_dst[256];
I286TBL p_lea[256];
I286TBL p_get_ea[256];


void i286xadr_init(void) {
Expand Down
8 changes: 5 additions & 3 deletions i286x/i286xadr.h
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
extern void (*p_ea_dst[256])(void);
extern void (*p_lea[256])(void);
extern void (*p_get_ea[256])(void);

extern I286TBL p_ea_dst[256];
extern I286TBL p_lea[256];
extern I286TBL p_get_ea[256];

Loading

0 comments on commit 9ed3bb1

Please sign in to comment.