rsc | 84114f0 | 2004-04-19 19:30:50 +0000 | [diff] [blame] | 1 | /* |
| 2 | * code to keep track of registers |
| 3 | */ |
| 4 | |
| 5 | #include "defs.h" |
| 6 | #include "fns.h" |
| 7 | |
| 8 | /* |
| 9 | * print the registers |
| 10 | */ |
| 11 | void |
| 12 | printregs(int c) |
| 13 | { |
| 14 | Regdesc *rp; |
| 15 | int i; |
| 16 | ulong u; |
| 17 | |
| 18 | if(correg == nil){ |
| 19 | dprint("registers not mapped\n"); |
| 20 | return; |
| 21 | } |
| 22 | |
| 23 | for (i = 1, rp = mach->reglist; rp->name; rp++, i++) { |
| 24 | if ((rp->flags & RFLT)) { |
| 25 | if (c != 'R') |
| 26 | continue; |
| 27 | if (rp->format == '8' || rp->format == '3') |
| 28 | continue; |
| 29 | } |
| 30 | rget(correg, rp->name, &u); |
| 31 | if(rp->format == 'Y') |
| 32 | dprint("%-8s %-20#llux", rp->name, (uvlong)u); |
| 33 | else |
| 34 | dprint("%-8s %-12#lux", rp->name, (ulong)u); |
| 35 | if ((i % 3) == 0) { |
| 36 | dprint("\n"); |
| 37 | i = 0; |
| 38 | } |
| 39 | } |
| 40 | if (i != 1) |
| 41 | dprint("\n"); |
| 42 | dprint ("%s\n", mach->exc(cormap, correg)); |
| 43 | printpc(); |
| 44 | } |