diff options
author | Michael Shalayeff <mickey@cvs.openbsd.org> | 2000-03-06 14:16:24 +0000 |
---|---|---|
committer | Michael Shalayeff <mickey@cvs.openbsd.org> | 2000-03-06 14:16:24 +0000 |
commit | 6b18ef7db5cf20dabbe8f1f88c0eda896331adcf (patch) | |
tree | ac7d5583a71de61535d4c219467c9d64496a4bbb /sys | |
parent | 485e53fa984ae48f013ee70196fc7744430b1d27 (diff) |
do signed hex instead of %D
Diffstat (limited to 'sys')
-rw-r--r-- | sys/arch/hppa/hppa/db_disasm.c | 52 |
1 files changed, 35 insertions, 17 deletions
diff --git a/sys/arch/hppa/hppa/db_disasm.c b/sys/arch/hppa/hppa/db_disasm.c index 2d7b4bb0a86..3d6a25adcb0 100644 --- a/sys/arch/hppa/hppa/db_disasm.c +++ b/sys/arch/hppa/hppa/db_disasm.c @@ -1,4 +1,4 @@ -/* $OpenBSD: db_disasm.c,v 1.7 2000/01/17 06:56:41 mickey Exp $ */ +/* $OpenBSD: db_disasm.c,v 1.8 2000/03/06 14:16:23 mickey Exp $ */ /* * Copyright (c) 1999 Michael Shalayeff @@ -1549,16 +1549,21 @@ ldDasm(i, ofs, w) OFS ofs; int w; { - register u_int d = Disp(w); + register int d = Disp(w); + char s[2]; + + s[1] = '\0'; + if (d < 0) { + d = -d; + s[0] = '-'; + } else + s[0] = '\0'; if (Rsb(w) == 0 && Match("ldo")) { - db_printf("ldi\t%D,%%r%d",d,Rta(w)); + db_printf("ldi\t%s%X,%%r%d",s,d,Rta(w)); return (1); } - if (d < 2048) - db_printf("%s\tR'%X",i->mnem,d); - else - db_printf("%s\t%D",i->mnem,d); + db_printf("%s\t%s%s%X",i->mnem,(d < 2048? "R'":""), s, d); if (Dss(w)) db_printf("(%%sr%d,%%r%d),%%r%d",Dss(w),Rsb(w),Rta(w)); else @@ -1573,13 +1578,20 @@ stDasm(i, ofs, w) OFS ofs; int w; { - register u_int d = Disp(w); + register int d = Disp(w); + char s[2]; db_printf("\t%%r%d,",Rta(w)); - if (d < 2048) - db_printf("R'%X",d); - else - db_printf("%D",d); + + s[1] = '\0'; + if (d < 0) { + d = -d; + s[0] = '-'; + } else + s[0] = '\0'; + + db_printf("%s%s%X", (d < 2048? "R'":""), s, d); + if (Dss(w)) db_printf("(%%sr%d,%%r%d)",Dss(w),Rsb(w)); else @@ -1738,14 +1750,20 @@ beDasm(i, ofs, w) OFS ofs; int w; { - register u_int d = Bdisp(w); + register int d = Bdisp(w); register const char *p; + char s[2]; + + s[1] = '\0'; + if (d < 0) { + d = -d; + s[0] = '-'; + } else + s[0] = '\0'; p = Nu(w)? ",n":""; - if (d < 2048) - db_printf("%s\tR'%X(%%sr%d,%%r%d)", p, d, Sr(w), Rsb(w)); - else - db_printf("%s\t%D(%%sr%d,%%r%d)", p, d, Sr(w), Rsb(w)); + db_printf("%s\tR'%s%X(%%sr%d,%%r%d)", p, (d < 2048? "R'":""), + s, d, Sr(w), Rsb(w)); return (1); } |