SCCS-vsn: usr.bin/pascal/src/0.h 1.9
SCCS-vsn: usr.bin/pascal/src/cset.c 1.6
SCCS-vsn: usr.bin/pascal/src/p2put.c 1.6
SCCS-vsn: usr.bin/pascal/src/put.c 1.13
/* Copyright (c) 1979 Regents of the University of California */
/* Copyright (c) 1979 Regents of the University of California */
-/* static char sccsid[] = "@(#)0.h 1.8 %G%"; */
+/* static char sccsid[] = "@(#)0.h 1.9 %G%"; */
#define DEBUG
#define CONSETS
#define DEBUG
#define CONSETS
/*
* NOCON and SAWCON are flags in the tree telling whether
* a constant set is part of an expression.
/*
* NOCON and SAWCON are flags in the tree telling whether
* a constant set is part of an expression.
+ * these are no longer used,
+ * since we now do constant sets at compile time.
*/
#define NOCON 0
#define SAWCON 1
*/
#define NOCON 0
#define SAWCON 1
#define codeon() cgenflg++
#define codeoff() --cgenflg
#define codeon() cgenflg++
#define codeoff() --cgenflg
+#define CGENNING ( cgenflg >= 0 )
/*
* Codeline is the last lino output in the code generator.
/*
* Codeline is the last lino output in the code generator.
/* Copyright (c) 1979 Regents of the University of California */
/* Copyright (c) 1979 Regents of the University of California */
-static char sccsid[] = "@(#)cset.c 1.5 %G%";
+static char sccsid[] = "@(#)cset.c 1.6 %G%";
#include "whoami.h"
#include "0.h"
#include "whoami.h"
#include "0.h"
cp[temp >> LG2BITSBYTE] |= (1 << (temp & MSKBITSBYTE));
}
}
cp[temp >> LG2BITSBYTE] |= (1 << (temp & MSKBITSBYTE));
}
}
return;
# ifdef PC
putprintf( " .data" , 0 );
return;
# ifdef PC
putprintf( " .data" , 0 );
/* Copyright (c) 1979 Regents of the University of California */
/* Copyright (c) 1979 Regents of the University of California */
-static char sccsid[] = "@(#)p2put.c 1.5 %G%";
+static char sccsid[] = "@(#)p2put.c 1.6 %G%";
/*
* functions to help pi put out
/*
* functions to help pi put out
{
int length = str4len( string );
{
int length = str4len( string );
return;
p2word( TOF77( P2FTEXT , length , 0 ) );
# ifdef DEBUG
return;
p2word( TOF77( P2FTEXT , length , 0 ) );
# ifdef DEBUG
static char ppbuffer[ BUFSIZ ];
static char *ppbufp = ppbuffer;
static char ppbuffer[ BUFSIZ ];
static char *ppbufp = ppbuffer;
return;
sprintf( ppbufp , format , arg1 , arg2 , arg3 , arg4 , arg5 );
ppbufp = &( ppbuffer[ strlen( ppbuffer ) ] );
return;
sprintf( ppbufp , format , arg1 , arg2 , arg3 , arg4 , arg5 );
ppbufp = &( ppbuffer[ strlen( ppbuffer ) ] );
return;
switch ( op ) {
default:
return;
switch ( op ) {
default:
char extname[ BUFSIZ ];
char *printname;
char extname[ BUFSIZ ];
char *printname;
return;
if (level == cbn && whereis(offset) == REGVAR) {
putleaf( P2REG , 0 , (-offset) >> 1 , type , 0 );
return;
if (level == cbn && whereis(offset) == REGVAR) {
putleaf( P2REG , 0 , (-offset) >> 1 , type , 0 );
char extname[ BUFSIZ ];
char *printname;
char extname[ BUFSIZ ];
char *printname;
return;
if ( ( level <= 1 ) && ( name != 0 ) ) {
if ( name[0] != '_' ) {
return;
if ( ( level <= 1 ) && ( name != 0 ) ) {
if ( name[0] != '_' ) {
int label;
char name[ BUFSIZ ];
int label;
char name[ BUFSIZ ];
return;
putprintf( " .data" , 0 );
putprintf( " .align 2" , 0 );
return;
putprintf( " .data" , 0 );
putprintf( " .align 2" , 0 );
return;
putprintf( " .data" , 0 );
label = getlab();
return;
putprintf( " .data" , 0 );
label = getlab();
{
extern char *p2opnames[];
{
extern char *p2opnames[];
return;
p2word( TOF77( op , 0 , type ) );
# ifdef DEBUG
return;
p2word( TOF77( op , 0 , type ) );
# ifdef DEBUG
{
extern char *p2opnames[];
{
extern char *p2opnames[];
return;
p2word( TOF77( op , 0 , type ) );
p2word( size );
return;
p2word( TOF77( op , 0 , type ) );
p2word( size );
/* Copyright (c) 1979 Regents of the University of California */
/* Copyright (c) 1979 Regents of the University of California */
-static char sccsid[] = "@(#)put.c 1.12 %G%";
+static char sccsid[] = "@(#)put.c 1.13 %G%";
#include "whoami.h"
#include "opcode.h"
#include "whoami.h"
#include "opcode.h"
/*
* code disabled - do nothing
*/
/*
* code disabled - do nothing
*/
#ifdef DEBUG
if ( opt( 'k' ) )
#ifdef DEBUG
if ( opt( 'k' ) )
- printf ( ")#%5d\tCON8\t%22.14e\n" ,
+ printf ( "%5d\tCON8\t%22.14e\n" ,
lc - HEADER_BYTES ,
* ( ( double * ) &p[1] ) );
#endif
lc - HEADER_BYTES ,
* ( ( double * ) &p[1] ) );
#endif
case O_CASE1:
#ifdef DEBUG
if (opt('k'))
case O_CASE1:
#ifdef DEBUG
if (opt('k'))
- printf(")#%5d\tCASE1\t%d\n"
+ printf("%5d\tCASE1\t%d\n"
, lc - HEADER_BYTES, p[1]);
#endif
/*
, lc - HEADER_BYTES, p[1]);
#endif
/*
case O_CASE2:
#ifdef DEBUG
if (opt('k'))
case O_CASE2:
#ifdef DEBUG
if (opt('k'))
- printf(")#%5d\tCASE2\t%d\n"
+ printf("%5d\tCASE2\t%d\n"
, lc - HEADER_BYTES , p[1]);
#endif
word(p[1]);
, lc - HEADER_BYTES , p[1]);
#endif
word(p[1]);
n--;
#ifdef DEBUG
if (opt('k')) {
n--;
#ifdef DEBUG
if (opt('k')) {
- printf(")#%5d\t%s", lc - HEADER_BYTES, cp+1);
+ printf("%5d\t%s", lc - HEADER_BYTES, cp+1);
if (suboppr)
printf(":%d", suboppr);
for ( i = 2, lp = (long *)&p[1]; i < n
if (suboppr)
printf(":%d", suboppr);
for ( i = 2, lp = (long *)&p[1]; i < n
}
#ifdef DEBUG
if (opt('k')) {
}
#ifdef DEBUG
if (opt('k')) {
- printf(")#%5d\t%s", lc - HEADER_BYTES, cp+1);
+ printf("%5d\t%s", lc - HEADER_BYTES, cp+1);
if (suboppr)
printf(":%d", suboppr);
if (string)
if (suboppr)
printf(":%d", suboppr);
if (string)
register unsigned w;
register char *strptr;
register unsigned w;
register char *strptr;
/* code is off - do nothing */
return(NIL);
if (ap->class != TYPE)
/* code is off - do nothing */
return(NIL);
if (ap->class != TYPE)
if (next == NIL)
return("");
#ifdef OBJ
if (next == NIL)
return("");
#ifdef OBJ
- if (opt('k') && cgenflg >= 0)
- printf(")#%5d\t\t\"%s\"\n", lc-HEADER_BYTES, next->symbol);
+ if (opt('k') && CGENNING )
+ printf("%5d\t\t\"%s\"\n", lc-HEADER_BYTES, next->symbol);
#endif OBJ
return(next->symbol);
}
#endif OBJ
return(next->symbol);
}
/*
* code disabled - do nothing
*/
return(lc);
#ifdef DEBUG
if (opt('k'))
/*
* code disabled - do nothing
*/
return(lc);
#ifdef DEBUG
if (opt('k'))
- printf(")#%5d\t.=.+%d\n", lc - HEADER_BYTES, n);
+ printf("%5d\t.=.+%d\n", lc - HEADER_BYTES, n);
#endif
for (i = even(n); i > 0; i -= 2)
word(0);
#endif
for (i = even(n); i > 0; i -= 2)
word(0);
register char *strptr = sptr;
register int pad = padding;
register char *strptr = sptr;
register int pad = padding;
/*
* code disabled - do nothing
*/
return(lc);
#ifdef DEBUG
if (opt('k'))
/*
* code disabled - do nothing
*/
return(lc);
#ifdef DEBUG
if (opt('k'))
- printf(")#%5d\t\t\"%s\"\n", lc-HEADER_BYTES, strptr);
+ printf("%5d\t\t\"%s\"\n", lc-HEADER_BYTES, strptr);
#endif
if (pad == 0) {
do {
#endif
if (pad == 0) {
do {
return;
if (loc > (unsigned) lc)
panic("patchfil");
#ifdef DEBUG
if (opt('k'))
return;
if (loc > (unsigned) lc)
panic("patchfil");
#ifdef DEBUG
if (opt('k'))
- printf(")#\tpatch %u %D\n", loc - HEADER_BYTES, value);
+ printf("\tpatch %u %D\n", loc - HEADER_BYTES, value);