Bochs/bochs/patches/patch.disasm-luizshigunov
Christophe Bothamy dc01227a03 - update patch so it apply cleanly. I will commit it to the cvs,
so we can easily revert it.
2003-01-21 13:21:17 +00:00

157 lines
3.9 KiB
Plaintext

----------------------------------------------------------------------
Patch name: patches/patch.disasm-luizshiguno
Author: Luiz Henrique Shigunov (
Date: Tue Jan 21 10:44:27 CET 2003
Detailed description:
I've implemented functions ALOb(), ObAL(), YbAL(),
ALXb() and eAXXv() from dis_groups.cc.
I've also changed dis_decode.cc to print cmpsd if code
is 32 bits and cmpsw if code is 16 bits. The same with
stosd, lodsd and scasd.
Patch was created with:
cvs diff -u
Apply patch to what version:
cvs checked out on Tue Jan 21 10:44:27 CET 2003
Instructions:
To patch, go to main bochs directory.
Type "patch -p0 < THIS_PATCH_FILE".
----------------------------------------------------------------------
Index: disasm/dis_decode.cc
===================================================================
RCS file: /cvsroot/bochs/bochs/disasm/dis_decode.cc,v
retrieving revision 1.12
diff -u -r1.12 dis_decode.cc
--- disasm/dis_decode.cc 19 Nov 2002 05:47:44 -0000 1.12
+++ disasm/dis_decode.cc 21 Jan 2003 09:42:54 -0000
@@ -960,16 +960,54 @@
goto done;
case 0xA6: dis_sprintf("cmpsb "); XbYb(); goto done;
- case 0xA7: dis_sprintf("cmpsw "); XvYv(); goto done;
+
+ case 0xA7:
+ if (db_32bit_opsize) {
+ dis_sprintf("cmpsd ");
+ }
+ else {
+ dis_sprintf("cmpsw ");
+ }
+ XvYv();
+ goto done;
+
case 0xA8: dis_sprintf("test AL, "); Ib(); goto done;
case 0xA9: dis_sprintf("test "); eAX(); dis_sprintf(", "); Iv(); goto done;
case 0xAA: dis_sprintf("stosb "); YbAL(); goto done;
- case 0xAB: dis_sprintf("stosw "); YveAX(); goto done;
+
+ case 0xAB:
+ if (db_32bit_opsize) {
+ dis_sprintf("stosd ");
+ }
+ else {
+ dis_sprintf("stosw ");
+ }
+ YveAX();
+ goto done;
+
case 0xAC: dis_sprintf("lodsb "); ALXb(); goto done;
- case 0xAD: dis_sprintf("lodsw "); eAXXv(); goto done;
- case 0xAE: dis_sprintf("scasb "); ALXb(); goto done;
- case 0xAF: dis_sprintf("scasw "); eAXXv(); goto done;
+ case 0xAD:
+ if (db_32bit_opsize) {
+ dis_sprintf("lodsd ");
+ }
+ else {
+ dis_sprintf("lodsw ");
+ }
+ eAXXv();
+ goto done;
+
+ case 0xAE: dis_sprintf("scasb "); YbAL(); goto done;
+
+ case 0xAF:
+ if (db_32bit_opsize) {
+ dis_sprintf("scasd ");
+ }
+ else {
+ dis_sprintf("scasw ");
+ }
+ YveAX();
+ goto done;
case 0xB0: dis_sprintf("mov AL, "); Ib(); goto done;
case 0xB1: dis_sprintf("mov CL, "); Ib(); goto done;
Index: disasm/dis_groups.cc
===================================================================
RCS file: /cvsroot/bochs/bochs/disasm/dis_groups.cc,v
retrieving revision 1.7
diff -u -r1.7 dis_groups.cc
--- disasm/dis_groups.cc 19 Nov 2002 05:47:44 -0000 1.7
+++ disasm/dis_groups.cc 21 Jan 2003 09:42:57 -0000
@@ -337,11 +337,57 @@
}
void
-bx_disassemble_c::YbAL(void) {dis_sprintf("*** YbAL() unfinished ***");}
+bx_disassemble_c::YbAL(void)
+{
+ char *edi;
+
+ if (db_32bit_addrsize) {
+ edi = "EDI";
+ }
+ else {
+ edi = "DI";
+ }
+
+ dis_sprintf("ES:[%s], AL", edi);
+}
+
void
-bx_disassemble_c::ALXb(void) {dis_sprintf("*** ALXb() unfinished ***");}
+bx_disassemble_c::ALXb(void)
+{
+ char *esi;
+
+ if (db_32bit_addrsize) {
+ esi = "ESI";
+ }
+ else {
+ esi = "SI";
+ }
+
+ dis_sprintf("AL, [%s]", esi);
+}
+
void
-bx_disassemble_c::eAXXv(void) { dis_sprintf("*** eAXXv() unfinished ***"); }
+bx_disassemble_c::eAXXv(void)
+{
+ char *eax, *esi;
+
+ if (db_32bit_opsize) {
+ eax = "EAX";
+ }
+ else {
+ eax = "AX";
+ }
+
+ if (db_32bit_addrsize) {
+ esi = "ESI";
+ }
+ else {
+ esi = "SI";
+ }
+
+ dis_sprintf("%s, [%s]", eax, esi);
+}
+
void
bx_disassemble_c::Es(void) {dis_sprintf("*** Es() unfinished ***");}
void