-/*)Module asexpr.c
- *
- * The module asexpr.c contains the routines to evaluate
- * arithmetic/numerical expressions. The functions in
- * asexpr.c perform a recursive evaluation of the arithmetic
- * expression read from the assembler-source text line.
- * The expression may include binary/unary operators, brackets,
- * symbols, labels, and constants in hexadecimal, decimal, octal
- * and binary. Arithmetic operations are prioritized and
- * evaluated by normal arithmetic conventions.
- *
- * asexpr.c contains the following functions:
- * VOID abscheck()
- * addr_t absexpr()
- * VOID clrexpr()
- * int digit()
- * VOID expr()
- * int oprio()
- * VOID term()
- *
- * asexpr.c contains no local/static variables
+/*)Module asexpr.c
+ *
+ * The module asexpr.c contains the routines to evaluate
+ * arithmetic/numerical expressions. The functions in
+ * asexpr.c perform a recursive evaluation of the arithmetic
+ * expression read from the assembler-source text line.
+ * The expression may include binary/unary operators, brackets,
+ * symbols, labels, and constants in hexadecimal, decimal, octal
+ * and binary. Arithmetic operations are prioritized and
+ * evaluated by normal arithmetic conventions.
+ *
+ * asexpr.c contains the following functions:
+ * VOID abscheck()
+ * Addr_T absexpr()
+ * VOID clrexpr()
+ * int digit()
+ * VOID expr()
+ * int oprio()
+ * VOID term()
+ *
+ * asexpr.c contains no local/static variables
-/*)Function VOID expr(esp, n)
- *
- * expr * esp pointer to an expr structure
- * int n a firewall priority; all top
- * level calls (from the user)
- * should be made with n set to 0.
- *
- * The function expr() evaluates an expression and
- * stores its value and relocation information into
- * the expr structure supplied by the user.
- *
- * local variables:
- * int c current assembler-source
- * text character
- * int p current operator priority
- * area * ap pointer to an area structure
- * exp re internal expr structure
- *
- * global variables:
- * char ctype[] array of character types, one per
- * ASCII character
- *
- * functions called:
- * VOID abscheck() asexpr.c
- * VOID clrexpr() asexpr.c
- * VOID expr() asexpr.c
- * int getnb() aslex.c
- * int oprio() asexpr.c
- * VOID qerr() assubr.c
- * VOID rerr() assubr.c
- * VOID term() asexpr.c
- * VOID unget() aslex.c
- *
- *
- * side effects:
- * An expression is evaluated modifying the user supplied
- * expr structure, a sym structure maybe created for an
- * undefined symbol, and the parse of the expression may
- * terminate if a 'q' error occurs.
+/*)Function VOID expr(esp, n)
+ *
+ * expr * esp pointer to an expr structure
+ * int n a firewall priority; all top
+ * level calls (from the user)
+ * should be made with n set to 0.
+ *
+ * The function expr() evaluates an expression and
+ * stores its value and relocation information into
+ * the expr structure supplied by the user.
+ *
+ * local variables:
+ * int c current assembler-source
+ * text character
+ * int p current operator priority
+ * area * ap pointer to an area structure
+ * exp re internal expr structure
+ *
+ * global variables:
+ * char ctype[] array of character types, one per
+ * ASCII character
+ *
+ * functions called:
+ * VOID abscheck() asexpr.c
+ * VOID clrexpr() asexpr.c
+ * VOID expr() asexpr.c
+ * int getnb() aslex.c
+ * int oprio() asexpr.c
+ * VOID qerr() assubr.c
+ * VOID rerr() assubr.c
+ * VOID term() asexpr.c
+ * VOID unget() aslex.c
+ *
+ *
+ * side effects:
+ * An expression is evaluated modifying the user supplied
+ * expr structure, a sym structure maybe created for an
+ * undefined symbol, and the parse of the expression may
+ * terminate if a 'q' error occurs.
- /*
- * Both operands (esp and re) must be constants
- */
- /* SD :- moved the abscheck to each case
- case and change the right shift operator.. if
- right shift by 8 bits of a relocatable address then
- the user wants the higher order byte. set the R_MSB
- for the expression */
+ /*
+ * Both operands (esp and re) must be constants
+ */
+ /* SD :- moved the abscheck to each case
+ case and change the right shift operator.. if
+ right shift by 8 bits of a relocatable address then
+ the user wants the higher order byte. set the R_MSB
+ for the expression */
- /* SD change here */
- abscheck(&re);
- /* if the left is a relative address &
- the right side is == 8 then */
- if (esp->e_base.e_ap && re.e_addr == 8) {
- esp->e_rlcf |= R_MSB ;
- break;
- }
- else if (esp->e_base.e_ap && re.e_addr == 16)
- {
- if (flat24Mode)
- {
- esp->e_rlcf |= R_HIB;
- }
- else
- {
- warnBanner();
- fprintf(stderr,
- "(expr >> 16) is only meaningful in "
- ".flat24 mode.\n");
- qerr();
- }
-
- break;
- }
- /* else continue with the normal processing */
- abscheck(esp);
- esp->e_addr >>= re.e_addr;
- break;
-
- default:
- qerr();
- break;
- }
+ /* SD change here */
+ abscheck(&re);
+ /* if the left is a relative address &
+ the right side is == 8 then */
+ if (esp->e_base.e_ap && re.e_addr == 8) {
+ esp->e_rlcf |= R_MSB ;
+ break;
+ }
+ else if (esp->e_base.e_ap && re.e_addr == 16)
+ {
+// if (flat24Mode)
+// {
+ esp->e_rlcf |= R_HIB;
+// }
+// else
+// {
+// warnBanner();
+// fprintf(stderr,
+// "(expr >> 16) is only meaningful in "
+// ".flat24 mode.\n");
+// qerr();
+// }
+
+ break;
+ }
+ /* else continue with the normal processing */
+ abscheck(esp);
+ esp->e_addr >>= re.e_addr;
+ break;
+
+ default:
+ qerr();
+ break;
+ }
-/*)Function VOID term(esp)
- *
- * expr * esp pointer to an expr structure
- *
- * The function term() evaluates a single constant
- * or symbol value prefaced by any unary operator
- * ( +, -, ~, ', ", >, or < ). This routine is also
- * responsible for setting the relocation type to symbol
- * based (e.flag != 0) on global references.
- *
- * local variables:
- * int c current character
- * char id[] symbol name
- * char * jp pointer to assembler-source text
- * int n constant evaluation running sum
- * int r current evaluation radix
- * sym * sp pointer to a sym structure
- * tsym * tp pointer to a tsym structure
- * int v current digit evaluation
- *
- * global variables:
- * char ctype[] array of character types, one per
- * ASCII character
- * sym * symp pointer to a symbol structure
- *
- * functions called:
- * VOID abscheck() asexpr.c
- * int digit() asexpr.c
- * VOID err() assubr.c
- * VOID expr() asexpr.c
- * int is_abs() asexpr.c
- * int get() aslex.c
- * VOID getid() aslex.c
- * int getmap() aslex.c
- * int getnb() aslex.c
- * sym * lookup() assym.c
- * VOID qerr() assubr.c
- * VOID unget() aslex.c
- *
- * side effects:
- * An arithmetic term is evaluated, a symbol structure
- * may be created, term evaluation may be terminated
- * by a 'q' error.
+/*)Function VOID term(esp)
+ *
+ * expr * esp pointer to an expr structure
+ *
+ * The function term() evaluates a single constant
+ * or symbol value prefaced by any unary operator
+ * ( +, -, ~, ', ", >, or < ). This routine is also
+ * responsible for setting the relocation type to symbol
+ * based (e.flag != 0) on global references.
+ *
+ * local variables:
+ * int c current character
+ * char id[] symbol name
+ * char * jp pointer to assembler-source text
+ * int n constant evaluation running sum
+ * int r current evaluation radix
+ * sym * sp pointer to a sym structure
+ * tsym * tp pointer to a tsym structure
+ * int v current digit evaluation
+ *
+ * global variables:
+ * char ctype[] array of character types, one per
+ * ASCII character
+ * sym * symp pointer to a symbol structure
+ *
+ * functions called:
+ * VOID abscheck() asexpr.c
+ * int digit() asexpr.c
+ * VOID err() assubr.c
+ * VOID expr() asexpr.c
+ * int is_abs() asexpr.c
+ * int get() aslex.c
+ * VOID getid() aslex.c
+ * int getmap() aslex.c
+ * int getnb() aslex.c
+ * sym * lookup() assym.c
+ * VOID qerr() assubr.c
+ * VOID unget() aslex.c
+ *
+ * side effects:
+ * An arithmetic term is evaluated, a symbol structure
+ * may be created, term evaluation may be terminated
+ * by a 'q' error.
- * The function is_abs() tests the evaluation of an
- * expression to verify it is absolute. If the evaluation
- * is absolute then 1 is returned, else 0 is returned.
+ * The function is_abs() tests the evaluation of an
+ * expression to verify it is absolute. If the evaluation
+ * is absolute then 1 is returned, else 0 is returned.