]> pd.if.org Git - mmurtl/blob - dasm/source/dasmdbg.c
autocommit for file dated 1995-01-30 22:58:12
[mmurtl] / dasm / source / dasmdbg.c
1 /* Used only for debugging the operand evaluator\r
2    This prints the OpType, OpMtype (hex byte), and\r
3    if it is a memory operand, it also prints the Base,\r
4    Indx, Disp, and size if they exist.\r
5    THIS IS NOT INCLUDED IN DELIVERABLE DASM.EXE\r
6 */\r
7 \r
8 void print_Oper(int op)\r
9 {\r
10 switch (rgOpType[op]) {\r
11         case r32:\r
12         fputs("r32= ", lst_fp);\r
13                 put_num(rgOpReg[op], lst_fp);\r
14         break;\r
15         case r16:\r
16         fputs("r16= ", lst_fp);\r
17                 put_num(rgOpReg[op], lst_fp);\r
18         break;\r
19         case r8:\r
20         fputs("r8= ", lst_fp);\r
21                 put_num(rgOpReg[op], lst_fp);\r
22         break;\r
23         case rCRG:\r
24         fputs("rCRG= ", lst_fp);\r
25                 put_num(rgOpReg[op], lst_fp);\r
26         break;\r
27         case rDRG:\r
28         fputs("rDRG= ", lst_fp);\r
29                 put_num(rgOpReg[op], lst_fp);\r
30         break;\r
31         case rTRG:\r
32         fputs("rTRG= ", lst_fp);\r
33                 put_num(rgOpReg[op], lst_fp);\r
34         break;\r
35         case rSEG:\r
36         fputs("rSEG= ", lst_fp);\r
37                 put_num(rgOpReg[op], lst_fp);\r
38         break;\r
39 \r
40         case mem:               /* memory operand */\r
41         fputs("MemOp- ", lst_fp);\r
42         if (OpMType & fBase) {          /* Base register */\r
43                 fputs(" Base-", lst_fp);\r
44                         put_num(rgOpBase[op], lst_fp);\r
45                         }\r
46         if (OpMType & fIndx) {          /* Index Register */\r
47                 fputs(" Indx-", lst_fp);\r
48                         put_num(rgOpIndx[op], lst_fp);\r
49                 if (OpMType & fScale2) {                /* scale value 2 */\r
50                         fputs(" Scale2 ", lst_fp);\r
51                                 }\r
52                 if (OpMType & fScale4) {                /* scale value 4 */\r
53                             fputs(" Scale4 ", lst_fp);\r
54                                 }\r
55                 if (OpMType & fScale8) {                /* scale value 8 */\r
56                              fputs(" Scale8 ", lst_fp);\r
57                                 }\r
58                         }\r
59         if (OpMType & fDisp8) {           /* Disp 8 value */\r
60                 fputs(" Disp8-", lst_fp);\r
61                         put_hex(rgOpDisp[op], 2, lst_fp);\r
62                         }\r
63         if (OpMType & fDisp32) {           /* Disp 32 value */\r
64                 fputs(" Disp32-", lst_fp);\r
65                         put_hex(rgOpDisp[op], 8, lst_fp);\r
66                         }\r
67                 break;\r
68         case val8:\r
69         fputs("Val8=", lst_fp);\r
70                 put_num(rgOpDisp[op], lst_fp);\r
71         break;\r
72         case val16:\r
73         fputs("Val16=", lst_fp);\r
74                 put_num(rgOpDisp[op], lst_fp);\r
75         break;\r
76         case val32:\r
77         fputs("Val32=", lst_fp);\r
78                 put_num(rgOpDisp[op], lst_fp);\r
79         break;\r
80         default:\r
81             fputs(" UNK Operand ", lst_fp);\r
82 }\r
83 }\r