⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 out68k_q.c

📁 一款拥有一定历史的C语言编译器
💻 C
📖 第 1 页 / 共 2 页
字号:
}/* * generate a register mask for save. */static void put_smask P1 (REGMASK, mask){    put_mask (mask);}/* * generate a register mask for restore. */static void put_rmask P1 (REGMASK, mask){    put_mask (mask);}/* * generate a register name from a tempref number. */static void putreg P1 (REG, r){    switch (r) {    case D0:    case D1:    case D2:    case D3:    case D4:    case D5:    case D6:    case D7:	oprintf ("D%d", (int) r);	break;    case A0:    case A1:    case A2:    case A3:    case A4:    case A5:    case A6:    case A7:	oprintf ("A%d", (int) r - (int) A0);	break;    case FP0:    case FP1:    case FP2:    case FP3:    case FP4:    case FP5:    case FP6:    case FP7:	oprintf ("FP%d", (int) r - (int) FP0);	break;    default:	CANNOT_REACH_HERE ();    }}/* * generate a named label. */PRIVATE void put_name P1 (SYM *, sp){    put_reference (sp);    oprintf ("%s:%s", outlate (nameof (sp)), newline);}/* * output a compiler generated label. */PRIVATE void put_label P1 (LABEL, lab){    oprintf ("%s%u:%s", prefix, (unsigned) lab, newline);}static void put_header P2 (enum e_gt, gtype, SIZE, al){    static const char *directive[] = {	"DC.B\t",		/* bytegen */	"DC.W\t",		/* wordgen */	"DC.L\t",		/* longgen */	"DC.L\t",		/* longlonggen */	"DC.B\t\'",		/* stringgen */    };    if (gentype != gtype || outcol >= MAX_WIDTH) {	put_align (al);	gentype = gtype;	outcol = 15;	oprintf ("\t%s", directive[gtype]);    } else if (gentype != stringgen) {	oprintf (",");    }}PRIVATE void put_byte P1 (UVAL, val){    if (val >= (UVAL) 32 && val <= (UVAL) 126 && val != '\\'	&& val != (UVAL) '\'') {	put_header (stringgen, alignment_of_type (tp_char));	oprintf ("%c", (int) val);	outcol++;    } else {	put_header (bytegen, alignment_of_type (tp_char));	oprintf ("$%lX", (unsigned long) (val & OxffUL));	outcol += 4;    }}PRIVATE void put_word P1 (UVAL, val){    put_header (wordgen, alignment_of_type (tp_short));    oprintf ("$%lX", (unsigned long) (val & OxffffUL));    outcol += 6;}PRIVATE void put_dword P1 (UVAL, val){    put_header (longgen, alignment_of_type (tp_long));    oprintf ("$%lX", (unsigned long) val);    outcol += 10;}#ifndef FLOAT_BOOTSTRAP#ifdef FLOAT_IEEE/* * Generate IEEE single and double numbers */PRIVATE void put_float P1 (const RVAL *, vp){    unsigned long ul;    ieee_single (vp, &ul);    put_dword ((UVAL) ul);}PRIVATE void put_double P1 (const RVAL *, vp){    unsigned long ul[2];    ieee_double (vp, ul, TRUE);    put_dword ((UVAL) ul[0]);    put_dword ((UVAL) ul[1]);}PRIVATE void put_longdouble P1 (const RVAL *, vp){    unsigned long ul[3];    ieee_longdouble (vp, ul, TRUE);    put_dword ((UVAL) ul[0]);    put_dword ((UVAL) ul[1]);    put_dword ((UVAL) ul[2]);}#endif /* FLOAT_IEEE */#ifdef FLOAT_MFFP/* * Generate MOTOROLA FFP numbers */PRIVATE void put_float P1 (const RVAL *, vp){    put_dword (genffp (vp));}PRIVATE void put_double P1 (const RVAL *, vp){    put_dword (genffp (vp));}PRIVATE void put_longdouble P1 (const RVAL *, vp){    put_dword (genffp (vp));}#endif /* FLOAT_MFFP */#endif /* FLOAT_BOOTSTRAP */#ifndef RELOC_BUGPRIVATE void put_char P1 (const EXPR *, ep){    put_header (bytegen, alignment_of_type (tp_char));    putconst (ep, IL1);    outcol += 10;}PRIVATE void put_short P1 (const EXPR *, ep){    put_header (wordgen, alignment_of_type (tp_short));    putconst (ep, IL2);    outcol += 10;}#endif /* RELOC_BUG */PRIVATE void put_long P1 (const EXPR *, ep){    put_header (longgen, alignment_of_type (tp_long));    putconst (ep, IL4);    outcol += 10;}PRIVATE void put_longlong P1 (const EXPR *, ep){    put_header (longlonggen, alignment_of_type (tp_longlong));    putconst (ep, IL8);    oprintf (", ");    putconst (ep, IL4);    outcol += 10;}PRIVATE void put_pointer P1 (const EXPR *, ep){    put_header (longgen, alignment_of_type (tp_pointer));    putconst (ep, IL4);    outcol += 10;}PRIVATE void put_storage P1 (SYM *, sp){    SIZE    al = alignment_of_type (typeof (sp));    put_bseg (al);    if (is_static (sp)) {	put_label (sp->value.l);    } else {	put_name (sp);    }    oprintf ("\tDS.B\t%ld%s", typeof (sp)->size, newline);}/* * dump the string literal pool. * if we are producing single copies of strings (which should therefore * be read only we put them in the text segment - else in the data segment. */PRIVATE void put_literals P0 (void){    const CHAR *cp;    size_t  len;    if (lang_option == LANG_KANDR) {	put_dseg (alignment_of_type (tp_char));    } else {	put_kseg (alignment_of_type (tp_char));    }    for (; strtab != NIL_STRING; strtab = strtab->next) {	nl ();	put_label (strtab->label);	cp = strtab->str;	for (len = strtab->len; len--;)	    put_byte ((UVAL) *cp++);	put_byte ((UVAL) 0);    }    nl ();}PRIVATE void put_reference P1 (SYM *, sp){    if (!is_symbol_output (sp)) {	switch (storageof (sp)) {	case sc_global:	    nl ();	    oprintf ("\tXDEF %s%s", outlate (nameof (sp)), newline);	    break;	case sc_external:	    nl ();	    oprintf ("\tXREF %s%s", outlate (nameof (sp)), newline);	    break;	default:	    break;	}	symbol_output (sp);    }}/* align the following data */static void put_align P1 (SIZE, al){    nl ();    if (al > align_type) {	switch (al) {	case 2L:	    oprintf ("\tDS.W\t0%s", newline);	    break;	case 4L:	    oprintf ("\tDS.L\t0%s", newline);	    break;	default:	    break;	}    }    align_type = al;}/* * output any function epilogue code */PRIVATE void put_epilogue P2 (SYM *, sp, LABEL, label){    sp = sp;			/* keep the compiler quiet */    label = label;		/* keep the compiler quiet */}PRIVATE void nl P0 (void){    if (outcol > 0) {	if (gentype == stringgen) {	    oprintf ("\'");	}	oprintf ("%s", newline);	gentype = nogen;	outcol = 0;    }}static void seg P3 (enum e_sg, segtype, const char *, segname, SIZE, al){    nl ();    if (curseg != segtype) {	oprintf ("\tSECTION\t%s%s", segname, newline);	curseg = segtype;	align_type = 0L;    }    put_align (al);}PRIVATE void put_cseg P1 (SIZE, al){    seg (codeseg, "TEXT", al);}PRIVATE void put_dseg P1 (SIZE, al){    seg (dataseg, "DATA", al);}static void put_bseg P1 (SIZE, al){    seg (bssseg, "BSS", al);}PRIVATE void put_kseg P1 (SIZE, al){    if (IandD_option) {	put_dseg (al);    } else {	put_cseg (al);    }}PRIVATE void put_rseg P1 (SIZE, al){    put_cseg (al);}PRIVATE void put_finish P0 (void){}PRIVATE void put_start P0 (void){    oprintf ("%s Generated by %s %s %s (%s) from \"%s\"%s",	     comment, PROGNAME, VERSION, LAST_CHANGE_DATE, __DATE__, in_file,	     newline);#ifdef VERBOSE    {	time_t  time_of_day;	VOIDCAST time (&time_of_day);	oprintf ("%s Compilation date/time: %s%s",		 comment, ctime (&time_of_day), newline);    }#endif /* VERBOSE */    /* introduce the sections */    seg (codeseg, "TEXT", (SIZE) 0);    seg (romseg, "ROM", (SIZE) 0);    seg (dataseg, "DATA", (SIZE) 0);    seg (bssseg, "BSS", (SIZE) 0);}#ifdef MULTIPLE_ASSEMBLERSstruct funcs qmac68k_funcs = {    put_code,    put_name,    put_label,    put_byte,    put_word,    put_dword,#ifndef RELOC_BUG    put_char,    put_short,#endif				/* RELOC_BUG */    put_long,    put_longlong,    put_pointer,    put_storage,    put_literals,    put_finish,    put_start,    put_reference,    put_epilogue,    put_cseg,    put_dseg,    put_kseg,    put_rseg, #ifndef FLOAT_BOOTSTRAP#ifdef FLOAT_SUPPORT	put_float,    put_double,    put_longdouble,#endif	/* FLOAT_SUPPORT */#endif	/* FLOAT_BOOTSTRAP */    NULL};#endif /* MULTIPLE_ASSEMBLERS */#endif /* TARGET_QMAC */#endif /* MC680X0 */

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -