Package: z80dasm Version: 1.1.5-1 Severity: wishlist Tags: patch upstream Dear Maintainer,
*** Reporter, please consider answering these questions, where appropriate *** * What led up to the situation? we grabbed old parts off the shelf * What exactly did you do (or not do) that was effective (or ineffective)? patched z80dasm to add support for z180 extended instructions needed to disassemble project rom * What was the outcome of this action? a complete diassembly in less than a day and mild astonishment * What outcome did you expect instead? much more work *** End of the template - remove these template lines *** -- System Information: Debian Release: 10.8 APT prefers stable APT policy: (500, 'stable'), (100, 'buster-fasttrack') Architecture: amd64 (x86_64) Shell: /bin/sh linked to /bin/dash Init: sysvinit (via /sbin/init) LSM: AppArmor: enabled -- no debconf information
diff --git a/src/dz80.c b/src/dz80.c index 78c9bb3..a1155ee 100644 --- a/src/dz80.c +++ b/src/dz80.c @@ -247,7 +247,13 @@ else if((a>=0x70)&&(a<0x80)&&(ed70[a-0x70][0]!='0'))FP(fx,"%s",ed70[a-0x70]); else if((a>=0xa0)&&(a<0xb0)&&(eda0[a-0xa0][0]!='0'))FP(fx,"%s",eda0[a-0xa0]); else if((a>=0xb0)&&(a<0xc0)&&(edb0[a-0xb0][0]!='0'))FP(fx,"%s",edb0[a-0xb0]); */ - if((a>=0x40)&&(a<0x50)&&(ed40[a-0x40][0]!='0')) i=0; + if((a & 0xc6)==0){ /* 0 0 g g g 0 0 x ino, outo */ + i=6; + //} + //else if((a & 0xcF)==0x6c){ /* 0 1 w w 1 1 0 0 mlt */ + // i=7; + } + else if((a>=0x40)&&(a<0x50)&&(ed40[a-0x40][0]!='0')) i=0; else if((a>=0x50)&&(a<0x60)&&(ed50[a-0x50][0]!='0')) i=1; else if((a>=0x60)&&(a<0x70)&&(ed60[a-0x60][0]!='0')) i=2; else if((a>=0x70)&&(a<0x80)&&(ed70[a-0x70][0]!='0')) i=3; @@ -275,10 +281,20 @@ else if((a>=0xb0)&&(a<0xc0)&&(edb0[a-0xb0][0]!='0'))FP(fx,"%s",edb0[a-0xb0]); break; case 5: strcpy(rstr,edb0[a-0xb0]); break; + case 6: //before_undoc(3); + strcpy(rstr,edio[a&1]); + break; + //case 7: //before_undoc(2); + // break; } /*if arg not in prog range it is a constant*/ - if(a == 0x43) + if(i==6) + { + r=(a & 0x38) >>3; + strcpy(stro,regf[r]); + } + else if(a == 0x43) { strcpy(stro,"%s),bc"); } @@ -298,7 +314,14 @@ else if((a>=0xb0)&&(a<0xc0)&&(edb0[a-0xb0][0]!='0'))FP(fx,"%s",edb0[a-0xb0]); stro[0] = 0; } - if(stro[0] == 0) { + if(i==6){ + if (a&1){ + FP(fx,rstr,t[2],stro); + }else{ + FP(fx,rstr,stro,t[2]); + } + return(3); + } else if(stro[0] == 0) { FP(fx,"%s",rstr); return(2); } else { diff --git a/src/dz80.h b/src/dz80.h index 0c365a7..3bcf8f8 100644 --- a/src/dz80.h +++ b/src/dz80.h @@ -36,6 +36,8 @@ int msg(int level, const char *format, ...); /* from dz80dat.c */ extern const char *rarg[]; extern const struct comm comtab[]; +extern const char *regf[]; +extern const char *edio[]; extern const char *ed40[]; extern const char *ed50[]; extern const char *ed60[]; diff --git a/src/dz80dat.c b/src/dz80dat.c index 4c496fa..6870bf3 100644 --- a/src/dz80dat.c +++ b/src/dz80dat.c @@ -264,6 +264,20 @@ const struct comm comtab[]={ /*ff*/{"rst 38h","vv",1,0,0}, }; +const char *regf[]={ +/*0*/"b", +/*1*/"c", +/*2*/"d", +/*3*/"e", +/*4*/"h", +/*5*/"l", +/*6*/""/* invalid */, +/*7*/"a", + }; +const char *edio[]={ +/*38*/"ino %s, (0x%02llx)", +/*39*/"outo (0x%02llx), %s", +}; const char *ed40[]={ /*40*/"in b,(c)", /*41*/"out (c),b", @@ -277,7 +291,7 @@ const char *ed40[]={ /*49*/"out (c),c", /*4a*/"adc hl,bc", /*4b*/"ld bc,(", -/*4c*/"00", +/*4c*/"mlt bc", /*4d*/"reti", /*4e*/"00", /*4f*/"ld r,a", @@ -296,7 +310,7 @@ const char *ed50[]={ /*59*/"out (c),e", /*5a*/"adc hl,de", /*5b*/"ld de,(", -/*5c*/"00", +/*5c*/"mlt de", /*5d*/"00", /*5e*/"im 2", /*5f*/"ld a,r", @@ -307,7 +321,7 @@ const char *ed60[]={ /*61*/"out (c),h", /*62*/"sbc hl,hl", /*63*/"00", -/*64*/"00", +/*64*/"tst m", /*65*/"00", /*66*/"00", /*67*/"rrd", @@ -315,7 +329,7 @@ const char *ed60[]={ /*69*/"out (c),l", /*6a*/"adc hl,hl", /*6b*/"00", -/*6c*/"00", +/*6c*/"mlt hl", /*6d*/"00", /*6e*/"00", /*6f*/"rld", @@ -326,7 +340,7 @@ const char *ed70[]={ /*71*/"out (c),0", /*72*/"sbc hl,sp", /*73*/"ld (", -/*74*/"00", +/*74*/"0tstio (", // incomplete /*75*/"00", /*76*/"00", /*77*/"00", @@ -334,7 +348,7 @@ const char *ed70[]={ /*79*/"out (c),a", /*7a*/"adc hl,sp", /*7b*/"ld sp,(", -/*7c*/"00", +/*7c*/"mlt sp", /*7d*/"00", /*7e*/"00", /*7f*/"00",