3 Copyright (C) 1989-1995 Alan R. Baldwin
4 721 Berkeley St., Kent, Ohio 44240
6 This program is free software; you can redistribute it and/or modify it
7 under the terms of the GNU General Public License as published by the
8 Free Software Foundation; either version 3, or (at your option) any
11 This program is distributed in the hope that it will be useful,
12 but WITHOUT ANY WARRANTY; without even the implied warranty of
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 GNU General Public License for more details.
16 You should have received a copy of the GNU General Public License
17 along with this program. If not, see <http://www.gnu.org/licenses/>. */
21 * - outsym: show s_id as string rather than array [NCPS]
22 * - Added outr11 to support 8051's 11 bit destination address
33 * The module asout.c contains all the functions used to
34 * generate the .REL assembler output file.
37 * The assemblers' output object file is an ascii file containing
38 * the information needed by the linker to bind multiple object
39 * modules into a complete loadable memory image.
41 * The object module contains the following designators:
48 * H Most significant byte first
49 * L Least significant byte first
56 * R Relocation information
57 * P Paging information
62 * The first line of an object module contains the [XDQ][HL]
63 * format specifier (i.e. XH indicates a hexadecimal file with
64 * most significant byte first) for the following designators.
69 * H aa areas gg global symbols
71 * The header line specifies the number of areas(aa) and the
72 * number of global symbols(gg) defined or referenced in this ob-
73 * ject module segment.
80 * The module line specifies the module name from which this
81 * header segment was assembled. The module line will not appear
82 * if the .module directive was not used in the source program.
93 * The symbol line defines (Def) or references (Ref) the symbol
94 * 'string' with the value nnnn. The defined value is relative to
95 * the current area base address. References to constants and ex-
96 * ternal global symbols will always appear before the first area
97 * definition. References to external symbols will have a value of
103 * A label size ss flags ff
105 * The area line defines the area label, the size (ss) of the
106 * area in bytes, and the area flags (ff). The area flags specify
107 * the ABS, REL, CON, OVR, and PAG parameters:
109 * OVR/CON (0x04/0x00 i.e. bit position 2)
111 * ABS/REL (0x08/0x00 i.e. bit position 3)
113 * PAG (0x10 i.e. bit position 4)
118 * T xx xx nn nn nn nn nn ...
120 * The T line contains the assembled code output by the assem-
121 * bler with xx xx being the offset address from the current area
122 * base address and nn being the assembled instructions and data in
128 * R 0 0 nn nn n1 n2 xx xx ...
130 * The R line provides the relocation information to the linker.
131 * The nn nn value is the current area index, i.e. which area the
132 * current values were assembled. Relocation information is en-
133 * coded in groups of 4 bytes:
135 * 1. n1 is the relocation mode and object format
136 * 1. bit 0 word(0x00)/byte(0x01)
137 * 2. bit 1 relocatable area(0x00)/symbol(0x02)
138 * 3. bit 2 normal(0x00)/PC relative(0x04) relocation
139 * 4. bit 3 1-byte(0x00)/2-byte(0x08) object format for
141 * 5. bit 4 signed(0x00)/unsigned(0x10) byte data
142 * 6. bit 5 normal(0x00)/page '0'(0x20) reference
143 * 7. bit 6 normal(0x00)/page 'nnn'(0x40) reference
144 * 8. bit 7 normal(0x00)/MSB of value
146 * 2. n2 is a byte index into the corresponding (i.e. pre-
147 * ceeding) T line data (i.e. a pointer to the data to be
148 * updated by the relocation). The T line data may be
149 * 1-byte or 2-byte byte data format or 2-byte word
152 * 3. xx xx is the area/symbol index for the area/symbol be-
153 * ing referenced. the corresponding area/symbol is found
154 * in the header area/symbol lists.
157 * The groups of 4 bytes are repeated for each item requiring relo-
158 * cation in the preceeding T line.
163 * P 0 0 nn nn n1 n2 xx xx
165 * The P line provides the paging information to the linker as
166 * specified by a .setdp directive. The format of the relocation
167 * information is identical to that of the R line. The correspond-
168 * ing T line has the following information:
169 * T xx xx aa aa bb bb
171 * Where aa aa is the area reference number which specifies the
172 * selected page area and bb bb is the base address of the page.
173 * bb bb will require relocation processing if the 'n1 n2 xx xx' is
174 * specified in the P line. The linker will verify that the base
175 * address is on a 256 byte boundary and that the page length of an
176 * area defined with the PAG type is not larger than 256 bytes.
178 * The linker defaults any direct page references to the first
179 * area defined in the input REL file. All ASxxxx assemblers will
180 * specify the _CODE area first, making this the default page area.
183 * asout.c contains the following functions:
204 * The module asout.c contains the following local variables:
205 * int rel[] relocation data for code/data array
206 * int * relp pointer to rel array
207 * int txt[] assembled code/data array
208 * int * txtp pointer to txt array
217 char *txtp = { &txt[0] };
218 char *relp = { &rel[0] };
220 /*)Function VOID outab(b)
222 * int b assembler data word
224 * The function outab() processes a single word of
225 * assembled data in absolute format.
228 * int * txtp pointer to data word
231 * int oflag -o, generate relocatable output flag
232 * int pass assembler pass number
235 * VOID outchk() asout.c
236 * VOID out_lb() asout.c
239 * The current assembly address is incremented by 1.
255 /*)Function VOID outaw(w)
257 * int w assembler data word
259 * The function outaw() processes a single word of
260 * assembled data in absolute format.
263 * int * txtp pointer to data word
266 * int oflag -o, generate relocatable output flag
267 * int pass assembler pass number
270 * VOID outchk() asout.c
271 * VOID out_lw() asout.c
274 * The current assembly address is incremented by 2.
290 /*)Function VOID write_rmode(r)
292 * int r relocation mode
294 * write_rmode puts the passed relocation mode into the
295 * output relp buffer, escaping it if necessary.
298 * int * relp pointer to rel array
301 * VOID rerr() assubr.c
304 * relp is incremented appropriately.
309 /* We need to escape the relocation mode if it is greater
310 * than a byte, or if it happens to look like an escape.
311 * (I don't think that the latter case is legal, but
312 * better safe than sorry).
314 if ((r > 0xff) || ((r & R_ESCAPE_MASK) == R_ESCAPE_MASK))
316 /* Hack in up to an extra 4 bits of flags with escape. */
319 /* uh-oh.. we have more than 4 extra bits. */
321 "Internal error: relocation mode 0x%X too big.\n",
325 /* printf("escaping relocation mode\n"); */
326 *relp++ = R_ESCAPE_MASK | (r >> 8);
335 /*)Function VOID outrb(esp, r)
337 * expr * esp pointer to expr structure
338 * int r relocation mode
340 * The function outrb() processes a byte of generated code
341 * in either absolute or relocatable format dependent upon
342 * the data contained in the expr structure esp. If the
343 * .REL output is enabled then the appropriate information
344 * is loaded into the txt and rel buffers.
347 * int n symbol/area reference number
348 * int * relp pointer to rel array
349 * int * txtp pointer to txt array
352 * sym dot defined as sym[0]
353 * int oflag -o, generate relocatable output flag
354 * int pass assembler pass number
357 * VOID aerr() assubr.c
358 * VOID outchk() asout.c
359 * VOID out_lb() asout.c
360 * VOID out_rb() asout.c
361 * VOID out_tb() asout.c
364 * The current assembly address is incremented by 1.
368 outrb(struct expr *esp, int r)
373 if (esp->e_flag==0 && esp->e_base.e_ap==NULL) {
374 /* This is a constant; simply write the
375 * const byte to the T line and don't
376 * generate any relocation info.
378 out_lb(lobyte(esp->e_addr),0);
381 *txtp++ = lobyte(esp->e_addr);
384 /* We are generating a single byte of relocatable
387 * We generate a 24 bit address. The linker will
388 * select a single byte based on whether R_MSB or
393 r |= R_BYTE | R_BYT3 | esp->e_rlcf;
396 /* Probably should mark this differently in the
399 out_lb(byte3(esp->e_addr),r|R_RELOC|R_HIGH);
401 else if (r & R_MSB) {
402 out_lb(hibyte(esp->e_addr),r|R_RELOC|R_HIGH);
404 out_lb(lobyte(esp->e_addr),r|R_RELOC);
408 out_t24(esp->e_addr);
410 n = esp->e_base.e_sp->s_ref;
413 n = esp->e_base.e_ap->a_ref;
416 *relp++ = txtp - txt - 3;
425 /*)Function VOID outrw(esp, r)
427 * expr * esp pointer to expr structure
428 * int r relocation mode
430 * The function outrw() processes a word of generated code
431 * in either absolute or relocatable format dependent upon
432 * the data contained in the expr structure esp. If the
433 * .REL output is enabled then the appropriate information
434 * is loaded into the txt and rel buffers.
437 * int n symbol/area reference number
438 * int * relp pointer to rel array
439 * int * txtp pointer to txt array
442 * sym dot defined as sym[0]
443 * int oflag -o, generate relocatable output flag
444 * int pass assembler pass number
447 * VOID aerr() assubr.c
448 * VOID outchk() asout.c
449 * VOID out_lw() asout.c
450 * VOID out_rw() asout.c
451 * VOID out_tw() asout.c
454 * The current assembly address is incremented by 2.
458 outrw(struct expr *esp, int r)
464 if (esp->e_addr > 0xffff)
468 "large constant 0x%x truncated to 16 bits\n",
471 if (esp->e_flag==0 && esp->e_base.e_ap==NULL) {
472 out_lw(esp->e_addr,0);
478 r |= R_WORD | esp->e_rlcf;
482 out_lw(hibyte(esp->e_addr),r|R_RELOC);
484 out_lw(lobyte(esp->e_addr),r|R_RELOC);
487 out_lw(esp->e_addr,r|R_RELOC);
493 n = esp->e_base.e_sp->s_ref;
496 n = esp->e_base.e_ap->a_ref;
501 /* If this happens, the linker will
502 * attempt to process this 16 bit field
503 * as 24 bits. That would be bad.
506 "***Internal error: C24 out in "
511 *relp++ = txtp - txt - 2;
519 /*)Function VOID outr24(esp, r)
521 * expr * esp pointer to expr structure
522 * int r relocation mode
524 * The function outr24() processes 24 bits of generated code
525 * in either absolute or relocatable format dependent upon
526 * the data contained in the expr structure esp. If the
527 * .REL output is enabled then the appropriate information
528 * is loaded into the txt and rel buffers.
531 * int n symbol/area reference number
532 * int * relp pointer to rel array
533 * int * txtp pointer to txt array
536 * sym dot defined as sym[0]
537 * int oflag -o, generate relocatable output flag
538 * int pass assembler pass number
541 * VOID aerr() assubr.c
542 * VOID outchk() asout.c
543 * VOID out_l24() asout.c
544 * VOID out_rw() asout.c
545 * VOID out_t24() asout.c
548 * The current assembly address is incremented by 3.
552 outr24(struct expr *esp, int r)
557 if (esp->e_flag==0 && esp->e_base.e_ap==NULL) {
558 /* This is a constant expression. */
559 out_l24(esp->e_addr,0);
562 out_t24(esp->e_addr);
565 /* This is a symbol. */
566 r |= R_WORD | esp->e_rlcf;
568 /* I have no idea what this case is. */
571 out_lw(hibyte(esp->e_addr),r|R_RELOC);
573 out_lw(lobyte(esp->e_addr),r|R_RELOC);
576 out_l24(esp->e_addr,r|R_RELOC);
580 out_t24(esp->e_addr);
582 n = esp->e_base.e_sp->s_ref;
585 n = esp->e_base.e_ap->a_ref;
590 /* If this occurs, we cannot properly
591 * code the relocation data with the
592 * R_C24 flag. This means the linker
593 * will fail to do the 24 bit relocation.
597 "***Internal error: BYTE out in 24 "
598 "bit flat mode unexpected.\n");
602 write_rmode(r | R_C24);
603 *relp++ = txtp - txt - 3;
611 /*)Function VOID outdp(carea, esp)
613 * area * carea pointer to current area strcuture
614 * expr * esp pointer to expr structure
616 * The function outdp() flushes the output buffer and
617 * outputs paging information to the .REL file.
620 * int n symbol/area reference number
621 * int r relocation mode
622 * int * relp pointer to rel array
623 * int * txtp pointer to txt array
626 * int oflag -o, generate relocatable output flag
627 * int pass assembler pass number
630 * VOID outbuf() asout.c
631 * VOID outchk() asout.c
632 * VOID out_rw() asout.c
633 * VOID out_tw() asout.c
636 * Output buffer flushed to .REL fiel.
637 * Paging information dumped to .REL file.
641 outdp(register struct area *carea, register struct expr *esp)
645 if (oflag && pass==2) {
647 out_tw(carea->a_ref);
649 if (esp->e_flag || esp->e_base.e_ap!=NULL) {
652 n = esp->e_base.e_sp->s_ref;
655 n = esp->e_base.e_ap->a_ref;
658 *relp++ = txtp - txt - 2;
665 /*)Function VOID outall()
667 * The function outall() will output any bufferred assembled
668 * data and relocation information (during pass 2 if the .REL
669 * output has been enabled).
675 * int oflag -o, generate relocatable output flag
676 * int pass assembler pass number
679 * VOID outbuf() asout.c
682 * assembled data and relocation buffers will be cleared.
688 if (oflag && pass==2)
692 /*)Function VOID outdot()
694 * The function outdot() outputs information about the
695 * current program counter value (during pass 2 if the .REL
696 * output has been enabled).
702 * int oflag -o, generate relocatable output flag
703 * int pass assembler pass number
706 * int fprintf() c_library
710 * assembled data and relocation buffers will be cleared.
716 if (oflag && pass==2) {
718 out(txt,(int) (txtp-txt));
721 out(rel,(int) (relp-rel));
728 /*)Function outchk(nt, nr)
730 * int nr number of additional relocation words
731 * int nt number of additional data words
733 * The function outchk() checks the data and relocation buffers
734 * for space to insert the nt data words and nr relocation words.
735 * If space is not available then output the current data and
736 * initialize the data buffers to receive the new data.
739 * area * ap pointer to an area structure
740 * int * relp pointer to rel array
741 * int * txtp pointer to txt array
744 * sym dot defined as sym[0]
747 * VOID outbuf() asout.c
750 * Data and relocation buffers may be emptied and initialized.
754 outchk(int nt, int nr)
756 register struct area *ap;
758 if (txtp+nt > &txt[NTXT] || relp+nr > &rel[NREL]) {
763 if ((ap = dot.s_area) != NULL) {
764 write_rmode(R_WORD|R_AREA);
771 /*)Function VOID outbuf()
773 * The function outbuf() will output any bufferred data
774 * and relocation information to the .REL file. The output
775 * buffer pointers and counters are initialized.
778 * int rel[] relocation data for code/data array
779 * int * relp pointer to rel array
780 * int txt[] assembled code/data array
781 * int * txtp pointer to txt array
784 * FILE * ofp relocation output file handle
790 * All bufferred data written to .REL file and
791 * buffer pointers and counters initialized.
797 if (txtp > &txt[2]) {
799 out(txt,(int) (txtp-txt));
801 fprintf(ofp, "%s", s);
802 out(rel,(int) (relp-rel));
809 /*)Function VOID outgsd()
811 * The function outgsd() performs the following:
812 * (1) outputs the .REL file radix
813 * (2) outputs the header specifying the number
814 * of areas and global symbols
815 * (3) outputs the module name
816 * (4) set the reference number and output a symbol line
817 * for all external global variables and absolutes
818 * (5) output an area name, set reference number and output
819 * a symbol line for all global relocatables in the area.
820 * Repeat this proceedure for all areas.
823 * area * ap pointer to an area structure
824 * sym * sp pointer to a sym structure
827 * int c string character value
828 * int narea number of code areas
829 * char * ptr string pointer
830 * int nglob number of global symbols
831 * int rn symbol reference number
834 * area * areap pointer to an area structure
835 * char module[] module name string
836 * sym * symhash[] array of pointers to NHASH
837 * linked symbol lists
838 * int xflag -x, listing radix flag
841 * int fprintf() c_library
842 * VOID outarea() asout.c
843 * VOID outsym() asout.c
844 * int putc() c_library
847 * All symbols are given reference numbers, all symbol
848 * and area information is output to the .REL file.
854 register struct area *ap;
855 register struct sym *sp;
858 int c, narea, nglob, rn;
863 narea = areap->a_ref + 1;
866 * Number of global references/absolutes
869 for (i = 0; i < NHASH; ++i) {
872 if (sp->s_flag&S_GBL)
879 * Output Radix and number of areas and symbols
882 fprintf(ofp, "X%c\n", hilo ? 'H' : 'L');
883 fprintf(ofp, "H %X areas %X global symbols\n", narea, nglob);
886 fprintf(ofp, "Q%c\n", hilo ? 'H' : 'L');
887 fprintf(ofp, "H %o areas %o global symbols\n", narea, nglob);
890 fprintf(ofp, "D%c\n", hilo ? 'H' : 'L');
891 fprintf(ofp, "H %u areas %u global symbols\n", narea, nglob);
900 while (ptr < &module[NCPS]) {
901 if ((c = *ptr++) != 0)
908 * Sdcc compile options
910 if (strlen(optsdcc)) fprintf(ofp, "O %s\n", optsdcc);
913 * Global references and absolutes.
916 for (i=0; i<NHASH; ++i) {
919 if (sp->s_area==NULL && sp->s_flag&S_GBL) {
928 * Global relocatables.
930 for (i=0; i<narea; ++i) {
932 while (ap->a_ref != i)
935 for (j=0; j<NHASH; ++j) {
938 if (sp->s_area==ap && sp->s_flag&S_GBL) {
948 /*)Function VOID outarea(ap)
950 * area * ap pointer to an area structure
952 * The function outarea() outputs the A line to the .REL
953 * file. The A line contains the area's name, size, and
957 * char * ptr pointer to area id string
958 * int c character value
961 * FILE * ofp relocation output file handle
962 * int xflag -x, listing radix flag
965 * int fprintf() c_library
966 * int putc() c_library
969 * The A line is sent to the .REL file.
973 outarea(register struct area *ap)
980 while (ptr < &ap->a_id[NCPS]) {
981 if ((c = *ptr++) != 0)
985 fprintf(ofp, " size %X flags %X addr %X\n", ap->a_size, ap->a_flag, ap->a_addr);
988 fprintf(ofp, " size %o flags %o\n", ap->a_size, ap->a_flag);
991 fprintf(ofp, " size %u flags %u\n", ap->a_size, ap->a_flag);
995 /*)Function VOID outsym(sp)
997 * sym * sp pointer to a sym structure
999 * The function outsym() outputs the S line to the .REL
1000 * file. The S line contains the symbols name and whether the
1001 * the symbol is defined or referenced.
1004 * char * ptr pointer to symbol id string
1005 * int c character value
1008 * FILE * ofp relocation output file handle
1009 * int xflag -x, listing radix flag
1012 * int fprintf() c_library
1013 * int putc() c_library
1016 * The S line is sent to the .REL file.
1020 outsym(register struct sym *sp)
1026 fprintf(ofp, "%s", ptr );
1027 fprintf(ofp, " %s", sp->s_type==S_NEW ? "Ref" : "Def");
1029 fprintf(ofp, "%04X\n", sp->s_addr);
1032 fprintf(ofp, "%06o\n", sp->s_addr);
1035 fprintf(ofp, "%05u\n", sp->s_addr);
1039 /*)Function VOID out(p, n)
1041 * int n number of words to output
1042 * int * p pointer to data words
1044 * The function out() outputs the data words to the .REL file
1045 * int the specified radix.
1051 * FILE * ofp relocation output file handle
1052 * int xflag -x, listing radix flag
1055 * int fprintf() c_library
1058 * Data is sent to the .REL file.
1066 fprintf(ofp, " %02X", (*p++)&0xff);
1069 fprintf(ofp, " %03o", (*p++)&0xff);
1072 fprintf(ofp, " %03u", (*p++)&0xff);
1077 /*)Function VOID out_lb(b, t)
1079 * int b assembled data
1080 * int t relocation type
1082 * The function out_lb() copies the assembled data and
1083 * its relocation type to the list data buffers.
1089 * int * cp pointer to assembler output array cb[]
1090 * int * cpt pointer to assembler relocation type
1091 * output array cbt[]
1097 * Pointers to data and relocation buffers incremented by 1.
1101 out_lb(register int b, register int t)
1103 if (cp < &cb[NCODE]) {
1109 /*)Function VOID out_lw(n, t)
1111 * int n assembled data
1112 * int t relocation type
1114 * The function out_lw() copies the assembled data and
1115 * its relocation type to the list data buffers.
1121 * int * cp pointer to assembler output array cb[]
1122 * int * cpt pointer to assembler relocation type
1123 * output array cbt[]
1129 * Pointers to data and relocation buffers incremented by 2.
1133 out_lw(register int n, register int t)
1136 out_lb(hibyte(n),t ? t|R_HIGH : 0);
1137 out_lb(lobyte(n),t);
1139 out_lb(lobyte(n),t);
1140 out_lb(hibyte(n),t ? t|R_HIGH : 0);
1144 /*)Function VOID out_l24(n, t)
1146 * int n assembled data
1147 * int t relocation type
1149 * The function out_l24() copies the assembled data and
1150 * its relocation type to the list data buffers.
1156 * int * cp pointer to assembler output array cb[]
1157 * int * cpt pointer to assembler relocation type
1158 * output array cbt[]
1164 * Pointers to data and relocation buffers incremented by 3.
1168 out_l24(int n, int t)
1171 out_lb(byte3(n),t ? t|R_HIGH : 0);
1172 out_lb(hibyte(n),t);
1173 out_lb(lobyte(n),t);
1175 out_lb(lobyte(n),t);
1176 out_lb(hibyte(n),t);
1177 out_lb(byte3(n),t ? t|R_HIGH : 0);
1181 /*)Function VOID out_rw(n)
1185 * The function out_rw() outputs the relocation (R)
1186 * data word as two bytes ordered according to hilo.
1189 * int * relp pointer to rel array
1195 * int lobyte() asout.c
1196 * int hibyte() asout.c
1199 * Pointer to relocation buffer incremented by 2.
1203 out_rw(register int n)
1206 *relp++ = hibyte(n);
1207 *relp++ = lobyte(n);
1209 *relp++ = lobyte(n);
1210 *relp++ = hibyte(n);
1214 /*)Function VOID out_tw(n)
1218 * The function out_tw() outputs the text (T)
1219 * data word as two bytes ordered according to hilo.
1222 * int * txtp pointer to txt array
1228 * int lobyte() asout.c
1229 * int hibyte() asout.c
1232 * Pointer to relocation buffer incremented by 2.
1236 out_tw(register int n)
1239 *txtp++ = hibyte(n);
1240 *txtp++ = lobyte(n);
1242 *txtp++ = lobyte(n);
1243 *txtp++ = hibyte(n);
1247 /*)Function VOID out_t24(n)
1251 * The function out_t24() outputs the text (T)
1252 * data word as three bytes ordered according to hilo.
1255 * int * txtp pointer to txt array
1261 * int lobyte() asout.c
1262 * int hibyte() asout.c
1265 * Pointer to relocation buffer incremented by 3.
1273 *txtp++ = hibyte(n);
1274 *txtp++ = lobyte(n);
1276 *txtp++ = lobyte(n);
1277 *txtp++ = hibyte(n);
1282 /*)Function int lobyte(n)
1286 * The function lobyte() returns the lower byte of
1308 /*)Function int hibyte(n)
1312 * The function hibyte() returns the higher byte of
1331 return ((n>>8)&0377);
1334 /*)Function int byte3(n)
1338 * The function byte3() returns the MSB of the
1356 return ((n >> 16) & 0xff);
1360 * JLH: Output relocatable 11 bit jump/call
1362 * This function is derived from outrw(), adding the parameter for the
1363 * 11 bit address. This form of address is used only on the 8051 and 8048.
1366 outr11(register struct expr *esp, int op, int r)
1371 if (esp->e_flag==0 && esp->e_base.e_ap==NULL) {
1372 /* Absolute destination.
1373 * Listing shows only the address.
1375 out_lw(esp->e_addr,0);
1378 out_tw(esp->e_addr);
1382 *relp++ = txtp - txt - 3;
1386 /* Relocatable destination. Build THREE
1387 * byte output: relocatable word, followed
1388 * by op-code. Linker will combine them.
1389 * Listing shows only the address.
1391 r |= R_WORD | esp->e_rlcf;
1392 out_lw(esp->e_addr,r|R_RELOC);
1395 out_tw(esp->e_addr);
1399 n = esp->e_base.e_sp->s_ref;
1402 n = esp->e_base.e_ap->a_ref;
1405 *relp++ = txtp - txt - 3;
1414 * Output relocatable 19 bit jump/call
1416 * This function is derived from outrw(), adding the parameter for the
1417 * 19 bit address. This form of address is used only in the DS80C390
1421 outr19(struct expr * esp, int op, int r)
1426 if (esp->e_flag==0 && esp->e_base.e_ap==NULL) {
1427 /* Absolute destination.
1428 * Listing shows only the address.
1430 out_lw(esp->e_addr,0);
1433 out_t24(esp->e_addr);
1437 *relp++ = txtp - txt - 4;
1441 /* Relocatable destination. Build FOUR
1442 * byte output: relocatable 24-bit entity, followed
1443 * by op-code. Linker will combine them.
1444 * Listing shows only the address.
1446 r |= R_WORD | esp->e_rlcf;
1447 out_l24(esp->e_addr,r|R_RELOC);
1450 out_t24(esp->e_addr);
1454 n = esp->e_base.e_sp->s_ref;
1457 n = esp->e_base.e_ap->a_ref;
1460 *relp++ = txtp - txt - 4;