more consistent naming
This commit is contained in:
parent
a7cb540ae3
commit
480e58cc9f
|
@ -5,7 +5,7 @@
|
||||||
/* $Header$ */
|
/* $Header$ */
|
||||||
|
|
||||||
struct e_arg {
|
struct e_arg {
|
||||||
int ems_argtype; /* type of this argument */
|
int ema_argtype; /* type of this argument */
|
||||||
union e_simple_arg {
|
union e_simple_arg {
|
||||||
arith emu_cst; /* a cst */
|
arith emu_cst; /* a cst */
|
||||||
label emu_dlb; /* a numeric data label */
|
label emu_dlb; /* a numeric data label */
|
||||||
|
@ -13,15 +13,16 @@ struct e_arg {
|
||||||
char *emu_dnam; /* a data label */
|
char *emu_dnam; /* a data label */
|
||||||
char *emu_pnam; /* a procedure name */
|
char *emu_pnam; /* a procedure name */
|
||||||
char *emu_string; /* a string (fcon,icon,ucon,scon) */
|
char *emu_string; /* a string (fcon,icon,ucon,scon) */
|
||||||
} ems_arg;
|
} ema_arg;
|
||||||
arith ems_szoroff;
|
arith ema_szoroff;
|
||||||
};
|
};
|
||||||
#define ema_cst ems_arg.emu_cst
|
#define ema_cst ema_arg.emu_cst
|
||||||
#define ema_dlb ems_arg.emu_dlb
|
#define ema_dlb ema_arg.emu_dlb
|
||||||
#define ema_ilb ems_arg.emu_ilb
|
#define ema_ilb ema_arg.emu_ilb
|
||||||
#define ema_dnam ems_arg.emu_dnam
|
#define ema_dnam ema_arg.emu_dnam
|
||||||
#define ema_pnam ems_arg.emu_pnam
|
#define ema_pnam ema_arg.emu_pnam
|
||||||
#define ema_string ems_arg.emu_string
|
#define ema_nlocals ema_szoroff
|
||||||
|
#define ema_string ema_arg.emu_string
|
||||||
|
|
||||||
|
|
||||||
struct e_instr {
|
struct e_instr {
|
||||||
|
@ -49,16 +50,17 @@ extern int
|
||||||
#define em_ilb em_arg.ema_ilb
|
#define em_ilb em_arg.ema_ilb
|
||||||
#define em_dlb em_arg.ema_dlb
|
#define em_dlb em_arg.ema_dlb
|
||||||
#define em_dnam em_arg.ema_dnam
|
#define em_dnam em_arg.ema_dnam
|
||||||
#define em_argtype em_arg.ems_argtype
|
#define em_argtype em_arg.ema_argtype
|
||||||
#define em_cst em_arg.ema_cst
|
#define em_cst em_arg.ema_cst
|
||||||
#define em_pnam em_arg.ema_pnam
|
#define em_pnam em_arg.ema_pnam
|
||||||
|
#define em_nlocals em_arg.ema_nlocals
|
||||||
#define em_string em_arg.ema_string
|
#define em_string em_arg.ema_string
|
||||||
#define em_off em_arg.ems_szoroff
|
#define em_off em_arg.ema_szoroff
|
||||||
#define em_size em_arg.ems_szoroff
|
#define em_size em_arg.ema_szoroff
|
||||||
|
|
||||||
/* Arguments for EXC pseudo: */
|
/* Arguments for EXC pseudo: */
|
||||||
#define em_exc1 em_arg.ema_cst
|
#define em_exc1 em_arg.ema_cst
|
||||||
#define em_exc2 em_arg.ems_szoroff
|
#define em_exc2 em_arg.ema_szoroff
|
||||||
|
|
||||||
extern char
|
extern char
|
||||||
*EM_error, *EM_filename;
|
*EM_error, *EM_filename;
|
||||||
|
|
|
@ -243,8 +243,8 @@ EM_dopseudo(p)
|
||||||
break;
|
break;
|
||||||
case ps_pro:
|
case ps_pro:
|
||||||
checkarg(&(p->em_arg), pro_ptyp);
|
checkarg(&(p->em_arg), pro_ptyp);
|
||||||
if (p->em_size >= 0) {
|
if (p->em_nlocals >= 0) {
|
||||||
C_pro(p->em_pnam, p->em_size);
|
C_pro(p->em_pnam, p->em_nlocals);
|
||||||
}
|
}
|
||||||
else C_pro_narg(p->em_pnam);
|
else C_pro_narg(p->em_pnam);
|
||||||
break;
|
break;
|
||||||
|
|
|
@ -65,7 +65,7 @@ This structure has the following layout:
|
||||||
/* $Header$ */
|
/* $Header$ */
|
||||||
|
|
||||||
struct e_arg {
|
struct e_arg {
|
||||||
int ems_argtype; /* type of this argument */
|
int ema_argtype; /* type of this argument */
|
||||||
union e_simple_arg {
|
union e_simple_arg {
|
||||||
arith emu_cst; /* a cst */
|
arith emu_cst; /* a cst */
|
||||||
label emu_dlb; /* a numeric data label */
|
label emu_dlb; /* a numeric data label */
|
||||||
|
@ -73,15 +73,16 @@ struct e_arg {
|
||||||
char *emu_dnam; /* a data label */
|
char *emu_dnam; /* a data label */
|
||||||
char *emu_pnam; /* a procedure name */
|
char *emu_pnam; /* a procedure name */
|
||||||
char *emu_string; /* a string (fcon,icon,ucon,scon) */
|
char *emu_string; /* a string (fcon,icon,ucon,scon) */
|
||||||
} ems_arg;
|
} ema_arg;
|
||||||
arith ems_szoroff;
|
arith ema_szoroff;
|
||||||
};
|
};
|
||||||
#define ema_cst ems_arg.emu_cst
|
#define ema_cst ema_arg.emu_cst
|
||||||
#define ema_dlb ems_arg.emu_dlb
|
#define ema_dlb ema_arg.emu_dlb
|
||||||
#define ema_ilb ems_arg.emu_ilb
|
#define ema_ilb ema_arg.emu_ilb
|
||||||
#define ema_dnam ems_arg.emu_dnam
|
#define ema_dnam ema_arg.emu_dnam
|
||||||
#define ema_pnam ems_arg.emu_pnam
|
#define ema_pnam ema_arg.emu_pnam
|
||||||
#define ema_string ems_arg.emu_string
|
#define ema_nlocals ema_szoroff
|
||||||
|
#define ema_string ema_arg.emu_string
|
||||||
|
|
||||||
|
|
||||||
struct e_instr {
|
struct e_instr {
|
||||||
|
@ -109,16 +110,17 @@ extern int
|
||||||
#define em_ilb em_arg.ema_ilb
|
#define em_ilb em_arg.ema_ilb
|
||||||
#define em_dlb em_arg.ema_dlb
|
#define em_dlb em_arg.ema_dlb
|
||||||
#define em_dnam em_arg.ema_dnam
|
#define em_dnam em_arg.ema_dnam
|
||||||
#define em_argtype em_arg.ems_argtype
|
#define em_argtype em_arg.ema_argtype
|
||||||
#define em_cst em_arg.ema_cst
|
#define em_cst em_arg.ema_cst
|
||||||
#define em_pnam em_arg.ema_pnam
|
#define em_pnam em_arg.ema_pnam
|
||||||
|
#define em_nlocals em_arg.ema_nlocals
|
||||||
#define em_string em_arg.ema_string
|
#define em_string em_arg.ema_string
|
||||||
#define em_off em_arg.ems_szoroff
|
#define em_off em_arg.ema_szoroff
|
||||||
#define em_size em_arg.ems_szoroff
|
#define em_size em_arg.ema_szoroff
|
||||||
|
|
||||||
/* arguments for EXC pseudo: */
|
/* arguments for EXC pseudo: */
|
||||||
#define em_exc1 em_arg.ema_cst
|
#define em_exc1 em_arg.ema_cst
|
||||||
#define em_exc2 em_arg.ems_szoroff
|
#define em_exc2 em_arg.ema_szoroff
|
||||||
|
|
||||||
extern char
|
extern char
|
||||||
*EM_error, *EM_filename;
|
*EM_error, *EM_filename;
|
||||||
|
@ -157,7 +159,8 @@ an EM machine instruction.
|
||||||
.IP " em_arg" \nau
|
.IP " em_arg" \nau
|
||||||
The \fIem_opcode\fR field
|
The \fIem_opcode\fR field
|
||||||
contains the opcode of the instruction, and \fIem_arg\fR may contain an
|
contains the opcode of the instruction, and \fIem_arg\fR may contain an
|
||||||
argument.
|
argument. If \fIem_argtype\fR indicates that there is no argument,
|
||||||
|
\fIem_cst\fR is set to 0.
|
||||||
.IP "EM_PSEU em_opcode" \nau
|
.IP "EM_PSEU em_opcode" \nau
|
||||||
an EM pseudo instruction.
|
an EM pseudo instruction.
|
||||||
.IP " em_arg" \nau
|
.IP " em_arg" \nau
|
||||||
|
@ -174,6 +177,8 @@ They use EM_holsize, EM_holinit, EM_bsssize, and EM_bssinit, because those
|
||||||
arguments do not fit in the \fIe_arg\fR structure, and we want to keep the
|
arguments do not fit in the \fIe_arg\fR structure, and we want to keep the
|
||||||
\fIe_arg\fR structure as small as possible.
|
\fIe_arg\fR structure as small as possible.
|
||||||
The EXC pseudo has its arguments encoded as indicated in the #defines.
|
The EXC pseudo has its arguments encoded as indicated in the #defines.
|
||||||
|
The PRO pseudo has its second argument in \fIema_nlocals\fR. If it is
|
||||||
|
-1, it was omitted.
|
||||||
.IP "EM_STARTMES em_arg" \nau
|
.IP "EM_STARTMES em_arg" \nau
|
||||||
the start of a MES pseudo.
|
the start of a MES pseudo.
|
||||||
.br
|
.br
|
||||||
|
@ -212,11 +217,11 @@ end of file
|
||||||
.PD
|
.PD
|
||||||
.PP
|
.PP
|
||||||
The \fIe_arg\fR structure consists of the fields
|
The \fIe_arg\fR structure consists of the fields
|
||||||
the field \fIems_argtype\fR, containing the type of this argument or 0
|
the field \fIema_argtype\fR, containing the type of this argument or 0
|
||||||
if absent,
|
if absent,
|
||||||
the field \fIems_arg\fR, containing the value of the argument,
|
the field \fIema_arg\fR, containing the value of the argument,
|
||||||
and \fIems_szoroff\fR, containing an optional offset or size.
|
and \fIema_szoroff\fR, containing an optional offset or size.
|
||||||
The possible values of \fIems_argtype\fR, defined in <em_ptyp.h>,
|
The possible values of \fIema_argtype\fR, defined in <em_ptyp.h>,
|
||||||
are summarized below:
|
are summarized below:
|
||||||
.br
|
.br
|
||||||
.ta \w'dlb_ptyp\ \ \ \ 'u +\w'em_opcode\ \ \ 'u
|
.ta \w'dlb_ptyp\ \ \ \ 'u +\w'em_opcode\ \ \ 'u
|
||||||
|
@ -228,45 +233,45 @@ are summarized below:
|
||||||
Meaning
|
Meaning
|
||||||
.IP "0 none" \nau
|
.IP "0 none" \nau
|
||||||
no argument.
|
no argument.
|
||||||
.IP "ilb_ptyp emu_ilb" \nau
|
.IP "ilb_ptyp ema_ilb" \nau
|
||||||
an instruction label.
|
an instruction label.
|
||||||
.PD 0
|
.PD 0
|
||||||
.IP "nof_ptyp emu_dlb" \nau
|
.IP "nof_ptyp ema_dlb" \nau
|
||||||
an offset from a numeric data label.
|
an offset from a numeric data label.
|
||||||
.IP " ems_szoroff" \nau
|
.IP " ema_szoroff" \nau
|
||||||
The
|
The
|
||||||
\fIems_szodiff\fR field contains the offset and the
|
\fIema_szoroff\fR field contains the offset and the
|
||||||
\fIemu_dlb\fR field contains the label.
|
\fIema_dlb\fR field contains the label.
|
||||||
.IP "sof_ptyp emu_dnam" \nau
|
.IP "sof_ptyp ema_dnam" \nau
|
||||||
an offset from a non-numeric data label.
|
an offset from a non-numeric data label.
|
||||||
.IP " ems_szoroff" \nau
|
.IP " ema_szoroff" \nau
|
||||||
The \fIems_szoroff\fR field contains the offset and the \fIemu_dnam\fR field
|
The \fIema_szoroff\fR field contains the offset and the \fIema_dnam\fR field
|
||||||
contains the label, represented as a string.
|
contains the label, represented as a string.
|
||||||
.IP "cst_ptyp emu_cst" \nau
|
.IP "cst_ptyp ema_cst" \nau
|
||||||
a numeric constant.
|
a numeric constant.
|
||||||
.IP "pro_ptyp emu_pnam" \nau
|
.IP "pro_ptyp ema_pnam" \nau
|
||||||
a procedure name, not including the '$',
|
a procedure name, not including the '$',
|
||||||
represented as a string.
|
represented as a string.
|
||||||
.IP "str_ptyp emu_string" \nau
|
.IP "str_ptyp ema_string" \nau
|
||||||
a string constant.
|
a string constant.
|
||||||
.IP " ems_szoroff" \nau
|
.IP " ema_szoroff" \nau
|
||||||
The string is found in \fIemu_string\fR, represented as a row of bytes, of
|
The string is found in \fIema_string\fR, represented as a row of bytes, of
|
||||||
length \fIems_szoroff\fR.
|
length \fIema_szoroff\fR.
|
||||||
.IP "ico_ptyp emu_string" \nau
|
.IP "ico_ptyp ema_string" \nau
|
||||||
an integer constant.
|
an integer constant.
|
||||||
.IP " ems_szoroff" \nau
|
.IP " ema_szoroff" \nau
|
||||||
A string representation of the constant is found in \fIemu_string\fR.
|
A string representation of the constant is found in \fIema_string\fR.
|
||||||
It has size \fIems_szoroff\fR bytes on the target machine.
|
It has size \fIema_szoroff\fR bytes on the target machine.
|
||||||
.IP "uco_ptyp emu_string" \nau
|
.IP "uco_ptyp ema_string" \nau
|
||||||
an unsigned constant.
|
an unsigned constant.
|
||||||
.IP " ems_szoroff" \nau
|
.IP " ema_szoroff" \nau
|
||||||
A string representation of the constant is found in \fIemu_string\fR.
|
A string representation of the constant is found in \fIema_string\fR.
|
||||||
It has size \fIems_szoroff\fR bytes on the target machine.
|
It has size \fIema_szoroff\fR bytes on the target machine.
|
||||||
.IP "fco_ptyp emu_string" \nau
|
.IP "fco_ptyp ema_string" \nau
|
||||||
a floating constant.
|
a floating constant.
|
||||||
.IP " ems_szoroff" \nau
|
.IP " ema_szoroff" \nau
|
||||||
A string representation of the constant is found in \fIemu_string\fR.
|
A string representation of the constant is found in \fIema_string\fR.
|
||||||
It has size \fIems_szoroff\fR bytes on the target machine.
|
It has size \fIema_szoroff\fR bytes on the target machine.
|
||||||
.PD
|
.PD
|
||||||
.PP
|
.PP
|
||||||
When an error occurs, \fIEM_error\fR is set to indicate the reason.
|
When an error occurs, \fIEM_error\fR is set to indicate the reason.
|
||||||
|
|
|
@ -242,6 +242,7 @@ EM_getinstr(p)
|
||||||
j = em_flag[p->em_opcode - sp_fmnem] & EM_PAR;
|
j = em_flag[p->em_opcode - sp_fmnem] & EM_PAR;
|
||||||
i = em_ptyp[j];
|
i = em_ptyp[j];
|
||||||
if (j == PAR_NO) { /* No arguments */
|
if (j == PAR_NO) { /* No arguments */
|
||||||
|
p->em_argtype = 0;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
#ifndef COMPACT
|
#ifndef COMPACT
|
||||||
|
@ -280,7 +281,10 @@ EM_getinstr(p)
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case PAR_W:
|
case PAR_W:
|
||||||
if (p->em_argtype == 0) break;
|
if (p->em_argtype == 0) {
|
||||||
|
p->em_cst = 0;
|
||||||
|
break;
|
||||||
|
}
|
||||||
check((p->em_cst & ~wordmask[wsize]) == 0);
|
check((p->em_cst & ~wordmask[wsize]) == 0);
|
||||||
/* Fall through */
|
/* Fall through */
|
||||||
case PAR_S:
|
case PAR_S:
|
||||||
|
@ -349,9 +353,9 @@ EM_getinstr(p)
|
||||||
getarg(pro_ptyp, &(p->em_arg));
|
getarg(pro_ptyp, &(p->em_arg));
|
||||||
getarg(cst_ptyp|ptyp(sp_cend), &dummy);
|
getarg(cst_ptyp|ptyp(sp_cend), &dummy);
|
||||||
if (dummy.ems_argtype == 0) {
|
if (dummy.ems_argtype == 0) {
|
||||||
p->em_off = -1;
|
p->em_nlocals = -1;
|
||||||
}
|
}
|
||||||
else p->em_off = dummy.ema_cst;
|
else p->em_nlocals = dummy.ema_cst;
|
||||||
break;
|
break;
|
||||||
case ps_end:
|
case ps_end:
|
||||||
getarg(cst_ptyp|ptyp(sp_cend), &(p->em_arg));
|
getarg(cst_ptyp|ptyp(sp_cend), &(p->em_arg));
|
||||||
|
|
Loading…
Reference in a new issue