extern arith full_mask[];
extern arith max_int;
+#ifndef NOPP
static struct token LexStack[MAX_LL_DEPTH];
static LexSP = 0;
ASSERT(LexSP > 0);
dot = LexStack[--LexSP];
}
+#endif /* NOPP */
int
LLlex()
if (ch == '#') {
/* a control line follows */
domacro();
+#ifndef NOPP
if (File_Inserted) {
File_Inserted = 0;
goto firstline;
}
+#endif /* NOPP */
}
}
/* We have to loop here, because in
register struct expr **expp;
{
opnd2logical(expp, oper);
- if ((*expp)->ex_class == Oper && is_test_op((*expp)->OP_OPER))
- { /* It is already a test */ }
- else
- ch3bin(expp, NOTEQUAL, intexpr((arith)0, INT));
-}
-
-int
-is_test_op(oper)
-{
- switch (oper) {
- case '<':
- case '>':
- case LESSEQ:
- case GREATEREQ:
- case EQUAL:
- case NOTEQUAL:
- case '!':
- case AND:
- case OR: /* && and || also impose a test */
- return 1;
- default:
- return 0;
+ if ((*expp)->ex_class == Oper) {
+ switch((*expp)->OP_OPER) {
+ case '<':
+ case '>':
+ case LESSEQ:
+ case GREATEREQ:
+ case EQUAL:
+ case NOTEQUAL:
+ case '!':
+ case AND:
+ case OR: /* && and || also impose a test */
+ /* It is already a test */
+ return;
+ }
+ case ',':
+ opnd2test(&((*expp)->OP_RIGHT), oper);
+ return;
+ }
}
- /*NOTREACHED*/
+ ch3bin(expp, NOTEQUAL, intexpr((arith)0, INT));
}
any2opnd(expp, oper)
we only push an object of the size accepted by EM onto the stack,
while we need a loop to store the stack block into a memory object.
*/
-store_block(sz, al)
+
+suitable_sz(sz, al)
arith sz;
int al;
{
- if (
- ((sz == al) && (word_align % al == 0)) ||
+ return ((int)sz % (int)word_size == 0 && al % word_align == 0) ||
(
- (sz % word_size == 0 || word_size % sz == 0) &&
- (al % word_align == 0)
- )
- ) /* Lots of Irritating Stupid Parentheses */
+ word_size % sz == 0 &&
+ (al >= (int)sz || al >= word_align)
+ /* Lots of Irritating Stupid Parentheses */
+ );
+}
+
+store_block(sz, al)
+ arith sz;
+ int al;
+{
+ if (suitable_sz(sz, al))
C_sti(sz);
else {
#ifndef STB
arith sz;
int al;
{
- arith esz = ATW(sz); /* effective size == actual # pushed bytes */
- if (
- ((sz == al) && (word_align % al == 0)) ||
- (
- (sz % word_size == 0 || word_size % sz == 0) &&
- (al % word_align == 0)
- )
- ) /* Lots of Irritating Stupid Parentheses */
+ if (suitable_sz(sz, al))
C_loi(sz);
else {
#ifndef STB
dst = LocalPtrVar();
StoreLocal(src, pointer_size);
- C_asp(-esz); /* allocate stack block */
+ C_asp(-ATW(sz)); /* allocate stack block */
C_lor((arith)1); /* push & of stack block as dst */
StoreLocal(dst, pointer_size);
copy_loop(sz, src, dst);
FreeLocal(dst);
FreeLocal(src);
#else STB
- C_asp(-(esz - pointer_size)); /* allocate stack block */
+ arith esz = ATW(sz) - pointer_size;
+ C_asp(-esz); /* allocate stack block */
C_lor((arith)1); /* push & of stack block as dst */
C_dup(pointer_size); /* fetch source address */
- C_adp(esz - pointer_size);
+ C_adp(esz);
C_loi(pointer_size);
C_loc(sz); /* # bytes to copy */
C_cal("__stb"); /* library copy routine */
break;
case ',':
EVAL(left, RVAL, FALSE, NO_LABEL, NO_LABEL);
- EVAL(right, RVAL, gencode, NO_LABEL, NO_LABEL);
+ EVAL(right, RVAL, gencode, true_label, false_label);
break;
case '~':
EVAL(right, RVAL, gencode, NO_LABEL, NO_LABEL);
nestlow = -1;
#ifndef NOPP
WorkingDir = getwdir(source);
-#endif NOPP
PushLex(); /* initialize lex machine */
+#else NOPP
+ GetToken(&ahead);
+#endif NOPP
#ifdef DEBUG
#ifndef NOPP
dumpidftab("end of main", options['f'] ? 7 : 0);
#endif DEBUG
}
+#ifndef NOPP
PopLex();
+#endif /* NOPP */
}
init()