--- np2/win9x/debuguty/viewasm.cpp 2003/10/16 17:59:10 1.1 +++ np2/win9x/debuguty/viewasm.cpp 2004/04/08 13:08:23 1.5 @@ -1,13 +1,13 @@ #include "compiler.h" #include "resource.h" #include "np2.h" -#include "i286.h" #include "viewer.h" #include "viewcmn.h" #include "viewmenu.h" #include "viewmem.h" #include "viewasm.h" #include "unasm.h" +#include "cpucore.h" static void set_viewseg(HWND hwnd, NP2VIEW_T *view, WORD seg) { @@ -29,8 +29,8 @@ static void viewasm_paint(NP2VIEW_T *vie BYTE buf[16]; char str[16]; HFONT hfont; - PREFIX_T fix; - UNASM_T una; + BOOL opsize; + _UNASM una; int step; hfont = CreateFont(16, 0, 0, 0, 0, 0, 0, 0, @@ -73,7 +73,6 @@ static void viewasm_paint(NP2VIEW_T *vie view->buf2.type = ALLOCTYPE_ASM; view->buf2.arg = seg4 + view->off; off = view->off; - unasm_reset(&fix); for (i=0; i<255; i++) { off &= 0xffff; *r++ = off; @@ -91,7 +90,7 @@ static void viewasm_paint(NP2VIEW_T *vie p = buf; viewmem_read(&(view->dmem), seg4 + off, buf, 16); } - step = unasm(off, p, &fix, NULL); + step = unasm(NULL, p, 16, FALSE, off); off += (WORD)step; } *r = off; @@ -106,7 +105,6 @@ static void viewasm_paint(NP2VIEW_T *vie off = view->off; } - unasm_reset(&fix); for (y=0; ybottom; y+=16) { wsprintf(str, "%04x:%04x", view->seg, off); TextOut(hdc, 0, y, str, 9); @@ -125,7 +123,7 @@ static void viewasm_paint(NP2VIEW_T *vie p = buf; viewmem_read(&(view->dmem), seg4 + off, buf, 16); } - step = unasm(off, p, &fix, &una); + step = unasm(&una, p, 16, FALSE, off); if (!step) { break; } @@ -147,19 +145,19 @@ LRESULT CALLBACK viewasm_proc(NP2VIEW_T case WM_COMMAND: switch(LOWORD(wp)) { case IDM_SEGCS: - set_viewseg(hwnd, view, I286_CS); + set_viewseg(hwnd, view, CPU_CS); break; case IDM_SEGDS: - set_viewseg(hwnd, view, I286_DS); + set_viewseg(hwnd, view, CPU_DS); break; case IDM_SEGES: - set_viewseg(hwnd, view, I286_ES); + set_viewseg(hwnd, view, CPU_ES); break; case IDM_SEGSS: - set_viewseg(hwnd, view, I286_SS); + set_viewseg(hwnd, view, CPU_SS); break; case IDM_SEGTEXT: @@ -215,11 +213,12 @@ void viewasm_init(NP2VIEW_T *dst, NP2VIE } } if (!src) { - dst->seg = I286_CS; - dst->off = I286_IP; + dst->seg = CPU_CS; + dst->off = CPU_IP; } dst->type = VIEWMODE_ASM; dst->maxline = 256; dst->mul = 1; dst->pos = 0; } +