15801Srrh /* 2*19832Sdist * Copyright (c) 1982 Regents of the University of California. 3*19832Sdist * All rights reserved. The Berkeley software License Agreement 4*19832Sdist * specifies the terms and conditions for redistribution. 55801Srrh */ 6*19832Sdist 75801Srrh #ifndef lint 8*19832Sdist static char sccsid[] = "@(#)assizetab.c 5.1 (Berkeley) 04/30/85"; 95801Srrh #endif not lint 105801Srrh 115801Srrh #ifdef AS 125801Srrh #include <stdio.h> 135801Srrh #include "as.h" 145801Srrh #include "assyms.h" 155801Srrh 165801Srrh /* 175801Srrh * Convert loader reference types (plus PCREL) to bytes and lg bytes 185801Srrh */ 195801Srrh int reflen[] = { /* {LEN*+PCREL} ==> number of bytes */ 205801Srrh 0, 0, 215801Srrh 1, 1, /* LEN1, LEN1 + PCREL */ 225801Srrh 2, 2, /* LEN2, LEN2 + PCREL */ 235801Srrh 4, 4, /* LEN4, LEN2 + PCREL */ 245801Srrh 8, 8, /* LEN8, LEN2 + PCREL */ 255801Srrh 16, 16 /* LEN16, LEN16 + PCREL */ 265801Srrh }; 275801Srrh int lgreflen[] = { /* {LEN*+PCREL} ==> number of bytes */ 285801Srrh -1, -1, 295801Srrh 0, 0, /* LEN1, LEN1 + PCREL */ 305801Srrh 1, 1, /* LEN2, LEN2 + PCREL */ 315801Srrh 2, 2, /* LEN4, LEN2 + PCREL */ 325801Srrh 3, 3, /* LEN8, LEN2 + PCREL */ 335801Srrh 4, 4 /* LEN16, LEN16 + PCREL */ 345801Srrh }; 355801Srrh 365801Srrh /* 375801Srrh * Convert sizes to loader reference types and type flags 385801Srrh */ 395801Srrh /*0 1 2 3 4 5 6 7 8*/ 405801Srrh /* 415801Srrh * Convert {1,2,4,8} into {LEN1, LEN2, LEN4, LEN8} 425801Srrh */ 435801Srrh int len124[] = { 445801Srrh 0, LEN1, /* 0 */ 455801Srrh LEN2, 0, /* 2 */ 465801Srrh LEN4, 0, /* 4 */ 475801Srrh 0, 0, /* 6 */ 485801Srrh LEN8, 0, /* 8 */ 495801Srrh 0, 0, /* 10 */ 505801Srrh 0, 0, /* 12 */ 515801Srrh 0, 0, /* 14 */ 525801Srrh LEN16, 0 /* 16 */ 535801Srrh }; 545801Srrh /* 555801Srrh * Convert {1,2,4,8} into {bits to construct operands} 565801Srrh */ 575801Srrh char mod124[] = { 585801Srrh 0, 0x00, /* 0 */ 595801Srrh 0x20, 0, /* 2 */ 605801Srrh 0x40, 0, /* 4 */ 615801Srrh 0, 0, /* 6 */ 625801Srrh 0, 0, /* 8 */ 635801Srrh 0, 0, /* 10 */ 645801Srrh 0, 0, /* 12 */ 655801Srrh 0, 0, /* 14 */ 665801Srrh 0, 0 /* 16 */ 675801Srrh }; 685801Srrh /* 695801Srrh * {1,2,4,8} into {TYPB, TYPW, TYPL, TYPQ} 705801Srrh */ 715801Srrh int type_124[] = { 725801Srrh 0, TYPB, /* 0 */ 735801Srrh TYPW, 0, /* 2 */ 745801Srrh TYPL, 0, /* 4 */ 755801Srrh 0, 0, /* 6 */ 765801Srrh TYPQ, 0, /* 8 */ 775801Srrh 0, 0, /* 10 */ 785801Srrh 0, 0, /* 12 */ 795801Srrh 0, 0, /* 14 */ 805801Srrh TYPO, 0 /* 16 */ 815801Srrh }; 825801Srrh #endif AS 835801Srrh /* 845801Srrh * Convert TYP[BWLQOFDGH] into {1 if relocation not OK} 855801Srrh */ 865801Srrh int ty_NORELOC[] = { 875801Srrh 0, /* TYPB */ 885801Srrh 0, /* TYPW */ 895801Srrh 0, /* TYPL */ 905801Srrh 1, /* TYPQ */ 915801Srrh 1, /* TYPO */ 925801Srrh 1, /* TYPF */ 935801Srrh 1, /* TYPD */ 945801Srrh 1, /* TYPG */ 955801Srrh 1, /* TYPH */ 965801Srrh 1 /* TYPNONE */ 975801Srrh }; 989123Srrh #ifndef ADB 995801Srrh /* 1005801Srrh * Convert TYP[BWLQOFDGH] into {1 if a floating point number} 1015801Srrh */ 1025801Srrh int ty_float[] = { 1035801Srrh 0, /* TYPB */ 1045801Srrh 0, /* TYPW */ 1055801Srrh 0, /* TYPL */ 1065801Srrh 0, /* TYPQ */ 1075801Srrh 0, /* TYPO */ 1085801Srrh 1, /* TYPF */ 1095801Srrh 1, /* TYPD */ 1105801Srrh 1, /* TYPG */ 1115801Srrh 1, /* TYPH */ 1125801Srrh 0 /* TYPNONE */ 1135801Srrh }; 1149123Srrh #endif 1155801Srrh #ifdef AS 1165801Srrh /* 1175801Srrh * Convert TYP[BWLQOFDGH] into {LEN1 ... LEN16} 1185801Srrh */ 1195801Srrh int ty_LEN[] = { 1205801Srrh LEN1, /* TYPB */ 1215801Srrh LEN2, /* TYPW */ 1225801Srrh LEN4, /* TYPL */ 1235801Srrh LEN8, /* TYPQ */ 1245801Srrh LEN16, /* TYPO */ 1255801Srrh LEN4, /* TYPF */ 1265801Srrh LEN8, /* TYPD */ 1275801Srrh LEN8, /* TYPG */ 1285801Srrh LEN16, /* TYPH */ 1295801Srrh 0 /* TYPNONE */ 1305801Srrh }; 1315801Srrh #endif AS 1325801Srrh /* 1335801Srrh * Convert TYP[BWLQOFDGH] into {1 ... 16} 1345801Srrh */ 1355801Srrh int ty_nbyte[] = { 1365801Srrh 1, /* TYPB */ 1375801Srrh 2, /* TYPW */ 1385801Srrh 4, /* TYPL */ 1395801Srrh 8, /* TYPQ */ 1405801Srrh 16, /* TYPO */ 1415801Srrh 4, /* TYPF */ 1425801Srrh 8, /* TYPD */ 1435801Srrh 8, /* TYPG */ 1445801Srrh 16, /* TYPH */ 1455801Srrh 0 /* TYPNONE */ 1465801Srrh }; 1479123Srrh #ifndef ADB 1485801Srrh /* 1495801Srrh * Convert TYP[BWLQOFDGH] into lg{1 ... 16} 1505801Srrh */ 1515801Srrh int ty_nlg[] = { 1525801Srrh 0, /* TYPB */ 1535801Srrh 1, /* TYPW */ 1545801Srrh 2, /* TYPL */ 1555801Srrh 3, /* TYPQ */ 1565801Srrh 4, /* TYPO */ 1575801Srrh 2, /* TYPF */ 1585801Srrh 3, /* TYPD */ 1595801Srrh 3, /* TYPG */ 1605801Srrh 4, /* TYPH */ 1615801Srrh -1 /* TYPNONE */ 1625801Srrh }; 1635801Srrh /* 1645801Srrh * Convert TYP[BWLQOFDGH] into strings 1655801Srrh */ 1665801Srrh char *ty_string[] = { 1675801Srrh "byte", /* TYPB */ 1685801Srrh "word", /* TYPW */ 1695801Srrh "long", /* TYPL */ 1705801Srrh "quad", /* TYPQ */ 1715801Srrh "octa", /* TYPO */ 1725801Srrh "f_float", /* TYPF */ 1735801Srrh "d_float", /* TYPD */ 1745801Srrh "g_float", /* TYPG */ 1755801Srrh "h_float", /* TYPH */ 1765801Srrh "unpackd", /* TYPUNPACKED */ 1775801Srrh "??snark??" /* TYPNONE */ 1785801Srrh }; 1799123Srrh #endif 180