122164Sdist /* 222164Sdist * Copyright (c) 1980 Regents of the University of California. 322164Sdist * All rights reserved. The Berkeley software License Agreement 422164Sdist * specifies the terms and conditions for redistribution. 522164Sdist */ 63192Smckusick 718347Smckusick #ifndef lint 8*30037Smckusick static char sccsid[] = "@(#)fend.c 5.2 (Berkeley) 11/12/86"; 922164Sdist #endif not lint 103192Smckusick 113192Smckusick #include "whoami.h" 123192Smckusick #include "0.h" 133192Smckusick #include "tree.h" 143192Smckusick #include "opcode.h" 153192Smckusick #include "objfmt.h" 163192Smckusick #include "align.h" 1711337Speter #include "tmps.h" 183192Smckusick 193192Smckusick /* 203192Smckusick * this array keeps the pxp counters associated with 213192Smckusick * functions and procedures, so that they can be output 223192Smckusick * when their bodies are encountered 233192Smckusick */ 243192Smckusick int bodycnts[ DSPLYSZ ]; 253192Smckusick 263192Smckusick #ifdef PC 273192Smckusick # include "pc.h" 2818457Sralph # include <pcc.h> 293192Smckusick #endif PC 303192Smckusick 313192Smckusick #ifdef OBJ 323192Smckusick int cntpatch; 333192Smckusick int nfppatch; 343192Smckusick #endif OBJ 353192Smckusick 3618347Smckusick #include "tree_ty.h" 3718347Smckusick 383192Smckusick struct nl *Fp; 393192Smckusick int pnumcnt; 403192Smckusick /* 413192Smckusick * Funcend is called to 423192Smckusick * finish a block by generating 433192Smckusick * the code for the statements. 443192Smckusick * It then looks for unresolved declarations 453192Smckusick * of labels, procedures and functions, 463192Smckusick * and cleans up the name list. 473192Smckusick * For the program, it checks the 483192Smckusick * semantics of the program 493192Smckusick * statement (yuchh). 503192Smckusick */ 513192Smckusick funcend(fp, bundle, endline) 523192Smckusick struct nl *fp; 5318347Smckusick struct tnode *bundle; 543192Smckusick int endline; 553192Smckusick { 563192Smckusick register struct nl *p; 573192Smckusick register int i, b; 5818347Smckusick int inp, out; 5918347Smckusick struct tnode *blk; 603192Smckusick bool chkref; 613192Smckusick struct nl *iop; 623192Smckusick char *cp; 633192Smckusick extern int cntstat; 643192Smckusick # ifdef PC 6510671Speter struct entry_exit_cookie eecookie; 663192Smckusick # endif PC 6718347Smckusick # ifndef PC 6818347Smckusick int var; 6918347Smckusick # endif PC 703192Smckusick 713192Smckusick cntstat = 0; 723192Smckusick /* 733192Smckusick * yyoutline(); 743192Smckusick */ 753192Smckusick if (program != NIL) 763192Smckusick line = program->value[3]; 7718347Smckusick blk = bundle->stmnt_blck.stmnt_list; 783192Smckusick if (fp == NIL) { 793192Smckusick cbn--; 803192Smckusick # ifdef PTREE 813192Smckusick nesting--; 823192Smckusick # endif PTREE 833192Smckusick return; 843192Smckusick } 853192Smckusick #ifdef OBJ 863192Smckusick /* 873192Smckusick * Patch the branch to the 883192Smckusick * entry point of the function 893192Smckusick */ 9018347Smckusick patch4((PTR_DCL) fp->value[NL_ENTLOC]); 913192Smckusick /* 923192Smckusick * Put out the block entrance code and the block name. 933192Smckusick * HDRSZE is the number of bytes of info in the static 943192Smckusick * BEG data area exclusive of the proc name. It is 953192Smckusick * currently defined as: 963192Smckusick /* struct hdr { 973192Smckusick /* long framesze; /* number of bytes of local vars */ 983192Smckusick /* long nargs; /* number of bytes of arguments */ 993192Smckusick /* bool tests; /* TRUE => perform runtime tests */ 1003192Smckusick /* short offset; /* offset of procedure in source file */ 1013192Smckusick /* char name[1]; /* name of active procedure */ 1023192Smckusick /* }; 1033192Smckusick */ 1043192Smckusick # define HDRSZE (2 * sizeof(long) + sizeof(short) + sizeof(bool)) 1053192Smckusick var = put(2, ((lenstr(fp->symbol,0) + HDRSZE) << 8) 1063192Smckusick | (cbn == 1 && opt('p') == 0 ? O_NODUMP: O_BEG), (long)0); 1073192Smckusick /* 1083192Smckusick * output the number of bytes of arguments 1093192Smckusick * this is only checked on formal calls. 1103192Smckusick */ 11118347Smckusick (void) put(2, O_CASE4, cbn == 1 ? (long)0 : (long)(fp->value[NL_OFFS]-DPOFF2)); 1123192Smckusick /* 1133192Smckusick * Output the runtime test mode for the routine 1143192Smckusick */ 11518347Smckusick (void) put(2, sizeof(bool) == 2 ? O_CASE2 : O_CASE4, opt('t') ? TRUE : FALSE); 1163192Smckusick /* 1173192Smckusick * Output line number and routine name 1183192Smckusick */ 11918347Smckusick (void) put(2, O_CASE2, bundle->stmnt_blck.line_no); 1203192Smckusick putstr(fp->symbol, 0); 1213192Smckusick #endif OBJ 1223192Smckusick #ifdef PC 1233192Smckusick /* 1243192Smckusick * put out the procedure entry code 1253192Smckusick */ 12610671Speter eecookie.nlp = fp; 1273192Smckusick if ( fp -> class == PROG ) { 1289129Smckusick /* 1299129Smckusick * If there is a label declaration in the main routine 1309129Smckusick * then there may be a non-local goto to it that does 1319129Smckusick * not appear in this module. We have to assume that 1329129Smckusick * such a reference may occur and generate code to 1339129Smckusick * prepare for it. 1349129Smckusick */ 1359129Smckusick if ( parts[ cbn ] & LPRT ) { 1369129Smckusick parts[ cbn ] |= ( NONLOCALVAR | NONLOCALGOTO ); 1379129Smckusick } 13810671Speter codeformain(); 1397917Smckusick ftnno = fp -> value[NL_ENTLOC]; 14010671Speter prog_prologue(&eecookie); 14118347Smckusick stabline(bundle->stmnt_blck.line_no); 14218347Smckusick stabfunc(fp, "program", bundle->stmnt_blck.line_no , (long) 0 ); 1433192Smckusick } else { 1447917Smckusick ftnno = fp -> value[NL_ENTLOC]; 14510671Speter fp_prologue(&eecookie); 14618347Smckusick stabline(bundle->stmnt_blck.line_no); 14718347Smckusick stabfunc(fp, fp->symbol, bundle->stmnt_blck.line_no, 14818347Smckusick (long)(cbn - 1)); 1493192Smckusick for ( p = fp -> chain ; p != NIL ; p = p -> chain ) { 15018347Smckusick stabparam( p , p -> value[ NL_OFFS ] , (int) lwidth(p->type)); 1513192Smckusick } 1523192Smckusick if ( fp -> class == FUNC ) { 1533192Smckusick /* 1543192Smckusick * stab the function variable 1553192Smckusick */ 1563192Smckusick p = fp -> ptr[ NL_FVAR ]; 15718347Smckusick stablvar( p , p -> value[ NL_OFFS ] , (int) lwidth( p -> type)); 1583192Smckusick } 1593192Smckusick /* 1603192Smckusick * stab local variables 1613192Smckusick * rummage down hash chain links. 1623192Smckusick */ 1633192Smckusick for ( i = 0 ; i <= 077 ; i++ ) { 1643192Smckusick for ( p = disptab[ i ] ; p != NIL ; p = p->nl_next) { 1653192Smckusick if ( ( p -> nl_block & 037 ) != cbn ) { 1663192Smckusick break; 1673192Smckusick } 1683192Smckusick /* 16918346Smckusick * stab locals (not parameters) 1703192Smckusick */ 17118347Smckusick if ( p -> symbol != NIL ) { 17218347Smckusick if ( p -> class == VAR && p -> value[ NL_OFFS ] < 0 ) { 17318347Smckusick stablvar( p , p -> value[ NL_OFFS ] , 17418347Smckusick (int) lwidth( p -> type ) ); 17518347Smckusick } else if ( p -> class == CONST ) { 17618347Smckusick stabconst( p ); 17718346Smckusick } 1783192Smckusick } 1793192Smckusick } 1803192Smckusick } 1813192Smckusick } 1823192Smckusick stablbrac( cbn ); 1833192Smckusick /* 1843192Smckusick * ask second pass to allocate known locals 1853192Smckusick */ 18611337Speter putlbracket(ftnno, &sizes[cbn]); 18710671Speter fp_entrycode(&eecookie); 1883192Smckusick #endif PC 1893192Smckusick if ( monflg ) { 1903192Smckusick if ( fp -> value[ NL_CNTR ] != 0 ) { 1913192Smckusick inccnt( fp -> value [ NL_CNTR ] ); 1923192Smckusick } 1933192Smckusick inccnt( bodycnts[ fp -> nl_block & 037 ] ); 1943192Smckusick } 1953192Smckusick if (fp->class == PROG) { 1963192Smckusick /* 1973192Smckusick * The glorious buffers option. 1983192Smckusick * 0 = don't buffer output 1993192Smckusick * 1 = line buffer output 2003192Smckusick * 2 = 512 byte buffer output 2013192Smckusick */ 2023192Smckusick # ifdef OBJ 2033192Smckusick if (opt('b') != 1) 20418347Smckusick (void) put(1, O_BUFF | opt('b') << 8); 2053192Smckusick # endif OBJ 2063192Smckusick # ifdef PC 2073192Smckusick if ( opt( 'b' ) != 1 ) { 20818457Sralph putleaf( PCC_ICON , 0 , 0 20918457Sralph , PCCM_ADDTYPE( PCCTM_FTN | PCCT_INT , PCCTM_PTR ) , "_BUFF" ); 21018457Sralph putleaf( PCC_ICON , opt( 'b' ) , 0 , PCCT_INT , (char *) 0 ); 21118457Sralph putop( PCC_CALL , PCCT_INT ); 2123192Smckusick putdot( filename , line ); 2133192Smckusick } 2143192Smckusick # endif PC 2157953Speter inp = 0; 2163192Smckusick out = 0; 2173192Smckusick for (p = fp->chain; p != NIL; p = p->chain) { 21818347Smckusick if (pstrcmp(p->symbol, input->symbol) == 0) { 2193192Smckusick inp++; 2203192Smckusick continue; 2213192Smckusick } 22218347Smckusick if (pstrcmp(p->symbol, output->symbol) == 0) { 2233192Smckusick out++; 2243192Smckusick continue; 2253192Smckusick } 2263192Smckusick iop = lookup1(p->symbol); 2273192Smckusick if (iop == NIL || bn != cbn) { 2283192Smckusick error("File %s listed in program statement but not declared", p->symbol); 2293192Smckusick continue; 2303192Smckusick } 2313192Smckusick if (iop->class != VAR) { 2323192Smckusick error("File %s listed in program statement but declared as a %s", p->symbol, classes[iop->class]); 2333192Smckusick continue; 2343192Smckusick } 2353192Smckusick if (iop->type == NIL) 2363192Smckusick continue; 2373192Smckusick if (iop->type->class != FILET) { 2383192Smckusick error("File %s listed in program statement but defined as %s", 2393192Smckusick p->symbol, nameof(iop->type)); 2403192Smckusick continue; 2413192Smckusick } 2423192Smckusick # ifdef OBJ 24318347Smckusick (void) put(2, O_CON24, text(iop->type) ? 0 : width(iop->type->type)); 2443192Smckusick i = lenstr(p->symbol,0); 24518347Smckusick (void) put(2, O_CON24, i); 24618347Smckusick (void) put(2, O_LVCON, i); 2473192Smckusick putstr(p->symbol, 0); 24818347Smckusick (void) put(2, O_LV | bn<<8+INDX, (int)iop->value[NL_OFFS]); 24918347Smckusick (void) put(1, O_DEFNAME); 2503192Smckusick # endif OBJ 2513192Smckusick # ifdef PC 25218457Sralph putleaf( PCC_ICON , 0 , 0 25318457Sralph , PCCM_ADDTYPE( PCCTM_FTN | PCCT_INT , PCCTM_PTR ) 2543192Smckusick , "_DEFNAME" ); 2553837Speter putLV( p -> symbol , bn , iop -> value[NL_OFFS] , 2563837Speter iop -> extra_flags , p2type( iop ) ); 2573192Smckusick putCONG( p -> symbol , strlen( p -> symbol ) 2583192Smckusick , LREQ ); 25918457Sralph putop( PCC_CM , PCCT_INT ); 26018457Sralph putleaf( PCC_ICON , strlen( p -> symbol ) 26118457Sralph , 0 , PCCT_INT , (char *) 0 ); 26218457Sralph putop( PCC_CM , PCCT_INT ); 26318457Sralph putleaf( PCC_ICON 2643192Smckusick , text(iop->type) ? 0 : width(iop->type->type) 26518457Sralph , 0 , PCCT_INT , (char *) 0 ); 26618457Sralph putop( PCC_CM , PCCT_INT ); 26718457Sralph putop( PCC_CALL , PCCT_INT ); 2683192Smckusick putdot( filename , line ); 2693192Smckusick # endif PC 2703192Smckusick } 2713192Smckusick } 2723192Smckusick /* 2733192Smckusick * Process the prog/proc/func body 2743192Smckusick */ 27518347Smckusick noreach = FALSE; 27618347Smckusick line = bundle->stmnt_blck.line_no; 2773192Smckusick statlist(blk); 2783192Smckusick # ifdef PTREE 2793192Smckusick { 2803192Smckusick pPointer Body = tCopy( blk ); 2813192Smckusick 2823192Smckusick pDEF( PorFHeader[ nesting -- ] ).PorFBody = Body; 2833192Smckusick } 2843192Smckusick # endif PTREE 2853192Smckusick # ifdef OBJ 28618347Smckusick if (cbn== 1 && monflg != FALSE) { 28718347Smckusick patchfil((PTR_DCL) (cntpatch - 2), (long)cnts, 2); 28818347Smckusick patchfil((PTR_DCL) (nfppatch - 2), (long)pfcnt, 2); 2893192Smckusick } 2903192Smckusick # endif OBJ 2913192Smckusick # ifdef PC 2923192Smckusick if ( fp -> class == PROG && monflg ) { 29318457Sralph putleaf( PCC_ICON , 0 , 0 , PCCM_ADDTYPE( PCCTM_FTN | PCCT_INT , PCCTM_PTR ) 2943192Smckusick , "_PMFLUSH" ); 29518457Sralph putleaf( PCC_ICON , cnts , 0 , PCCT_INT , (char *) 0 ); 29618457Sralph putleaf( PCC_ICON , pfcnt , 0 , PCCT_INT , (char *) 0 ); 29718457Sralph putop( PCC_CM , PCCT_INT ); 29818457Sralph putLV( PCPCOUNT , 0 , 0 , NGLOBAL , PCCT_INT ); 29918457Sralph putop( PCC_CM , PCCT_INT ); 30018457Sralph putop( PCC_CALL , PCCT_INT ); 3013192Smckusick putdot( filename , line ); 3023192Smckusick } 3033192Smckusick # endif PC 3047953Speter /* 3057953Speter * Clean up the symbol table displays and check for unresolves 3067953Speter */ 3077953Speter line = endline; 3083192Smckusick if (fp->class == PROG && inp == 0 && (input->nl_flags & (NUSED|NMOD)) != 0) { 3093192Smckusick recovered(); 3103192Smckusick error("Input is used but not defined in the program statement"); 3113192Smckusick } 3127953Speter if (fp->class == PROG && out == 0 && (output->nl_flags & (NUSED|NMOD)) != 0) { 3137953Speter recovered(); 3147953Speter error("Output is used but not defined in the program statement"); 3157953Speter } 3163192Smckusick b = cbn; 3173192Smckusick Fp = fp; 31818347Smckusick chkref = (syneflg == errcnt[cbn] && opt('w') == 0)?TRUE:FALSE; 3193192Smckusick for (i = 0; i <= 077; i++) { 3203192Smckusick for (p = disptab[i]; p != NIL && (p->nl_block & 037) == b; p = p->nl_next) { 3213192Smckusick /* 3223192Smckusick * Check for variables defined 3233192Smckusick * but not referenced 3243192Smckusick */ 3253192Smckusick if (chkref && p->symbol != NIL) 3263192Smckusick switch (p->class) { 3273192Smckusick case FIELD: 3283192Smckusick /* 3293192Smckusick * If the corresponding record is 3303192Smckusick * unused, we shouldn't complain about 3313192Smckusick * the fields. 3323192Smckusick */ 3333192Smckusick default: 3343192Smckusick if ((p->nl_flags & (NUSED|NMOD)) == 0) { 3353192Smckusick warning(); 3363192Smckusick nerror("%s %s is neither used nor set", classes[p->class], p->symbol); 3373192Smckusick break; 3383192Smckusick } 3393192Smckusick /* 3403192Smckusick * If a var parameter is either 3413192Smckusick * modified or used that is enough. 3423192Smckusick */ 3433192Smckusick if (p->class == REF) 3443192Smckusick continue; 3453192Smckusick # ifdef OBJ 3463192Smckusick if ((p->nl_flags & NUSED) == 0) { 3473192Smckusick warning(); 3483192Smckusick nerror("%s %s is never used", classes[p->class], p->symbol); 3493192Smckusick break; 3503192Smckusick } 3513192Smckusick # endif OBJ 3523192Smckusick # ifdef PC 3533837Speter if (((p->nl_flags & NUSED) == 0) && ((p->extra_flags & NEXTERN) == 0)) { 3543192Smckusick warning(); 3553192Smckusick nerror("%s %s is never used", classes[p->class], p->symbol); 3563192Smckusick break; 3573192Smckusick } 3583192Smckusick # endif PC 3593192Smckusick if ((p->nl_flags & NMOD) == 0) { 3603192Smckusick warning(); 3613192Smckusick nerror("%s %s is used but never set", classes[p->class], p->symbol); 3623192Smckusick break; 3633192Smckusick } 3643192Smckusick case LABEL: 3653192Smckusick case FVAR: 3663192Smckusick case BADUSE: 3673192Smckusick break; 3683192Smckusick } 3693192Smckusick switch (p->class) { 3703192Smckusick case BADUSE: 3713192Smckusick cp = "s"; 37218347Smckusick /* This used to say ud_next 37318347Smckusick that is not a member of nl so 37418347Smckusick i changed it to nl_next, 37518347Smckusick which may be wrong */ 37618347Smckusick if (p->chain->nl_next == NIL) 3773192Smckusick cp++; 3783192Smckusick eholdnl(); 3793192Smckusick if (p->value[NL_KINDS] & ISUNDEF) 3803192Smckusick nerror("%s undefined on line%s", p->symbol, cp); 3813192Smckusick else 3823192Smckusick nerror("%s improperly used on line%s", p->symbol, cp); 3833192Smckusick pnumcnt = 10; 38418347Smckusick pnums((struct udinfo *) p->chain); 3853192Smckusick pchr('\n'); 3863192Smckusick break; 3873192Smckusick 3883192Smckusick case FUNC: 3893192Smckusick case PROC: 3903192Smckusick # ifdef OBJ 3913192Smckusick if ((p->nl_flags & NFORWD)) 3923192Smckusick nerror("Unresolved forward declaration of %s %s", classes[p->class], p->symbol); 3933192Smckusick # endif OBJ 3943192Smckusick # ifdef PC 3953837Speter if ((p->nl_flags & NFORWD) && ((p->extra_flags & NEXTERN) == 0)) 3963192Smckusick nerror("Unresolved forward declaration of %s %s", classes[p->class], p->symbol); 3973192Smckusick # endif PC 3983192Smckusick break; 3993192Smckusick 4003192Smckusick case LABEL: 4013192Smckusick if (p->nl_flags & NFORWD) 4023192Smckusick nerror("label %s was declared but not defined", p->symbol); 4033192Smckusick break; 4043192Smckusick case FVAR: 4053192Smckusick if ((p->nl_flags & NMOD) == 0) 4063192Smckusick nerror("No assignment to the function variable"); 4073192Smckusick break; 4083192Smckusick } 4093192Smckusick } 4103192Smckusick /* 4113192Smckusick * Pop this symbol 4123192Smckusick * table slot 4133192Smckusick */ 4143192Smckusick disptab[i] = p; 4153192Smckusick } 4163192Smckusick 4173192Smckusick # ifdef OBJ 41818347Smckusick (void) put(1, O_END); 4193192Smckusick # endif OBJ 4203192Smckusick # ifdef PC 42110671Speter fp_exitcode(&eecookie); 42210671Speter stabrbrac(cbn); 42310671Speter putrbracket(ftnno); 42410671Speter fp_epilogue(&eecookie); 42510671Speter if (fp -> class != PROG) { 42610671Speter fp_formalentry(&eecookie); 4273192Smckusick } 4283192Smckusick /* 4293192Smckusick * declare pcp counters, if any 4303192Smckusick */ 4313192Smckusick if ( monflg && fp -> class == PROG ) { 4323192Smckusick putprintf( " .data" , 0 ); 43318457Sralph aligndot(PCCT_INT); 4343192Smckusick putprintf( " .comm " , 1 ); 4353192Smckusick putprintf( PCPCOUNT , 1 ); 4363192Smckusick putprintf( ",%d" , 0 , ( cnts + 1 ) * sizeof (long) ); 4373192Smckusick putprintf( " .text" , 0 ); 4383192Smckusick } 4393192Smckusick # endif PC 4403192Smckusick #ifdef DEBUG 44118347Smckusick dumpnl(fp->ptr[2], (int) fp->symbol); 4423192Smckusick #endif 4435654Slinton 4445654Slinton #ifdef OBJ 4453192Smckusick /* 4465654Slinton * save the namelist for the debugger pdx 4475654Slinton */ 4485654Slinton 44918347Smckusick savenl(fp->ptr[2], (int) fp->symbol); 4505654Slinton #endif 4515654Slinton 4525654Slinton /* 4533192Smckusick * Restore the 4543192Smckusick * (virtual) name list 4553192Smckusick * position 4563192Smckusick */ 4573192Smckusick nlfree(fp->ptr[2]); 4583192Smckusick /* 4593192Smckusick * Proc/func has been 4603192Smckusick * resolved 4613192Smckusick */ 4623192Smckusick fp->nl_flags &= ~NFORWD; 4633192Smckusick /* 4643192Smckusick * Patch the beg 4653192Smckusick * of the proc/func to 4663192Smckusick * the proper variable size 4673192Smckusick */ 4683192Smckusick if (Fp == NIL) 4693192Smckusick elineon(); 4703192Smckusick # ifdef OBJ 471*30037Smckusick patchfil((PTR_DCL) var, 472*30037Smckusick roundup(-sizes[cbn].om_max, (long) A_STACK), 2); 4733192Smckusick # endif OBJ 4743192Smckusick cbn--; 4753192Smckusick if (inpflist(fp->symbol)) { 4763192Smckusick opop('l'); 4773192Smckusick } 4783192Smckusick } 4793363Speter 4803363Speter #ifdef PC 4813363Speter /* 4823363Speter * construct the long name of a function based on it's static nesting. 4833363Speter * into a caller-supplied buffer (that should be about BUFSIZ big). 4843363Speter */ 4853363Speter sextname( buffer , name , level ) 4863363Speter char buffer[]; 4873363Speter char *name; 4883363Speter int level; 4893363Speter { 4903363Speter char *starthere; 4913363Speter int i; 4923363Speter 4933363Speter starthere = &buffer[0]; 4943363Speter for ( i = 1 ; i < level ; i++ ) { 4953363Speter sprintf( starthere , EXTFORMAT , enclosing[ i ] ); 4963363Speter starthere += strlen( enclosing[ i ] ) + 1; 4973363Speter } 4983367Speter sprintf( starthere , EXTFORMAT , name ); 4993367Speter starthere += strlen( name ) + 1; 5003363Speter if ( starthere >= &buffer[ BUFSIZ ] ) { 5013363Speter panic( "sextname" ); 5023363Speter } 5033363Speter } 50410671Speter 50510671Speter /* 50610671Speter * code for main() 50710671Speter */ 50810671Speter #ifdef vax 50910671Speter 51010671Speter codeformain() 51110671Speter { 51210671Speter putprintf(" .text" , 0 ); 51310671Speter putprintf(" .align 1" , 0 ); 51410671Speter putprintf(" .globl _main" , 0 ); 51510671Speter putprintf("_main:" , 0 ); 51610671Speter putprintf(" .word 0" , 0 ); 51710671Speter if ( opt ( 't' ) ) { 51810671Speter putprintf(" pushl $1" , 0 ); 51910671Speter } else { 52010671Speter putprintf(" pushl $0" , 0 ); 52110671Speter } 52210671Speter putprintf(" calls $1,_PCSTART" , 0 ); 52310671Speter putprintf(" movl 4(ap),__argc" , 0 ); 52410671Speter putprintf(" movl 8(ap),__argv" , 0 ); 52510671Speter putprintf(" calls $0,_program" , 0 ); 52610671Speter putprintf(" pushl $0" , 0 ); 52710671Speter putprintf(" calls $1,_PCEXIT" , 0 ); 52810671Speter } 52910671Speter 53010671Speter /* 53110671Speter * prologue for the program. 53210671Speter * different because it 53310671Speter * doesn't have formal entry point 53410671Speter */ 53510671Speter prog_prologue(eecookiep) 53610671Speter struct entry_exit_cookie *eecookiep; 53710671Speter { 53810671Speter putprintf(" .text" , 0 ); 53910671Speter putprintf(" .align 1" , 0 ); 54010671Speter putprintf(" .globl _program" , 0 ); 54110671Speter putprintf("_program:" , 0 ); 54210716Speter /* 54310716Speter * register save mask 54410716Speter */ 54518347Smckusick eecookiep -> savlabel = (int) getlab(); 54618347Smckusick putprintf(" .word %s%d", 0, (int) SAVE_MASK_LABEL , eecookiep -> savlabel ); 54710671Speter } 54810671Speter 54910671Speter fp_prologue(eecookiep) 55010671Speter struct entry_exit_cookie *eecookiep; 55110671Speter { 55210671Speter 55310671Speter sextname( eecookiep -> extname, eecookiep -> nlp -> symbol , cbn - 1 ); 55410671Speter putprintf( " .text" , 0 ); 55510671Speter putprintf( " .align 1" , 0 ); 55618347Smckusick putprintf( " .globl %s%s", 0, (int) FORMALPREFIX, (int) eecookiep -> extname ); 55718347Smckusick putprintf( " .globl %s" , 0 , (int) eecookiep -> extname ); 55818347Smckusick putprintf( "%s:" , 0 , (int) eecookiep -> extname ); 55910671Speter /* 56010671Speter * register save mask 56110671Speter */ 56218347Smckusick eecookiep -> savlabel = (int) getlab(); 56318347Smckusick putprintf(" .word %s%d", 0, (int) SAVE_MASK_LABEL , eecookiep -> savlabel ); 56410671Speter } 56510671Speter 56610671Speter /* 56710671Speter * code before any user code. 56810671Speter * or code that is machine dependent. 56910671Speter */ 57010671Speter fp_entrycode(eecookiep) 57110671Speter struct entry_exit_cookie *eecookiep; 57210671Speter { 57310714Speter int ftnno = eecookiep -> nlp -> value[NL_ENTLOC]; 57418347Smckusick int proflabel = (int) getlab(); 57518347Smckusick int setjmp0 = (int) getlab(); 57610671Speter 57710671Speter /* 57810671Speter * top of code; destination of jump from formal entry code. 57910671Speter */ 58018347Smckusick eecookiep -> toplabel = (int) getlab(); 58118347Smckusick (void) putlab( (char *) eecookiep -> toplabel ); 58218347Smckusick putprintf(" subl2 $%s%d,sp" , 0 , (int) FRAME_SIZE_LABEL, ftnno ); 58310671Speter if ( profflag ) { 58410671Speter /* 58510671Speter * call mcount for profiling 58610671Speter */ 58710671Speter putprintf( " moval " , 1 ); 58818347Smckusick putprintf( PREFIXFORMAT , 1 , (int) LABELPREFIX , proflabel ); 58910671Speter putprintf( ",r0" , 0 ); 59010671Speter putprintf( " jsb mcount" , 0 ); 59110671Speter putprintf( " .data" , 0 ); 59210671Speter putprintf( " .align 2" , 0 ); 59318347Smckusick (void) putlab( (char *) proflabel ); 59410671Speter putprintf( " .long 0" , 0 ); 59510671Speter putprintf( " .text" , 0 ); 59610671Speter } 59710671Speter /* 59810671Speter * if there are nested procedures that access our variables 59910671Speter * we must save the display. 60010671Speter */ 60110671Speter if ( parts[ cbn ] & NONLOCALVAR ) { 60210671Speter /* 60310671Speter * save old display 60410671Speter */ 60510671Speter putprintf( " movq %s+%d,%d(%s)" , 0 60618347Smckusick , (int) DISPLAYNAME , cbn * sizeof(struct dispsave) 60718347Smckusick , DSAVEOFFSET , (int) P2FPNAME ); 60810671Speter /* 60910671Speter * set up new display by saving AP and FP in appropriate 61010671Speter * slot in display structure. 61110671Speter */ 61210671Speter putprintf( " movq %s,%s+%d" , 0 61318347Smckusick , (int) P2APNAME , (int) DISPLAYNAME , cbn * sizeof(struct dispsave) ); 61410671Speter } 61510671Speter /* 61610671Speter * set underflow checking if runtime tests 61710671Speter */ 61810671Speter if ( opt( 't' ) ) { 61910671Speter putprintf( " bispsw $0xe0" , 0 ); 62010671Speter } 62110671Speter /* 62210671Speter * zero local variables if checking is on 62310671Speter * by calling blkclr( bytes of locals , starting local address ); 62410671Speter */ 62510671Speter if ( opt( 't' ) && ( -sizes[ cbn ].om_max ) > DPOFF1 ) { 62618457Sralph putleaf( PCC_ICON , 0 , 0 , PCCM_ADDTYPE( PCCTM_FTN | PCCT_INT , PCCTM_PTR ) 62710671Speter , "_blkclr" ); 62818457Sralph putLV((char *) 0 , cbn , (int) sizes[ cbn ].om_max , NLOCAL , PCCT_CHAR ); 62918457Sralph putleaf( PCC_ICON , (int) (( -sizes[ cbn ].om_max ) - DPOFF1) 63018457Sralph , 0 , PCCT_INT ,(char *) 0 ); 63118457Sralph putop( PCC_CM , PCCT_INT ); 63218457Sralph putop( PCC_CALL , PCCT_INT ); 63310671Speter putdot( filename , line ); 63410671Speter } 63510671Speter /* 63610671Speter * set up goto vector if non-local goto to this frame 63710671Speter */ 63810671Speter if ( parts[ cbn ] & NONLOCALGOTO ) { 63918457Sralph putleaf( PCC_ICON , 0 , 0 , PCCM_ADDTYPE( PCCTM_FTN | PCCT_INT , PCCTM_PTR ) 64010671Speter , "_setjmp" ); 64118457Sralph putLV( (char *) 0 , cbn , GOTOENVOFFSET , NLOCAL , PCCTM_PTR|PCCT_STRTY ); 64218457Sralph putop( PCC_CALL , PCCT_INT ); 64318457Sralph putleaf( PCC_ICON , 0 , 0 , PCCT_INT , (char *) 0 ); 64418457Sralph putop( PCC_NE , PCCT_INT ); 64518457Sralph putleaf( PCC_ICON , setjmp0 , 0 , PCCT_INT , (char *) 0 ); 64618457Sralph putop( PCC_CBRANCH , PCCT_INT ); 64710671Speter putdot( filename , line ); 64810671Speter /* 64910671Speter * on non-local goto, setjmp returns with address to 65010671Speter * be branched to. 65110671Speter */ 65210671Speter putprintf( " jmp (r0)" , 0 ); 65318347Smckusick (void) putlab((char *) setjmp0); 65410671Speter } 65510671Speter } 65610671Speter 65710671Speter fp_exitcode(eecookiep) 65810671Speter struct entry_exit_cookie *eecookiep; 65910671Speter { 66010671Speter /* 66110671Speter * if there were file variables declared at this level 66210671Speter * call PCLOSE( ap ) to clean them up. 66310671Speter */ 66410671Speter if ( dfiles[ cbn ] ) { 66518457Sralph putleaf( PCC_ICON , 0 , 0 , PCCM_ADDTYPE( PCCTM_FTN | PCCT_INT , PCCTM_PTR ) 66610671Speter , "_PCLOSE" ); 66718457Sralph putleaf( PCC_REG , 0 , P2AP , PCCM_ADDTYPE( PCCT_CHAR , PCCTM_PTR ) , (char *) 0 ); 66818457Sralph putop( PCC_CALL , PCCT_INT ); 66910671Speter putdot( filename , line ); 67010671Speter } 67110671Speter /* 67210671Speter * if this is a function, 67310671Speter * the function variable is the return value. 67410671Speter * if it's a scalar valued function, return scalar, 67510671Speter * else, return a pointer to the structure value. 67610671Speter */ 67710671Speter if ( eecookiep-> nlp -> class == FUNC ) { 67810671Speter struct nl *fvar = eecookiep-> nlp -> ptr[ NL_FVAR ]; 67910671Speter long fvartype = p2type( fvar -> type ); 68010671Speter long label; 68110671Speter char labelname[ BUFSIZ ]; 68210671Speter 68310671Speter switch ( classify( fvar -> type ) ) { 68410671Speter case TBOOL: 68510671Speter case TCHAR: 68610671Speter case TINT: 68710671Speter case TSCAL: 68810671Speter case TDOUBLE: 68910671Speter case TPTR: 69010671Speter putRV( fvar -> symbol , ( fvar -> nl_block ) & 037 , 69110671Speter fvar -> value[ NL_OFFS ] , 69210671Speter fvar -> extra_flags , 69318347Smckusick (int) fvartype ); 69418457Sralph putop( PCC_FORCE , (int) fvartype ); 69510671Speter break; 69610671Speter default: 69718347Smckusick label = (int) getlab(); 69810671Speter sprintf( labelname , PREFIXFORMAT , LABELPREFIX , label ); 69910671Speter putprintf( " .data" , 0 ); 70010671Speter aligndot(A_STRUCT); 70110671Speter putprintf( " .lcomm %s,%d" , 0 , 70218347Smckusick (int) labelname , (int) lwidth( fvar -> type ) ); 70310671Speter putprintf( " .text" , 0 ); 70418457Sralph putleaf( PCC_NAME , 0 , 0 , (int) fvartype , labelname ); 70510671Speter putLV( fvar -> symbol , ( fvar -> nl_block ) & 037 , 70610671Speter fvar -> value[ NL_OFFS ] , 70710671Speter fvar -> extra_flags , 70818347Smckusick (int) fvartype ); 70918457Sralph putstrop( PCC_STASG , (int) PCCM_ADDTYPE(fvartype, PCCTM_PTR) , 71018347Smckusick (int) lwidth( fvar -> type ) , 71110671Speter align( fvar -> type ) ); 71210671Speter putdot( filename , line ); 71318457Sralph putleaf( PCC_ICON , 0 , 0 , (int) PCCM_ADDTYPE(fvartype, PCCTM_PTR), labelname ); 71418457Sralph putop( PCC_FORCE , (int) PCCM_ADDTYPE(fvartype, PCCTM_PTR) ); 71510671Speter break; 71610671Speter } 71710671Speter putdot( filename , line ); 71810671Speter } 71910671Speter /* 72010671Speter * if there are nested procedures we must save the display. 72110671Speter */ 72210671Speter if ( parts[ cbn ] & NONLOCALVAR ) { 72310671Speter /* 72410671Speter * restore old display entry from save area 72510671Speter */ 72610671Speter putprintf( " movq %d(%s),%s+%d" , 0 72718347Smckusick , DSAVEOFFSET , (int) P2FPNAME 72818347Smckusick , (int) DISPLAYNAME , cbn * sizeof(struct dispsave) ); 72910671Speter } 73010671Speter } 73110671Speter 73210671Speter fp_epilogue(eecookiep) 73310671Speter struct entry_exit_cookie *eecookiep; 73410671Speter { 73518346Smckusick stabline(line); 73610671Speter putprintf(" ret" , 0 ); 73710671Speter /* 73810671Speter * set the register save mask. 73910671Speter */ 74010671Speter putprintf(" .set %s%d,0x%x", 0, 74118347Smckusick (int) SAVE_MASK_LABEL, eecookiep -> savlabel, savmask()); 74210671Speter } 74310671Speter 74410671Speter fp_formalentry(eecookiep) 74510671Speter struct entry_exit_cookie *eecookiep; 74610671Speter { 74710671Speter 74811857Speter putprintf(" .align 1", 0); 74918347Smckusick putprintf("%s%s:" , 0 , (int) FORMALPREFIX , (int) eecookiep -> extname ); 75018347Smckusick putprintf(" .word %s%d", 0, (int) SAVE_MASK_LABEL, eecookiep -> savlabel ); 75118457Sralph putleaf( PCC_ICON , 0 , 0 , PCCM_ADDTYPE( PCCTM_FTN | PCCT_INT , PCCTM_PTR ) , "_FCALL" ); 75218347Smckusick putRV((char *) 0 , cbn , 75310671Speter eecookiep -> nlp -> value[ NL_OFFS ] + sizeof( struct formalrtn * ) , 75418457Sralph NPARAM , PCCTM_PTR | PCCT_STRTY ); 75518457Sralph putRV((char *) 0, cbn, eecookiep -> nlp -> value[NL_OFFS], NPARAM, PCCTM_PTR|PCCT_STRTY); 75618457Sralph putop( PCC_CM , PCCT_INT ); 75718457Sralph putop( PCC_CALL , PCCT_INT ); 75810671Speter putdot( filename , line ); 75918347Smckusick putjbr( (long) eecookiep -> toplabel ); 76010671Speter } 76110671Speter #endif vax 76210671Speter 76310671Speter #ifdef mc68000 76410671Speter 76510671Speter codeformain() 76610671Speter { 76710671Speter putprintf(" .text", 0); 76810671Speter putprintf(" .globl _main", 0); 76910671Speter putprintf("_main:", 0); 77010671Speter putprintf(" link %s,#0", 0, P2FPNAME); 77110671Speter if (opt('t')) { 77210671Speter putprintf(" pea 1", 0); 77310671Speter } else { 77410671Speter putprintf(" pea 0", 0); 77510671Speter } 77610671Speter putprintf(" jbsr _PCSTART", 0); 77710671Speter putprintf(" addql #4,sp", 0); 77810671Speter putprintf(" movl %s@(8),__argc", 0, P2FPNAME); 77910671Speter putprintf(" movl %s@(12),__argv", 0, P2FPNAME); 78010671Speter putprintf(" jbsr _program", 0); 78110671Speter putprintf(" pea 0", 0); 78210671Speter putprintf(" jbsr _PCEXIT", 0); 78310671Speter } 78410671Speter 78510671Speter prog_prologue(eecookiep) 78610671Speter struct entry_exit_cookie *eecookiep; 78710671Speter { 78810671Speter int ftnno = eecookiep -> nlp -> value[NL_ENTLOC]; 78910671Speter 79010671Speter putprintf(" .text", 0); 79110671Speter putprintf(" .globl _program", 0); 79210671Speter putprintf("_program:", 0); 79310671Speter putprintf(" link %s,#0", 0, P2FPNAME); 79410671Speter putprintf(" addl #-%s%d,sp", 0, FRAME_SIZE_LABEL, ftnno); 79510671Speter /* touch new end of stack, to break more stack space */ 79610671Speter putprintf(" tstb sp@(-%s%d)", 0, PAGE_BREAK_LABEL, ftnno); 79710671Speter putprintf(" moveml #%s%d,sp@", 0, SAVE_MASK_LABEL, ftnno); 79810671Speter } 79910671Speter 80010671Speter fp_prologue(eecookiep) 80110671Speter struct entry_exit_cookie *eecookiep; 80210671Speter { 80310671Speter int ftnno = eecookiep -> nlp -> value[NL_ENTLOC]; 80410671Speter 80510671Speter sextname(eecookiep -> extname, eecookiep -> nlp -> symbol, cbn - 1); 80610671Speter putprintf(" .text", 0); 80710671Speter putprintf(" .globl %s%s", 0, FORMALPREFIX, eecookiep -> extname); 80810671Speter putprintf(" .globl %s", 0, eecookiep -> extname); 80910671Speter putprintf("%s:", 0, eecookiep -> extname); 81010671Speter putprintf(" link %s,#0", 0, P2FPNAME); 81110671Speter putprintf(" addl #-%s%d,sp", 0, FRAME_SIZE_LABEL, ftnno); 81210671Speter /* touch new end of stack, to break more stack space */ 81310671Speter putprintf(" tstb sp@(-%s%d)", 0, PAGE_BREAK_LABEL, ftnno); 81410671Speter putprintf(" moveml #%s%d,sp@", 0, SAVE_MASK_LABEL, ftnno); 81510671Speter } 81610671Speter 81710671Speter fp_entrycode(eecookiep) 81810671Speter struct entry_exit_cookie *eecookiep; 81910671Speter { 82018347Smckusick char *proflabel = getlab(); 82118347Smckusick char *setjmp0 = getlab(); 82210671Speter 82310671Speter /* 82410671Speter * fill in the label cookie 82510671Speter */ 82610671Speter eecookiep -> toplabel = getlab(); 82718347Smckusick (void) putlab(eecookiep -> toplabel); 82810671Speter /* 82910671Speter * call mcount if we are profiling. 83010671Speter */ 83110671Speter if ( profflag ) { 83210671Speter putprintf(" movl #%s%d,a0", 0, LABELPREFIX, proflabel); 83310671Speter putprintf(" jsr mcount", 0); 83410671Speter putprintf(" .data", 0); 83510671Speter putprintf(" .even", 0); 83618347Smckusick (void) putlab(proflabel); 83710671Speter putprintf(" .long 0", 0); 83810671Speter putprintf(" .text", 0); 83910671Speter } 84010671Speter /* 84110671Speter * if there are nested procedures that access our variables 84210671Speter * we must save the display 84310671Speter */ 84410671Speter if (parts[cbn] & NONLOCALVAR) { 84510671Speter /* 84610671Speter * save the old display 84710671Speter */ 84810671Speter putprintf(" movl %s+%d,%s@(%d)", 0, 84910671Speter DISPLAYNAME, cbn * sizeof(struct dispsave), 85010671Speter P2FPNAME, DSAVEOFFSET); 85110671Speter /* 85210671Speter * set up the new display by saving the framepointer 85310671Speter * in the display structure. 85410671Speter */ 85510671Speter putprintf(" movl %s,%s+%d", 0, 85610671Speter P2FPNAME, DISPLAYNAME, cbn * sizeof(struct dispsave)); 85710671Speter } 85810671Speter /* 85910671Speter * zero local variables if checking is on 86010671Speter * by calling blkclr( bytes of locals , starting local address ); 86110671Speter */ 86210671Speter if ( opt( 't' ) && ( -sizes[ cbn ].om_max ) > DPOFF1 ) { 86318457Sralph putleaf( PCC_ICON , 0 , 0 , PCCM_ADDTYPE( PCCTM_FTN | PCCT_INT , PCCTM_PTR ) 86410671Speter , "_blkclr" ); 86518457Sralph putLV( 0 , cbn , sizes[ cbn ].om_max , NLOCAL , PCCT_CHAR ); 86618457Sralph putleaf( PCC_ICON , ( -sizes[ cbn ].om_max ) - DPOFF1 86718457Sralph , 0 , PCCT_INT , 0 ); 86818457Sralph putop( PCC_CM , PCCT_INT ); 86918457Sralph putop( PCC_CALL , PCCT_INT ); 87010671Speter putdot( filename , line ); 87110671Speter } 87210671Speter /* 87310671Speter * set up goto vector if non-local goto to this frame 87410671Speter */ 87510671Speter if ( parts[ cbn ] & NONLOCALGOTO ) { 87618457Sralph putleaf( PCC_ICON , 0 , 0 , PCCM_ADDTYPE( PCCTM_FTN | PCCT_INT , PCCTM_PTR ) 87710671Speter , "_setjmp" ); 87818457Sralph putLV( 0 , cbn , GOTOENVOFFSET , NLOCAL , PCCTM_PTR|PCCT_STRTY ); 87918457Sralph putop( PCC_CALL , PCCT_INT ); 88018457Sralph putleaf( PCC_ICON , 0 , 0 , PCCT_INT , 0 ); 88118457Sralph putop( PCC_NE , PCCT_INT ); 88218457Sralph putleaf( PCC_ICON , setjmp0 , 0 , PCCT_INT , 0 ); 88318457Sralph putop( PCC_CBRANCH , PCCT_INT ); 88410671Speter putdot( filename , line ); 88510671Speter /* 88610671Speter * on non-local goto, setjmp returns with address to 88710671Speter * be branched to. 88810671Speter */ 88910671Speter putprintf(" movl d0,a0", 0); 89010671Speter putprintf(" jmp a0@", 0); 89118347Smckusick (void) putlab(setjmp0); 89210671Speter } 89310671Speter } 89410671Speter 89510671Speter fp_exitcode(eecookiep) 89610671Speter struct entry_exit_cookie *eecookiep; 89710671Speter { 89810671Speter /* 89910671Speter * if there were file variables declared at this level 90010671Speter * call PCLOSE( ap ) to clean them up. 90110671Speter */ 90210671Speter if ( dfiles[ cbn ] ) { 90318457Sralph putleaf( PCC_ICON , 0 , 0 , PCCM_ADDTYPE( PCCTM_FTN | PCCT_INT , PCCTM_PTR ) 90410671Speter , "_PCLOSE" ); 90518457Sralph putleaf( PCC_REG , 0 , P2AP , PCCM_ADDTYPE( PCCT_CHAR , PCCTM_PTR ) , 0 ); 90618457Sralph putop( PCC_CALL , PCCT_INT ); 90710671Speter putdot( filename , line ); 90810671Speter } 90910671Speter /* 91010671Speter * if this is a function, 91110671Speter * the function variable is the return value. 91210671Speter * if it's a scalar valued function, return scalar, 91310671Speter * else, return a pointer to the structure value. 91410671Speter */ 91510671Speter if ( eecookiep -> nlp -> class == FUNC ) { 91610671Speter struct nl *fvar = eecookiep -> nlp -> ptr[ NL_FVAR ]; 91710671Speter long fvartype = p2type( fvar -> type ); 91818347Smckusick char *label; 91910671Speter char labelname[ BUFSIZ ]; 92010671Speter 92110671Speter switch ( classify( fvar -> type ) ) { 92210671Speter case TBOOL: 92310671Speter case TCHAR: 92410671Speter case TINT: 92510671Speter case TSCAL: 92610671Speter case TDOUBLE: 92710671Speter case TPTR: 92810671Speter putRV( fvar -> symbol , ( fvar -> nl_block ) & 037 , 92910671Speter fvar -> value[ NL_OFFS ] , 93010671Speter fvar -> extra_flags , 93110671Speter fvartype ); 93218457Sralph putop( PCC_FORCE , fvartype ); 93310671Speter break; 93410671Speter default: 93510671Speter label = getlab(); 93610671Speter sprintf( labelname , PREFIXFORMAT , LABELPREFIX , label ); 93710671Speter putprintf(" .lcomm %s,%d", 0, 93810671Speter labelname, lwidth(fvar -> type)); 93918457Sralph putleaf( PCC_NAME , 0 , 0 , fvartype , labelname ); 94010671Speter putLV( fvar -> symbol , ( fvar -> nl_block ) & 037 , 94110671Speter fvar -> value[ NL_OFFS ] , 94210671Speter fvar -> extra_flags , 94310671Speter fvartype ); 94418457Sralph putstrop( PCC_STASG , PCCM_ADDTYPE(fvartype, PCCTM_PTR) , 94511857Speter lwidth( fvar -> type ) , 94610671Speter align( fvar -> type ) ); 94710671Speter putdot( filename , line ); 94818457Sralph putleaf( PCC_ICON , 0 , 0 , PCCM_ADDTYPE(fvartype, PCCTM_PTR), labelname ); 94918457Sralph putop( PCC_FORCE , PCCM_ADDTYPE(fvartype, PCCTM_PTR) ); 95010671Speter break; 95110671Speter } 95210671Speter putdot( filename , line ); 95310671Speter } 95410671Speter /* 95510671Speter * if we saved a display, we must restore it. 95610671Speter */ 95710671Speter if ( parts[ cbn ] & NONLOCALVAR ) { 95810671Speter /* 95910671Speter * restore old display entry from save area 96010671Speter */ 96110671Speter putprintf(" movl %s@(%d),%s+%d", 0, 96210671Speter P2FPNAME, DSAVEOFFSET, 96310671Speter DISPLAYNAME, cbn * sizeof(struct dispsave)); 96410671Speter } 96510671Speter } 96610671Speter 96710671Speter fp_epilogue(eecookiep) 96810671Speter struct entry_exit_cookie *eecookiep; 96910671Speter { 97010671Speter /* 97110671Speter * all done by the second pass. 97210671Speter */ 97310671Speter } 97410671Speter 97510671Speter fp_formalentry(eecookiep) 97610671Speter struct entry_exit_cookie *eecookiep; 97710671Speter { 97810671Speter putprintf( "%s%s:" , 0 , FORMALPREFIX , eecookiep -> extname ); 97910671Speter putprintf(" link %s,#0", 0, P2FPNAME); 98010671Speter putprintf(" addl #-%s%d,sp", 0, FRAME_SIZE_LABEL, ftnno); 98110671Speter /* touch new end of stack, to break more stack space */ 98210671Speter putprintf(" tstb sp@(-%s%d)", 0, PAGE_BREAK_LABEL, ftnno); 98310671Speter putprintf(" moveml #%s%d,sp@", 0, SAVE_MASK_LABEL, ftnno); 98418457Sralph putleaf( PCC_ICON , 0 , 0 , PCCM_ADDTYPE( PCCTM_FTN | PCCT_INT , PCCTM_PTR ) , "_FCALL" ); 98510671Speter putRV( 0 , cbn , 98610671Speter eecookiep -> nlp -> value[ NL_OFFS ] + sizeof( struct formalrtn * ) , 98718457Sralph NPARAM , PCCTM_PTR | PCCT_STRTY ); 98818457Sralph putRV(0, cbn, eecookiep -> nlp -> value[NL_OFFS], NPARAM, PCCTM_PTR|PCCT_STRTY); 98918457Sralph putop( PCC_CM , PCCT_INT ); 99018457Sralph putop( PCC_CALL , PCCT_INT ); 99110671Speter putdot( filename , line ); 99210671Speter putjbr( eecookiep -> toplabel ); 99310671Speter } 99410671Speter #endif mc68000 9953363Speter #endif PC 996