The em_argtype sometimes was not set right

This commit is contained in:
ceriel 1987-07-03 10:35:55 +00:00
parent 1310910b23
commit 10caf5c785
3 changed files with 8 additions and 2 deletions

View file

@ -139,8 +139,7 @@ Common definitions are \fBlong\fR for \fBarith\fR and \fBunsigned int\fR for
The \fIe_instr\fR structure consists of the fields The \fIe_instr\fR structure consists of the fields
\fIem_type\fR, containing the type of this \fIe_instr\fR, \fIem_type\fR, containing the type of this \fIe_instr\fR,
\fIem_opcode\fR, containing the opcode of an instruction, \fIem_opcode\fR, containing the opcode of an instruction,
\fIem_arg\fR, containing a possible argument, and \fIem_arg\fR, containing a possible argument.
and two other fields for special purposes explained later.
.PP .PP
The possible values of The possible values of
\fIem_type\fR, defined in <em_comp.h>, are summarized below: \fIem_type\fR, defined in <em_comp.h>, are summarized below:

View file

@ -601,6 +601,7 @@ getlabel(c, p)
switch(p->em_argtype) { switch(p->em_argtype) {
case cst_ptyp: case cst_ptyp:
p->em_type = EM_DEFILB; p->em_type = EM_DEFILB;
p->em_argtype = ilb_ptyp;
p->em_ilb = p->em_cst; p->em_ilb = p->em_cst;
break; break;
case sof_ptyp: case sof_ptyp:

View file

@ -307,6 +307,7 @@ gethead(p)
if (i < sp_filb0+sp_nilb0 && i >= sp_filb0) { /* Instruction label */ if (i < sp_filb0+sp_nilb0 && i >= sp_filb0) { /* Instruction label */
p->em_type = EM_DEFILB; p->em_type = EM_DEFILB;
p->em_argtype = ilb_ptyp;
p->em_ilb = i - sp_filb0; p->em_ilb = i - sp_filb0;
return; return;
} }
@ -314,11 +315,13 @@ gethead(p)
switch(i) { switch(i) {
case sp_ilb1: /* Instruction label */ case sp_ilb1: /* Instruction label */
p->em_type = EM_DEFILB; p->em_type = EM_DEFILB;
p->em_argtype = ilb_ptyp;
p->em_ilb = getbyte(); p->em_ilb = getbyte();
break; break;
case sp_ilb2: /* Instruction label */ case sp_ilb2: /* Instruction label */
p->em_type = EM_DEFILB; p->em_type = EM_DEFILB;
p->em_argtype = ilb_ptyp;
p->em_ilb = get16(); p->em_ilb = get16();
#ifdef CHECKING #ifdef CHECKING
if (p->em_ilb > 32767 && !EM_error) { if (p->em_ilb > 32767 && !EM_error) {
@ -329,11 +332,13 @@ gethead(p)
case sp_dlb1: /* Numeric data label */ case sp_dlb1: /* Numeric data label */
p->em_type = EM_DEFDLB; p->em_type = EM_DEFDLB;
p->em_argtype = nof_ptyp;
p->em_dlb = getbyte(); p->em_dlb = getbyte();
break; break;
case sp_dlb2: /* Numeric data label */ case sp_dlb2: /* Numeric data label */
p->em_type = EM_DEFDLB; p->em_type = EM_DEFDLB;
p->em_argtype = nof_ptyp;
p->em_dlb = get16(); p->em_dlb = get16();
#ifdef CHECKING #ifdef CHECKING
if (p->em_dlb > 32767 && !EM_error) { if (p->em_dlb > 32767 && !EM_error) {
@ -347,6 +352,7 @@ gethead(p)
struct string *s; struct string *s;
p->em_type = EM_DEFDNAM; p->em_type = EM_DEFDNAM;
p->em_argtype = sof_ptyp;
if (!(s = getstring(1))) { if (!(s = getstring(1))) {
p->em_dnam = ""; p->em_dnam = "";
} }