1 /* ***********************************************************
  2    *                                                         *
  3    * Copyright, (C) Honeywell Information Systems Inc., 1982 *
  4    *                                                         *
  5    * Copyright (c) 1972 by Massachusetts Institute of        *
  6    * Technology and Honeywell Information Systems, Inc.      *
  7    *                                                         *
  8    *********************************************************** */
  9 
 10 
 11 show_ms:  proc;
 12 
 13 dcl       (i,n) fixed bin,
 14           p ptr unal,
 15           lword char(8),
 16           ioa_ entry options(variable);
 17 
 18 dcl       (abs,null) builtin;
 19 
 20 
 21 %include machine_state;
 22 
 23 show:     if m_s_p = null
 24           then do;
 25                call ioa_("Machine state pointer is null");
 26                return;
 27                end;
 28 
 29           call ioa_("MACHINE STATE ^p: indicators = ^d, next = ^p",m_s_p,indicators,next);
 30 
 31           if indicators = -2
 32           then do;
 33                call ioa_("^/INDICATOR REFERENCES:");
 34                call prt(indicators_ref(2));
 35                call prt(indicators_ref(3));
 36                end;
 37 
 38           if a_reg.number ^= 0
 39           then do;
 40                call ioa_("^/A REGISTER: # = ^d, size = ^d, length = ^d, offset = ^d, constant = ^d",
 41                 a_reg.number,a_reg.size,a_reg.length,a_reg.offset,a_reg.constant);
 42                call ioa_("changed by ^12w at ^o",a_reg.instruction,a_reg.changed);
 43 
 44                do i = 1 to a_reg.number;
 45                     call prt(a_reg.variable(i));
 46                     end;
 47 
 48                if a_reg.locked
 49                then do;
 50                     call ioa_("locked");
 51                     if a_reg.number_h_o ^= 0
 52                     then do;
 53                          call ioa_("has offset of ^d references",a_reg.number_h_o);
 54                          do i = 1 to a_reg.number_h_o;
 55                               call prt(a_reg.has_offset(i));
 56                               end;
 57                          end;
 58                     end;
 59 
 60                end;
 61 
 62           if q_reg.number ^= 0
 63           then do;
 64                call ioa_("^/Q REGISTER: # = ^d, size = ^d, length = ^d, offset = ^d, constant = ^d",
 65                 q_reg.number,q_reg.size,q_reg.length,q_reg.offset,q_reg.constant);
 66                call ioa_("changed by ^12w at ^o",q_reg.instruction,q_reg.changed);
 67 
 68                do i = 1 to q_reg.number;
 69                     call prt(q_reg.variable(i));
 70                     end;
 71 
 72                if q_reg.locked
 73                then do;
 74                     call ioa_("locked");
 75                     if q_reg.number_h_o ^= 0
 76                     then do;
 77                          call ioa_("has offset of ^d references",q_reg.number_h_o);
 78                          do i = 1 to q_reg.number_h_o;
 79                               call prt(q_reg.has_offset(i));
 80                               end;
 81                          end;
 82                     end;
 83 
 84                end;
 85 
 86           p = string_reg.variable;
 87           if p ^= null
 88           then do;
 89                call ioa_("^/STRING REGISTER: size = ^d, offset = ^d",string_reg.size,string_reg.offset);
 90                call prt(p);
 91                end;
 92 
 93           p = complex_reg.variable;
 94           if p ^= null
 95           then do;
 96                call ioa_("^/COMPLEX REGISTER: size = ^d, scale = ^d",complex_reg.size,complex_reg.scale);
 97                call prt(p);
 98                end;
 99 
100           p = decimal_reg.variable;
101           if p ^= null
102           then do;
103                call ioa_("^/DECIMAL REGISTER: size = ^d, scale = ^d",decimal_reg.size,decimal_reg.scale);
104                call prt(p);
105                end;
106 
107           do i = 0 to 7;
108                n = index_regs(i).type;
109                if n ^= 0
110                then do;
111                     call ioa_("^/INDEX REGISTER ^d: type = ^d, constant = ^o",i,
112                      n,index_regs(i).constant);
113                     call ioa_("used at ^o, changed by ^12w at ^o",index_regs(i).used,
114                      index_regs(i).instruction,index_regs(i).changed);
115                     if abs(n) >= 2 then call prt(index_regs(i).variable);
116                     end;
117                end;
118 
119           do i = 1 to 6;
120                n = base_regs(i).type;
121                if n ^= 0
122                then do;
123                     call ioa_("^/BASE REGISTER ^d: type = ^d, constant = ^o",i,
124                      n,base_regs(i).constant);
125                     call ioa_("used at ^o, changed by ^12w at ^o",base_regs(i).used,
126                      base_regs(i).instruction,base_regs(i).changed);
127                     p = base_regs(i).variable;
128                     if n < 3 then call prt(p);
129                     else if substr("110001101100"b,n,1)
130                          then call ioa_("variable is ^p",p);
131                     if base_regs(i).locked ^= 0
132                          then call ioa_("locked = ^d",base_regs(i).locked);
133                     end;
134 
135                end;
136 
137           call ioa_("^/END MACHINE STATE ^p^/",m_s_p);
138           return;
139 
140 show_ms$pt: entry(pt);
141 
142 dcl       pt ptr;
143 
144           m_s_p = pt;
145           goto show;
146 
147 prt:           proc(q);
148 
149 %include reference;
150 %include symbol;
151 %include token;
152 
153 dcl            (q,t) ptr unal;
154 
155                if q = null then return;
156 
157                t = q -> reference.symbol -> symbol.token;
158                if q -> reference.shared then call ioa_("variable ^p is ^a",q,t -> token.string);
159                else call ioa_("variable ^p is ^a, ref count = ^d",q,t -> token.string,q -> ref_count);
160 
161                end;
162 
163           end;