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