|
|
1.1 ! root 1: /* ! 2: * Header for object code improver ! 3: */ ! 4: ! 5: #include <stdio.h> ! 6: ! 7: #ifndef CHECK ! 8: #define CHECK(x) ! 9: #endif ! 10: ! 11: #define JBR 1 ! 12: #define CBR 2 ! 13: #define JMP 3 ! 14: #define LABEL 4 ! 15: #define DLABEL 5 ! 16: #define EROU 7 ! 17: #define JSW 9 ! 18: #define MOV 10 ! 19: #define CLR 11 ! 20: #define COM 12 ! 21: #define INC 13 ! 22: #define DEC 14 ! 23: #define NEG 15 ! 24: #define TST 16 ! 25: #define ASR 17 ! 26: #define ASL 18 ! 27: #define SXT 19 ! 28: #define CMP 20 ! 29: #define ADD 21 ! 30: #define SUB 22 ! 31: #define BIT 23 ! 32: #define BIC 24 ! 33: #define BIS 25 ! 34: #define MUL 26 ! 35: #define DIV 27 ! 36: #define ASH 28 ! 37: #define XOR 29 ! 38: #define TEXT 30 ! 39: #define DATA 31 ! 40: #define BSS 32 ! 41: #define EVEN 33 ! 42: #define MOVF 34 ! 43: #define MOVOF 35 ! 44: #define MOVFO 36 ! 45: #define ADDF 37 ! 46: #define SUBF 38 ! 47: #define DIVF 39 ! 48: #define MULF 40 ! 49: #define CLRF 41 ! 50: #define CMPF 42 ! 51: #define NEGF 43 ! 52: #define TSTF 44 ! 53: #define CFCC 45 ! 54: #define SOB 46 ! 55: #define JSR 47 ! 56: #define END 48 ! 57: ! 58: #define JEQ 0 ! 59: #define JNE 1 ! 60: #define JLE 2 ! 61: #define JGE 3 ! 62: #define JLT 4 ! 63: #define JGT 5 ! 64: #define JLO 6 ! 65: #define JHI 7 ! 66: #define JLOS 8 ! 67: #define JHIS 9 ! 68: ! 69: #define BYTE 100 ! 70: #define LSIZE 512 ! 71: ! 72: struct node { ! 73: char op; ! 74: char subop; ! 75: struct node *forw; ! 76: struct node *back; ! 77: struct node *ref; ! 78: int labno; ! 79: char *code; ! 80: int refc; ! 81: }; ! 82: ! 83: struct optab { ! 84: char *opstring; ! 85: int opcode; ! 86: } optab[]; ! 87: ! 88: char line[LSIZE]; ! 89: struct node first; ! 90: char *curlp; ! 91: int nbrbr; ! 92: int nsaddr; ! 93: int redunm; ! 94: int iaftbr; ! 95: int njp1; ! 96: int nrlab; ! 97: int nxjump; ! 98: int ncmot; ! 99: int nrevbr; ! 100: int loopiv; ! 101: int nredunj; ! 102: int nskip; ! 103: int ncomj; ! 104: int nsob; ! 105: int nrtst; ! 106: int nlit; ! 107: ! 108: int nchange; ! 109: int isn; ! 110: int debug; ! 111: int lastseg; ! 112: char *lasta; ! 113: char *lastr; ! 114: char *alasta; ! 115: char *alastr; ! 116: char *firstr; ! 117: char revbr[]; ! 118: char regs[12][20]; ! 119: char conloc[20]; ! 120: char conval[20]; ! 121: char ccloc[20]; ! 122: ! 123: #define RT1 10 ! 124: #define RT2 11 ! 125: #define FREG 5 ! 126: #define NREG 5 ! 127: #define LABHS 127 ! 128: #define OPHS 57 ! 129: ! 130: struct optab *ophash[OPHS]; ! 131: struct node *nonlab(); ! 132: char *copy(); ! 133: char *sbrk(); ! 134: char *findcon(); ! 135: struct node *insertl(); ! 136: struct node *codemove(); ! 137: char *sbrk(); ! 138: char *alloc();
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.