1: /*
2: * Header for object code improver
3: */
4:
5: #define JBR 1
6: #define CBR 2
7: #define JMP 3
8: #define LABEL 4
9: #define DLABEL 5
10: #define EROU 7
11: #define JSW 9
12: #define MOV 10
13: #define CLR 11
14: #define COM 12
15: #define INC 13
16: #define DEC 14
17: #define NEG 15
18: #define TST 16
19: #define ASR 17
20: #define ASL 18
21: #define SXT 19
22: #define CMP 20
23: #define ADD 21
24: #define SUB 22
25: #define BIT 23
26: #define BIC 24
27: #define BIS 25
28: #define MUL 26
29: #define DIV 27
30: #define ASH 28
31: #define XOR 29
32: #define TEXT 30
33: #define DATA 31
34: #define BSS 32
35: #define EVEN 33
36: #define MOVF 34
37: #define MOVOF 35
38: #define MOVFO 36
39: #define ADDF 37
40: #define SUBF 38
41: #define DIVF 39
42: #define MULF 40
43: #define CLRF 41
44: #define CMPF 42
45: #define NEGF 43
46: #define TSTF 44
47: #define CFCC 45
48: #define SOB 46
49: #define JSR 47
50: #define END 48
51:
52: #define JEQ 0
53: #define JNE 1
54: #define JLE 2
55: #define JGE 3
56: #define JLT 4
57: #define JGT 5
58: #define JLO 6
59: #define JHI 7
60: #define JLOS 8
61: #define JHIS 9
62:
63: #define BYTE 100
64:
65: struct node {
66: char op;
67: char subop;
68: struct node *forw;
69: struct node *back;
70: struct node *ref;
71: int labno;
72: char *code;
73: int refc;
74: };
75:
76: struct {
77: int combop;
78: };
79:
80: struct optab {
81: char *opstring;
82: int opcode;
83: } optab[];
84:
85: char line[512];
86: struct node first;
87: char *curlp;
88: int nbrbr;
89: int nsaddr;
90: int redunm;
91: int iaftbr;
92: int njp1;
93: int nrlab;
94: int nxjump;
95: int ncmot;
96: int nrevbr;
97: int loopiv;
98: int nredunj;
99: int nskip;
100: int ncomj;
101: int nsob;
102: int nrtst;
103: int nlit;
104:
105: int nchange;
106: int isn;
107: int debug;
108: char *lasta;
109: char *lastr;
110: char *firstr;
111: char revbr[];
112: char regs[12][20];
113: char conloc[20];
114: char conval[20];
115: char ccloc[20];
116:
117: #define RT1 10
118: #define RT2 11
119: #define FREG 5
120: #define NREG 5
121: #define LABHS 127
122: #define OPHS 57
123:
124: struct optab *ophash[OPHS];
125: struct { char lbyte; };
Defined variables
curlp
defined in line
87; used 7 times
first
defined in line
86; used 25 times
- in /usr/source/c/c20.c line
152,
158,
174,
185,
246,
420-430(3),
445,
456,
553,
643
- in /usr/source/c/c21.c line
15,
155-157(2),
179,
376-377(2),
455-458(2),
476-482(5)
isn
defined in line
106; used 1 times
line
defined in line
85; used 9 times
nbrbr
defined in line
88; used 2 times
nchange
defined in line
105; used 13 times
- in /usr/source/c/c20.c line
111-114(2),
455,
465,
480,
487,
501,
534,
588,
635,
668
- in /usr/source/c/c21.c line
117,
519
ncmot
defined in line
95; used 2 times
njp1
defined in line
92; used 2 times
nlit
defined in line
103; used 2 times
nrlab
defined in line
93; used 3 times
nskip
defined in line
99; used 2 times
nsob
defined in line
101; used 2 times
optab
defined in line
83; used 2 times
regs
defined in line
112; used 45 times
- in /usr/source/c/c21.c line
18-19(2),
34-35(2),
43-57(10),
76-79(4),
96-102(4),
111-112(2),
127-128(2),
271,
281,
304-311(4),
325-327(2),
339-343(2),
355,
399,
414-417(2),
423-428(3),
532-536(2)
Defined struct's
node
defined in line
65; used 78 times
- in line 68-70(6),
86(2)
- in /usr/source/c/c20.c line
149(2),
242(2),
302-306(4),
414-416(6),
453(2),
539-541(4),
567-570(6),
641(2),
651-653(4)
- in /usr/source/c/c21.c line
10(2),
149(2),
177(2),
201-204(4),
225(2),
236-238(4),
320(2),
332-335(4),
374(2),
406(2),
449-453(8),
496-498(4)
optab
defined in line
80; used 12 times
Defined macros
ADD
defined in line
23; used 1 times
ADDF
defined in line
39; used 1 times
ASH
defined in line
30; used 1 times
ASL
defined in line
20; used 1 times
ASR
defined in line
19; used 1 times
BIC
defined in line
26; used 1 times
BIS
defined in line
27; used 1 times
BIT
defined in line
25; used 1 times
BSS
defined in line
34; used 2 times
BYTE
defined in line
63; used 4 times
CBR
defined in line
6; used 19 times
CFCC
defined in line
47; used 1 times
CLR
defined in line
13; used 2 times
CLRF
defined in line
43; used 1 times
CMP
defined in line
22; used 2 times
CMPF
defined in line
44; used 1 times
COM
defined in line
14; used 1 times
DATA
defined in line
33; used 3 times
DEC
defined in line
16; used 2 times
DIV
defined in line
29; used 1 times
DIVF
defined in line
41; used 1 times
DLABEL
defined in line
9; used 1 times
END
defined in line
50; used 4 times
EROU
defined in line
10; used 3 times
EVEN
defined in line
35; used 1 times
FREG
defined in line
119;
never used
INC
defined in line
15; used 1 times
JBR
defined in line
5; used 14 times
JEQ
defined in line
52; used 2 times
JGE
defined in line
55; used 2 times
JGT
defined in line
57; used 2 times
JHI
defined in line
59; used 2 times
JHIS
defined in line
61; used 2 times
JLE
defined in line
54; used 2 times
JLO
defined in line
58; used 2 times
JLOS
defined in line
60; used 2 times
JLT
defined in line
56; used 2 times
JMP
defined in line
7; used 4 times
JNE
defined in line
53; used 3 times
JSR
defined in line
49; used 1 times
JSW
defined in line
11; used 4 times
LABEL
defined in line
8; used 17 times
- in /usr/source/c/c20.c line
160,
213,
421,
431,
446,
472,
485,
495,
523-524(2),
544-548(2),
554,
576,
602,
658
- in /usr/source/c/c21.c line
241
MOV
defined in line
12; used 2 times
MOVF
defined in line
36; used 1 times
MOVFO
defined in line
38; used 1 times
MOVOF
defined in line
37; used 1 times
MUL
defined in line
28; used 1 times
MULF
defined in line
42; used 1 times
NEG
defined in line
17; used 1 times
NEGF
defined in line
45; used 1 times
NREG
defined in line
120; used 13 times
OPHS
defined in line
122; used 5 times
RT1
defined in line
117; used 18 times
- in /usr/source/c/c21.c line
34,
43,
53-56(3),
76,
96-102(4),
111-112(2),
127,
325,
339,
417,
423,
514
RT2
defined in line
118; used 16 times
SOB
defined in line
48; used 2 times
SUB
defined in line
24; used 1 times
SUBF
defined in line
40; used 1 times
SXT
defined in line
21; used 1 times
TEXT
defined in line
32; used 3 times
TST
defined in line
18; used 2 times
TSTF
defined in line
46; used 1 times
XOR
defined in line
31; used 1 times
Usage of this include