1 2 /* 3 4 5 cobol_fixup: proc(value_ptr); 6 7 dcl val (7) fixed bin aligned based(value_ptr); 8 9 This procedure is called by cobol_fix_driver_ once per compilation after code 10 generation to resolve all "fixup directives". It is called with 11 a pointer to the following structure: 12 13 cobol_fixup also contains the following entry points: 14 15 cobol_define_tag 16 cobol_define_tag_nc 17 cobol_equate_tag 18 cobol_make_tagref 19 cobol_make_fixup 20 21 22 23 24 When called at the primary entry, cobol_fixup serially processes 25 each element of the "fixup" table adding or subtracting the 26 value indicated by "type" and/or tag_number to the upper or 27 lower half of the word at "offset" words from the segment 28 indicated by "base". Thus, when return is made, all components 29 of the object segment are fully patched and ready to be joined 30 into one object segment. No further appending may be done to any 31 component. 32 33 34 35 36 cobol_define_tag: entry(tagno); 37 38 dcl tagno fixed bin; internal tag number (input) 39 dcl cobol_reset_r$in_line entry; 40 41 This entry causes a permanent association to be made 42 between a specified internal tag number (tagno) and the 43 current value of the "instruction counter" i.e. 44 the location of the next instruction to be emitted. 45 Any ongoing register optimization is ended at this 46 point. If this is not desired, see the entry 47 cobol_define_tag_nc. 48 49 50 cobol_define_tag_nc: entry(tagno,locno); 51 52 dcl tagno fixed bin; internal tag number (input) 53 dcl locno fixed bin; wd offset in cobol_text_seg (input) 54 55 This entry, given the location of an instruction (locno) 56 and an internal tag number (tagno), causes a permanent 57 association to be made between the two for fixup purposes. 58 59 60 cobol_equate_tag: entry(token31_ptr); 61 62 dcl token31_ptr ptr; ptr to a type 31 token (input) 63 64 This entry is called with a pointer to a Type 31 (tag equivalency) 65 token. It causes one internal tag number to be made equivalent 66 to another (for fixup purposes). It is not necessary that either 67 of the tags be previously defined. 68 69 The format of the Type 31 token is a follows: 70 71 72 token31.tagno1 will be given the value of token31.tagno2 when the 73 internal procedure eval_equate is called by cobol_fixup$cobol_fixup. 74 75 76 cobol_make_tagref: entry(tagno,locno,instr_ptr); 77 78 dcl tagno fixed bin; internal tag number (input) 79 dcl locno fixed bin; wd offset in cobol_text_seg (input) 80 dcl instr_ptr ptr; ptr to instr wd if non-null (input) 81 82 This entry is given the location of an instruction (locno) 83 (presumably a transfer) and an internal tag number (tagno). 84 If that tag has already been defined, then the address field 85 of that instruction is set to make the proper reference with 86 IC modification. Otherwise, a fixup directive is generated 87 which will cause the address field to be set (during the fixup 88 phase) to the address associated with the given internal tag 89 number. The full 18 bit address field is always set with any 90 previous contents overlaid. Also, the modifier field is always 91 set to indicate IC modification. Normally instr_ptr is null. 92 However, if it is not, the word which it is pointing to will be 93 set rather than the actual memory location (in cobol_text_seg). 94 However, the instruction offset given as locno is always used 95 in calculating the relative address and in the fixup directive 96 (if one is generated). Thus, the instruction at instr_ptr 97 must be eventually emmitted at cobol_text_seg|locno; if instr_ptr 98 is null, then the instruction must have already been emmitted 99 at cobol_text_seg|locno. 100 101 102 cobol_make_fixup: entry(fix_ptr); 103 104 dcl fix_ptr ptr; pointer to fixup directive (input) 105 106 */ 107