Merge remote-tracking branch 'upstream/default' into default
Conflicts: util/arch/archiver.c
This commit is contained in:
commit
08b9482ac7
345 changed files with 17288 additions and 14580 deletions
|
@ -1,3 +1,5 @@
|
|||
.obj
|
||||
.sass-cache
|
||||
_site
|
||||
.vscode
|
||||
|
||||
|
|
36
build.lua
36
build.lua
|
@ -27,17 +27,8 @@ vars.plats_with_tests = {
|
|||
"pc86",
|
||||
}
|
||||
|
||||
local plat_packages = {}
|
||||
local test_packages = {}
|
||||
for _, p in ipairs(vars.plats) do
|
||||
plat_packages[#plat_packages+1] = "plat/"..p.."+pkg"
|
||||
end
|
||||
for _, p in ipairs(vars.plats_with_tests) do
|
||||
test_packages[#test_packages+1] = "plat/"..p.."/tests+tests"
|
||||
end
|
||||
|
||||
installable {
|
||||
name = "ack",
|
||||
name = "ack-common",
|
||||
map = {
|
||||
"lang/basic/src+pkg",
|
||||
"lang/cem/cemcom.ansi+pkg",
|
||||
|
@ -53,6 +44,31 @@ installable {
|
|||
"util/led+pkg",
|
||||
"util/misc+pkg",
|
||||
"util/opt+pkg",
|
||||
},
|
||||
}
|
||||
|
||||
local plat_packages = {}
|
||||
local test_packages = {}
|
||||
for _, p in ipairs(vars.plats) do
|
||||
local pkg = "plat/"..p.."+pkg"
|
||||
plat_packages[#plat_packages+1] = pkg
|
||||
|
||||
installable {
|
||||
name = "ack-"..p,
|
||||
map = {
|
||||
"+ack-common",
|
||||
pkg,
|
||||
},
|
||||
}
|
||||
end
|
||||
for _, p in ipairs(vars.plats_with_tests) do
|
||||
test_packages[#test_packages+1] = "plat/"..p.."/tests+tests"
|
||||
end
|
||||
|
||||
installable {
|
||||
name = "ack",
|
||||
map = {
|
||||
"+ack-common",
|
||||
"examples+pkg",
|
||||
plat_packages
|
||||
},
|
||||
|
|
|
@ -405,7 +405,7 @@ The code rule section is the largest section in the table.
|
|||
They specify EM patterns, stack patterns, code to be generated,
|
||||
etc.
|
||||
The syntax is:
|
||||
.IP code rule:
|
||||
.IP "code rule:"
|
||||
EM pattern '|' stack pattern '|' code '|'
|
||||
stack replacement '|' EM replacement '|'
|
||||
.PP
|
||||
|
@ -605,7 +605,7 @@ loc
|
|||
stl
|
||||
.R
|
||||
$1==0
|
||||
.sp1
|
||||
.sp 1
|
||||
and the input is
|
||||
.sp 1
|
||||
.br
|
||||
|
|
|
@ -9,7 +9,6 @@
|
|||
. if t .ds <, ,\
|
||||
\}\
|
||||
\}
|
||||
.cs 5 22u
|
||||
.ND
|
||||
.EQ
|
||||
delim @@
|
||||
|
|
47
doc/cg.doc
47
doc/cg.doc
|
@ -1333,23 +1333,20 @@ Tables.c
|
|||
Tables.c contains a large number of initialized array's of all sorts.
|
||||
Description of each follows:
|
||||
.br
|
||||
.in 1i
|
||||
.ti -0.5i
|
||||
byte code rules[]
|
||||
.IP "byte code rules[]"
|
||||
.br
|
||||
Pseudo code interpreted by the code generator.
|
||||
Always starts with some opcode followed by operands depending
|
||||
on the opcode.
|
||||
Integers in this table are between 0 and 32767 and have a one byte
|
||||
encoding if between 0 and 127.
|
||||
.ti -0.5i
|
||||
char stregclass[]
|
||||
|
||||
.IP "char stregclass[]"
|
||||
.br
|
||||
Number of computed static register class per register.
|
||||
Two registers are in the same class if they have the same properties
|
||||
and don't share a common subregister.
|
||||
.ti -0.5i
|
||||
struct reginfo machregs[]
|
||||
.IP "struct reginfo machregs[]"
|
||||
.br
|
||||
Info per register.
|
||||
Initialized with representation string, size,
|
||||
|
@ -1357,78 +1354,66 @@ members of the register and set of registers affected when this
|
|||
one is changed.
|
||||
Also contains room for runtime information,
|
||||
like contents and reference count.
|
||||
.ti -0.5i
|
||||
tkdef_t tokens[]
|
||||
.IP "tkdef_t tokens[]"
|
||||
.br
|
||||
Information per tokentype.
|
||||
Initialized with size, cost, type of operands and formatstring.
|
||||
.ti -0.5i
|
||||
node_t enodes[]
|
||||
.IP "node_t enodes[]"
|
||||
.br
|
||||
List of triples representing expressions for the code generator.
|
||||
.ti -0.5i
|
||||
string code strings[]
|
||||
.IP "string code strings[]"
|
||||
.br
|
||||
List of strings.
|
||||
All strings are put in a list and checked for duplication,
|
||||
so only one copy per string will reside here.
|
||||
.ti -0.5i
|
||||
set_t machsets[]
|
||||
.IP "set_t machsets[]"
|
||||
.br
|
||||
List of token expression sets.
|
||||
Bit 0 of the set is used for the SCRATCH property of registers,
|
||||
bit 1 upto NREG are for the corresponding registers
|
||||
and bit NREG+1 upto the end are for corresponding tokens.
|
||||
.ti -0.5i
|
||||
inst_t tokeninstances[]
|
||||
.IP "inst_t tokeninstances[]"
|
||||
.br
|
||||
List of descriptions for building tokens.
|
||||
Contains type of rule for building one,
|
||||
plus operands depending on the type.
|
||||
.ti -0.5i
|
||||
move_t moves[]
|
||||
.IP "move_t moves[]"
|
||||
.br
|
||||
List of move rules.
|
||||
Contains token expressions for source and destination
|
||||
plus cost and index for code rule.
|
||||
.ti -0.5i
|
||||
byte pattern[]
|
||||
.IP "byte pattern[]"
|
||||
.br
|
||||
EM patterns.
|
||||
This is structured internally as chains of patterns,
|
||||
each chain pointed at by pathash[].
|
||||
After each pattern the list of possible code rules is given.
|
||||
.ti -0.5i
|
||||
int pathash[256]
|
||||
.IP "int pathash[256]"
|
||||
.br
|
||||
Indices into pattern[] for all patterns with a certain low order
|
||||
byte of the hashing function.
|
||||
.ti -0.5i
|
||||
c1_t c1coercs[]
|
||||
.IP "c1_t c1coercs[]"
|
||||
.br
|
||||
List of rules to stack tokens.
|
||||
Contains token expressions,
|
||||
register needed,
|
||||
cost
|
||||
and code rule.
|
||||
.ti -0.5i
|
||||
c2_t c2coercs[]
|
||||
.IP "c2_t c2coercs[]"
|
||||
.br
|
||||
List of splitting coercions.
|
||||
Token expressions,
|
||||
split factor,
|
||||
replacements
|
||||
and code rule.
|
||||
.ti -0.5i
|
||||
c3_t c3coercs[]
|
||||
.IP "c3_t c3coercs[]"
|
||||
.br
|
||||
List of one to one coercions.
|
||||
Token expressions,
|
||||
register needed,
|
||||
replacement
|
||||
and code rule.
|
||||
.ti -0.5i
|
||||
struct reginfo **reglist[]
|
||||
.IP "struct reginfo **reglist[]"
|
||||
.br
|
||||
List of lists of pointers to register information.
|
||||
For every property the list is here
|
||||
|
|
|
@ -7,4 +7,3 @@
|
|||
.ds >, ,
|
||||
.ds [. " [
|
||||
.ds .] ]
|
||||
.cs 5 22
|
||||
|
|
|
@ -34,8 +34,7 @@ Instruction labels are unsigned positive integers.
|
|||
The scope of an instruction label is its procedure.
|
||||
.QQ
|
||||
The pseudoinstructions CON, ROM and BSS may be preceded by a
|
||||
line containing a
|
||||
1\-8 character data label, the first character of which is a
|
||||
line containing a character based data label, the first character of which is a
|
||||
letter, period or underscore.
|
||||
The period may only be followed by
|
||||
digits, the others may be followed by letters, digits and underscores.
|
||||
|
@ -200,7 +199,7 @@ l l l.
|
|||
<ilb>:\&=:instruction label
|
||||
::'*' followed by an integer in the range 0..32767.
|
||||
<pro>:\&=:procedure number ('$' followed by a procedure name)
|
||||
<val>:\&=:<arg>, <con>, <pro> or <ilb>.
|
||||
<val>:\&=:<arg>, <con>, <str>, <pro> or <ilb>.
|
||||
<par>:\&=:<val> or <str>
|
||||
<...>*:\&=:zero or more of <...>
|
||||
<...>+:\&=:one or more of <...>
|
||||
|
|
File diff suppressed because it is too large
Load diff
|
@ -10,7 +10,7 @@ A back end is a part of the Amsterdam Compiler Kit (ACK).
|
|||
It translates EM, a family of intermediate languages, into the
|
||||
assembly language of some target machine, here the Intel 8080 and Intel 8085 microprocessors.
|
||||
.AE
|
||||
.NH1
|
||||
.NH 1
|
||||
INTRODUCTION
|
||||
.PP
|
||||
To simplify the task of producing portable (cross) compilers and
|
||||
|
|
275
doc/install.doc
Normal file → Executable file
275
doc/install.doc
Normal file → Executable file
|
@ -1,4 +1,3 @@
|
|||
.\" $Id$
|
||||
.if n .nr PD 1v
|
||||
.if n .nr LL 78m
|
||||
.if n .ll 78m
|
||||
|
@ -18,13 +17,6 @@ This document
|
|||
describes the process of installing the Amsterdam Compiler Kit (ACK).
|
||||
It depends on the combination of hard- and software how
|
||||
hard it will be to install the Kit.
|
||||
This description is intended for a Sun-3 or SPARC workstation.
|
||||
Installation on VAXen running Berkeley
|
||||
.UX
|
||||
or Ultrix,
|
||||
Sun-2 systems and most System V
|
||||
.UX
|
||||
systems should be easy.
|
||||
As of this distribution, installation on PDP-11's or other
|
||||
systems with a small address space is no longer supported.
|
||||
See section 8 for installation on other systems.
|
||||
|
@ -35,7 +27,7 @@ In the ACK installation process, three directory trees are used:
|
|||
.IP "-"
|
||||
the ACK source tree. This is the tree on the ACK distribution medium.
|
||||
For the rest of this document, we will refer to this directory
|
||||
as $SRC_HOME;
|
||||
as $ACK_SRC_HOME;
|
||||
.IP "-"
|
||||
a configuration tree. This tree is built by the installation process and
|
||||
is used to do compilations in. Its structure reflects that of the source tree,
|
||||
|
@ -45,10 +37,10 @@ as $CONFIG;
|
|||
.IP "-"
|
||||
an ACK users tree. This tree is also built by the installation process.
|
||||
For the rest of this document, we will refer to this directory
|
||||
as $TARGET_HOME;
|
||||
as $ACK_HOME;
|
||||
.LP
|
||||
After installation,
|
||||
the directories in $TARGET_HOME contain the following information:
|
||||
the directories in $ACK_HOME contain the following information:
|
||||
.if n .sp 1
|
||||
.if n .nr PD 0
|
||||
.IP "bin" 14
|
||||
|
@ -57,30 +49,41 @@ See the section about "Commands".
|
|||
.IP "lib"
|
||||
root of a tree containing almost all libraries used by
|
||||
commands.
|
||||
Files specific to a certain machine are collected in one subtree
|
||||
per machine. E.g. "lib/pdp", "lib/z8000".
|
||||
Files specific to a certain platform are collected in one subtree
|
||||
per platform. E.g. "lib/cpm", "lib/pdpv7".
|
||||
The names used here are the same names as used for subtrees
|
||||
of "$SRC_HOME/mach".
|
||||
of "$ACK_SRC_HOME/plat". Each of the platform specific directory
|
||||
contains the following libraries:
|
||||
.TS
|
||||
l l.
|
||||
libb B run-time system
|
||||
libbc Basic run-time system
|
||||
libc C run-time system
|
||||
libpc Pascal run-time system
|
||||
libm2 Modula-2 run-time system
|
||||
liboc Occam run-time system
|
||||
.TE
|
||||
|
||||
.IP "lib/descr"
|
||||
command descriptor files used by the program ack.
|
||||
command descriptor files used by the program ack to determine utilities to call.
|
||||
.IP "lib/LLgen"
|
||||
files used by the LL(1) parser generator.
|
||||
.IP "lib/flex"
|
||||
files used by the lexical analyzer generator Flex.
|
||||
.IP "lib/m2"
|
||||
definition modules for Modula-2.
|
||||
.IP "lib.bin"
|
||||
.IP "lib/ack"
|
||||
root of a tree containing almost all binaries used by
|
||||
commands.
|
||||
All programs specific to a certain machine are collected in one subtree
|
||||
per machine. E.g. "lib.bin/pdp", "lib.bin/z8000".
|
||||
All programs specific to a certain platform are collected in one subtree
|
||||
per machine. E.g. "lib/ack/pdpv7", "lib/ack/cpm".
|
||||
The names used here are the same names as used for subtrees
|
||||
of "$SRC_HOME/mach".
|
||||
.IP "lib.bin/ego"
|
||||
of "$ACK_SRC_HOME/plat".
|
||||
.IP "lib/ack/ego"
|
||||
files used by the global optimizer.
|
||||
.IP "lib.bin/lint"
|
||||
.IP "lib/ack/lint"
|
||||
binaries for the lint passes and lint libraries.
|
||||
.IP "lib.bin/ceg"
|
||||
.IP "lib/ack/ceg"
|
||||
files used by the code-expander-generator.
|
||||
.IP "etc"
|
||||
contains the file "ip_spec.t" needed for EM interpreters and EM documentation.
|
||||
|
@ -120,7 +123,7 @@ em_abs.h contains trap numbers and address for lin and fil
|
|||
em_ego.h definition of names for some global optimizer
|
||||
messages
|
||||
em_flag.h definition of bits in array em_flag in
|
||||
$TARGET_HOME/lib.bin/em_data.a. Describes parameters
|
||||
$ACK_HOME/lib.bin/em_data.a. Describes parameters
|
||||
effect on flow of instructions
|
||||
em_mes.h definition of names for mes pseudo numbers
|
||||
em_mnem.h instruction => compact mapping
|
||||
|
@ -187,7 +190,7 @@ The directories in the source tree contain the following information:
|
|||
.IP "bin" 14
|
||||
source of some shell-scripts.
|
||||
.IP "lib"
|
||||
mostly description files for the "ack" program.
|
||||
mostly description files for the "ack" program.
|
||||
.IP "etc"
|
||||
the main description of EM sits here.
|
||||
Files (e.g. em_table) describing
|
||||
|
@ -202,30 +205,23 @@ These directories have subdirectories named:
|
|||
.in +3n
|
||||
.TS
|
||||
l l.
|
||||
cg the backend (*.m => *.s)
|
||||
ncg the new backend (*.m => *.s)
|
||||
as the assembler (*.s => *.o) or
|
||||
cg the backend code generator (*.m => *.s)
|
||||
ncg the new backend code generator (*.m => *.s)
|
||||
mcg the modified backend code generator (*.m => *.s)
|
||||
as the CPU specific assembler (*.s => *.o) or
|
||||
assembler/linker (*.s + libraries => a.out)
|
||||
cv conversion programs for a.out files
|
||||
cv conversion programs for a.out files. Mostly replaced by "cvmach"
|
||||
dl down-load programs
|
||||
top the target optimizer
|
||||
int source for an interpreter
|
||||
int source for an interpreter (requires POSIX compliant host)
|
||||
ce code expander (fast back-end)
|
||||
|
||||
libbc to create Basic run-time system and libraries
|
||||
libcc to create C run-time system and libraries
|
||||
libcc.ansi to create ANSI C run-time system and libraries
|
||||
libpc to create Pascal run-time system and libraries
|
||||
libf77 to create Fortran run-time system and libraries
|
||||
libm2 to create Modula-2 run-time system and libraries
|
||||
liboc to create occam run-time system and libraries
|
||||
libem EM runtime system, only depending on CPU type
|
||||
libem to create runtime system used by code generators
|
||||
libend library defining end, edata, etext
|
||||
libfp to create floating point library
|
||||
libfp to create floating point emulation library
|
||||
libdb to create debugger support library
|
||||
libsys system-dependent EM library
|
||||
libce fast cc-compatible C compiler library support
|
||||
|
||||
ce code expander (fast back-end)
|
||||
|
||||
test various tests
|
||||
.TE
|
||||
|
@ -245,6 +241,21 @@ mach/proto/fp floating point package sources
|
|||
mach/proto/libg makefiles for compiling libraries
|
||||
mach/proto/grind machine-independent debugger support
|
||||
.TE
|
||||
|
||||
.IP "plat"
|
||||
Group of directories which are specific to each operating system.
|
||||
These dirctories have subdirectories named:
|
||||
|
||||
.TS
|
||||
l l.
|
||||
cvmach conversion program to convert from a.out to platform specific binaries.
|
||||
emu system specific platform emulator or simulator used for testing.
|
||||
libsys system-dependent library used to interface with the operating system.
|
||||
include/ack system-dependent include files for building libc library, including mandatory "plat.h"
|
||||
include/sys system-dependent include files used with libsys.
|
||||
.TE
|
||||
|
||||
|
||||
.IP "emtest"
|
||||
contains prototype of em test set.
|
||||
.IP "lang"
|
||||
|
@ -262,26 +273,26 @@ the Pascal compiler proper.
|
|||
the C front-end.
|
||||
.IP "lang/cem/libcc"
|
||||
.br
|
||||
directories with sources of C runtime system, libraries (in EM or C).
|
||||
directories with sources of C runtime system, libraries (in EM or C). \fIObsolete\fP.
|
||||
.IP "lang/cem/libcc/gen"
|
||||
.br
|
||||
sources for routines in chapter III of
|
||||
.UX
|
||||
programmers manual,
|
||||
excluding stdio.
|
||||
excluding stdio. \fIObsolete\fP.
|
||||
.IP "lang/cem/libcc/stdio"
|
||||
.br
|
||||
stdio sources.
|
||||
stdio sources. \fIObsolete\fP.
|
||||
.IP "lang/cem/libcc/math"
|
||||
.br
|
||||
sources for mathematical routines, normally available with the
|
||||
\fB-lm\fP option to \fIcc\fP.
|
||||
\fB-lm\fP option to \fIcc\fP. \fIObsolete\fP.
|
||||
.IP "lang/cem/libcc/mon"
|
||||
.br
|
||||
sources for routines in chapter II, mostly written in EM.
|
||||
sources for routines in chapter II, mostly written in EM. \fIObsolete\fP.
|
||||
.IP "lang/cem/cemcom"
|
||||
.br
|
||||
the compiler proper.
|
||||
the compiler proper. \fIObsolete\fP.
|
||||
.IP "lang/cem/cemcom.ansi"
|
||||
.br
|
||||
the ANSI C compiler proper.
|
||||
|
@ -290,7 +301,10 @@ the ANSI C compiler proper.
|
|||
the ANSI C preprocessor.
|
||||
.IP "lang/cem/libcc.ansi"
|
||||
.br
|
||||
the ANSI C library sources.
|
||||
Portable part of the ANSI C library sources. The platform specific source code is in
|
||||
libsys.
|
||||
.IP "lang
|
||||
|
||||
.IP "lang/cem/ctest"
|
||||
.br
|
||||
the C test set.
|
||||
|
@ -388,54 +402,79 @@ contains sub-directories for installing the fast ACK compatible compilers.
|
|||
contains the sources of the fast ACK compatible compiler drivers.
|
||||
.IP "fcc"
|
||||
contains the fast cc-compatible C compiler for SUN-3 and VAX.
|
||||
.IP "modules"
|
||||
root of a tree containing modules (optional install)
|
||||
.IP "modules/src/alloc"
|
||||
Memory management module.
|
||||
.IP "modules/src/data"
|
||||
Data structures and collections module.
|
||||
.IP "modules/src/em_code"
|
||||
EM assembly generator module (*.[km])
|
||||
.IP "modules/src/em_data"
|
||||
EM data managemet module.
|
||||
.IP "modules/src/em_mes"
|
||||
EM Message pseudo-instruction generator module.
|
||||
.IP "modules/src/em_opt"
|
||||
EM Optimizer
|
||||
.IP "modules/src/flt_arith"
|
||||
Floating point support routine module.
|
||||
.IP "modules/src/object"
|
||||
ACK Object file format support reader/writer module.
|
||||
.IP "modules/src/print"
|
||||
Light version of standard output routines. Optimized for space compared to standard C version.
|
||||
.IP "modules/src/read_em"
|
||||
Compact (*.k) EM reader module.
|
||||
.IP "modules/src/string"
|
||||
String utility module.
|
||||
.IP "modules/src/system"
|
||||
Module related to the ACK system in general as well as wrapper over standard C library calls to
|
||||
solve portability issues.
|
||||
.IP "util"
|
||||
contains directories with sources for various utilities.
|
||||
.IP "util/ack"
|
||||
the program used for translation with the Kit.
|
||||
.IP "util/opt"
|
||||
the EM peephole optimizer (*.k => *.m).
|
||||
.IP "util/ego"
|
||||
the global optimizer.
|
||||
.IP "util/topgen"
|
||||
the target optimizer generator.
|
||||
.IP "util/misc"
|
||||
decode (*.[km] => *.e) + encode (*.e => *.k).
|
||||
.IP "util/data"
|
||||
the C-code for $TARGET_HOME/lib.bin/em_data.a.
|
||||
These sources are created by the Makefile in `etc`.
|
||||
.IP "util/ass"
|
||||
the EM assembler (*.[km] + libraries => e.out).
|
||||
.IP "util/arch"
|
||||
the archivers to be used for all EM utilities.
|
||||
.IP "util/cgg"
|
||||
a program needed for compiling backends.
|
||||
.IP "util/ncgg"
|
||||
a program needed for compiling the newest backends.
|
||||
.IP "util/cpp"
|
||||
the C preprocessor.
|
||||
.IP "util/shf"
|
||||
various shell files.
|
||||
.IP "util/LLgen"
|
||||
the extended LL(1) parser generator.
|
||||
.IP "util/amisc"
|
||||
contains some programs handling ACK a.out format, such as anm, asize.
|
||||
.IP "util/arch"
|
||||
the archivers to be used for all EM utilities.
|
||||
.IP "util/ass"
|
||||
the EM assembler and linker (*.[km] + libraries => e.out).
|
||||
.IP "util/byacc"
|
||||
this is Berkeley yacc, in the public domain. \fIObsolete\fP.
|
||||
.IP "util/ceg"
|
||||
code expander generator.
|
||||
.IP "util/cgg"
|
||||
a program needed for compiling backends.
|
||||
.IP "util/cmisc"
|
||||
contains some programs to help in resolving name conflicts, and
|
||||
a dependency generator for makefiles.
|
||||
.IP "util/led"
|
||||
the ACK link-editor, reading ACK relocatable a.out format, and writing
|
||||
ACK a.out format.
|
||||
.IP "util/int"
|
||||
an EM interpreter, written in C. Very useful for checking out software,
|
||||
but slow.
|
||||
.IP "util/ceg"
|
||||
code expander generator.
|
||||
.IP "util/cpp"
|
||||
the C preprocessor. \fIObsolete\fP.
|
||||
.IP "util/ego"
|
||||
the global optimizer.
|
||||
.IP "util/grind"
|
||||
a symbolic debugger.
|
||||
.IP "util/byacc"
|
||||
this is Berkeley yacc, in the public domain.
|
||||
.IP "util/int"
|
||||
an EM interpreter, written in C. Very useful for checking out software.
|
||||
.IP "util/led"
|
||||
the ACK link-editor, reading CPU specific ACK relocatable a.out format, and writing
|
||||
ACK a.out format.
|
||||
.IP "util/LLgen"
|
||||
the extended LL(1) parser generator.
|
||||
.IP "util/make"
|
||||
simple make tool.
|
||||
.IP "util/misc"
|
||||
decode (*.[km] => *.e) + encode (*.e => *.k).
|
||||
.IP "util/ncgg"
|
||||
a program needed for compiling the newest backends.
|
||||
.IP "util/opt"
|
||||
the EM peephole optimizer (*.k => *.m).
|
||||
.IP "util/shf"
|
||||
various shell files.
|
||||
.IP "util/topgen"
|
||||
the target optimizer generator.
|
||||
.IP "util/flex"
|
||||
this is a replacement for lex. It carries the following copyright notice:
|
||||
this is a replacement for lex. \fIObsolete\fP. It carries the following copyright notice:
|
||||
.IP ""
|
||||
.nf
|
||||
Copyright (c) 1990 The Regents of the University of California.
|
||||
|
@ -469,8 +508,8 @@ PURPOSE.
|
|||
.if n .nr PD 1v
|
||||
.LP
|
||||
All path names mentioned in the text of this document are relative to
|
||||
$SRC_HOME, unless they start with '/' or one of $SRC_HOME,
|
||||
$TARGET_HOME or $CONFIG.
|
||||
$ACK_SRC_HOME, unless they start with '/' or one of $ACK_SRC_HOME,
|
||||
$ACK_HOME or $CONFIG.
|
||||
.NH
|
||||
Restoring the ACK tree
|
||||
.PP
|
||||
|
@ -480,7 +519,7 @@ distribution tree structure.
|
|||
Proceed as follows
|
||||
.IP " \-" 10
|
||||
Create a directory, for example /usr/share/local/src/ack, on a device
|
||||
with at least 15 Megabytes left. This directory will be $SRC_HOME.
|
||||
with at least 15 Megabytes left. This directory will be $ACK_SRC_HOME.
|
||||
.IP " \-"
|
||||
Change to that directory (cd ...).
|
||||
.IP " \-"
|
||||
|
@ -497,7 +536,7 @@ Adapting ACK to the local system
|
|||
Before compiling the sources in the Kit some installation dependent
|
||||
actions have to be taken.
|
||||
Most of these are performed by an interactive shell script in the file
|
||||
.I $SRC_HOME/first/first.
|
||||
.I $ACK_SRC_HOME/first/first.
|
||||
Calling this script should be done
|
||||
from another directory, for instance an empty directory which will later
|
||||
become $CONFIG.
|
||||
|
@ -508,8 +547,8 @@ script are:
|
|||
.if n .sp 1
|
||||
.if n .nr PD 0
|
||||
.IP \-
|
||||
Asking for the path names of the ACK source directory ($SRC_HOME), the
|
||||
configuration directory ($CONFIG), and the ACK users directory ($TARGET_HOME).
|
||||
Asking for the path names of the ACK source directory ($ACK_SRC_HOME), the
|
||||
configuration directory ($CONFIG), and the ACK users directory ($ACK_HOME).
|
||||
About 5M are needed for the configuration tree. The disk space needed
|
||||
for the ACK users tree depends on which front-ends and back-ends are to be
|
||||
installed.
|
||||
|
@ -566,7 +605,7 @@ on a different machine".
|
|||
.IP \-
|
||||
Setting the default machine for which code is
|
||||
produced to the local type of system according to the table above.
|
||||
This in done in the file "$TARGET_HOME/config/local.h".
|
||||
This in done in the file "$ACK_HOME/config/local.h".
|
||||
See also section 9.1.
|
||||
.IP \-
|
||||
Asking for things that don't have to be installed.
|
||||
|
@ -599,7 +638,7 @@ Most configuration directories will have Makefiles
|
|||
used to compile and install the programs in that
|
||||
directory.
|
||||
All programs needed for compilation and/or cross compilation
|
||||
with the Kit are installed in $TARGET_HOME by these Makefiles.
|
||||
with the Kit are installed in $ACK_HOME by these Makefiles.
|
||||
These Makefiles are produced from corresponding files called
|
||||
"proto.make" in the source tree. In fact, the "proto.make" files
|
||||
are almost complete Makefiles, except for some macro definitions that
|
||||
|
@ -618,7 +657,7 @@ Calling the "TakeAction" script.
|
|||
All these Makefiles do not have to be called separately.
|
||||
We wrote a shell script calling the make's needed to install
|
||||
the whole Kit.
|
||||
This script consists of the file $SRC_HOME/TakeAction
|
||||
This script consists of the file $ACK_SRC_HOME/TakeAction
|
||||
and a few files called Action in some configuration directories.
|
||||
The Action files describe in a very simple form which actions
|
||||
have to be performed in which directories.
|
||||
|
@ -645,7 +684,7 @@ what must be installed.
|
|||
.LP
|
||||
If the installation succeeded, the Kit is ready to be used.
|
||||
Read section 6 and the manuals provided
|
||||
with the Kit (in the $TARGET_HOME/man directory) on how to use it.
|
||||
with the Kit (in the $ACK_HOME/man directory) on how to use it.
|
||||
.NH 2
|
||||
Problems
|
||||
.NH 3
|
||||
|
@ -654,7 +693,7 @@ on Unisoft m68000 systems.
|
|||
The Unisoft C compiler has a bug which impedes the correct
|
||||
translation of the peephole optimizer.
|
||||
For a more detailed description of this phenomenon see
|
||||
the file "$SRC_HOME/mach/m68k2/Unisoft_bug".
|
||||
the file "$ACK_SRC_HOME/mach/m68k2/Unisoft_bug".
|
||||
(This observation was made in 1985 or so, so it is probably
|
||||
no longer true).
|
||||
.NH 3
|
||||
|
@ -727,7 +766,7 @@ If that directory contains an Action file issue the command
|
|||
.NH
|
||||
Commands
|
||||
.PP
|
||||
The following commands are available in the $TARGET_HOME/bin directory after compilation
|
||||
The following commands are available in the $ACK_HOME/bin directory after compilation
|
||||
of the Kit:
|
||||
.IP "\fIack\fP, \fIacc\fP, \fIabc\fP, \fIapc\fP, \fIocm\fP, \fIm2\fP, \fIf2c\fP and their links" 14
|
||||
.br
|
||||
|
@ -780,7 +819,7 @@ this is a cc-compatible fast C compiler, available on SUN-3 and VAX
|
|||
systems. It compiles very fast, but produces slow code.
|
||||
.LP
|
||||
We currently make the Kit available to our users by telling
|
||||
them that they should include the $TARGET_HOME/bin directory in
|
||||
them that they should include the $ACK_HOME/bin directory in
|
||||
their PATH shell variable.
|
||||
The programs will still work when moved to a different
|
||||
directory or linked to.
|
||||
|
@ -793,7 +832,7 @@ Any call name not being \fIcc\fP, \fIacc\fP, \fIabc\fP, \fIpc\fP, \fIf2c\fP,
|
|||
\fIocm\fP, \fIm2\fP, or \fIapc\fP will be
|
||||
interpreted as the name of a 'machine description' and the
|
||||
program will try to find a description file with that name.
|
||||
The installation process will only touch the utilities in the $TARGET_HOME/bin
|
||||
The installation process will only touch the utilities in the $ACK_HOME/bin
|
||||
directory, not copies of these utilities.
|
||||
.NH
|
||||
Machines
|
||||
|
@ -802,7 +841,7 @@ Below is a table with entries for all commands in
|
|||
the bin directory used to (cross)compile for a particular machine.
|
||||
The name in the first column gives the name in the bin directory.
|
||||
The column headed dir indicates which subdirectories of
|
||||
$TARGET_HOME/lib and/or $TARGET_HOME/lib.bin are needed for compilation.
|
||||
$ACK_HOME/lib and/or $ACK_HOME/lib.bin are needed for compilation.
|
||||
The column head i/p contains the integer and pointer size used in units of
|
||||
bytes.
|
||||
The subdirectories with the same name in mach contain the sources.
|
||||
|
@ -1002,11 +1041,11 @@ the second takes 2/4 and 4/4 files,
|
|||
and the last one takes 2/2, 2/4 and 4/4.
|
||||
The PDP 11 interpreter executes floating point instructions.
|
||||
.LP
|
||||
The program \fB$TARGET_HOME/bin/em\fP calls the appropriate
|
||||
The program \fB$ACK_HOME/bin/em\fP calls the appropriate
|
||||
interpreter.
|
||||
The interpreters are looked for in the em22, em24 and em44
|
||||
subdirectories of $TARGET_HOME/lib.bin.
|
||||
The third interpreter is available as the program \fB$TARGET_HOME/bin/int\fP
|
||||
subdirectories of $ACK_HOME/lib.bin.
|
||||
The third interpreter is available as the program \fB$ACK_HOME/bin/int\fP
|
||||
in the bin directory.
|
||||
.NH
|
||||
Compilation on a different machine.
|
||||
|
@ -1036,7 +1075,7 @@ which is a major undertaking.
|
|||
.NH 2
|
||||
Universal assembler/loader, link editor
|
||||
.PP
|
||||
For most machines, the description files in $TARGET_HOME/lib/*/descr use our
|
||||
For most machines, the description files in $ACK_HOME/lib/*/descr use our
|
||||
universal assembler and our link editor.
|
||||
The load file produced is not directly
|
||||
usable in any system known to us,
|
||||
|
@ -1046,23 +1085,23 @@ executable files.
|
|||
The \fIdl\fP programs present for some machines unravel
|
||||
our a.out files and transmit commands to load memory
|
||||
to a microprocessor over a serial line.
|
||||
The file $TARGET_HOME/man/man5/ack.out.5 contains a description of the format of
|
||||
The file $ACK_HOME/man/man5/ack.out.5 contains a description of the format of
|
||||
the universal assembler load file.
|
||||
It might be useful to those who wish or need to write their
|
||||
own conversion programs.
|
||||
Also, a module is included to read and write our a.out format.
|
||||
See $TARGET_HOME/man/man3/object.3.
|
||||
See $ACK_HOME/man/man3/object.3.
|
||||
.NH
|
||||
Options
|
||||
.NH 2
|
||||
Default machine
|
||||
.PP
|
||||
There is one important option in $TARGET_HOME/config/local.h.
|
||||
There is one important option in $ACK_HOME/config/local.h.
|
||||
The utility \fIack\fP uses a default machine name when called
|
||||
as \fIacc\fP, \fIcc\fP, \fIabc\fP, \fIapc\fP, \fIpc\fP, \fIocm\fP,
|
||||
\fIm2\fP, \fIf2c\fP, or \fIack\fP.
|
||||
The machine name used by default is determined by the
|
||||
definition of ACKM in $TARGET_HOME/config/local.h.
|
||||
definition of ACKM in $ACK_HOME/config/local.h.
|
||||
The Kit is distributed with "sun3" as the default machine,
|
||||
but the shell script "first" in the directory "first" alters this
|
||||
to suit the target system.
|
||||
|
@ -1071,14 +1110,14 @@ and by default produce code that can't run on the local system.
|
|||
.NH 2
|
||||
Pathnames
|
||||
.PP
|
||||
Absolute path names are concentrated in "$TARGET_HOME/config/em_path.h".
|
||||
Absolute path names are concentrated in "$ACK_HOME/config/em_path.h".
|
||||
Only the utilities \fIack\fP, \fIflex\fP, and \fILLgen\fP use
|
||||
absolute path names to access files in the Kit.
|
||||
The tree is distributed with /usr/em as the working
|
||||
directory.
|
||||
The definition of EM_DIR in em_path.h should be altered to
|
||||
specify the root
|
||||
directory for the Compiler Kit binaries on the local system ($TARGET_HOME).
|
||||
directory for the Compiler Kit binaries on the local system ($ACK_HOME).
|
||||
This is done automatically by the shell script "first" in the
|
||||
directory "first".
|
||||
Em_path.h also specifies which directory should be used for
|
||||
|
@ -1090,7 +1129,7 @@ The shape of the tree should not be altered lightly because
|
|||
most Makefiles and the
|
||||
utility \fIack\fP know the shape of the ACK tree.
|
||||
The knowledge of the utility \fIack\fP about the shape of the tree is
|
||||
concentrated in the files in the directory $TARGET_HOME/lib/*/descr and $TARGET_HOME/lib/descr/*.
|
||||
concentrated in the files in the directory $ACK_HOME/lib/*/descr and $ACK_HOME/lib/descr/*.
|
||||
.NH
|
||||
Makefiles
|
||||
.PP
|
||||
|
@ -1120,11 +1159,11 @@ Opr should be an off-line printer daemon.
|
|||
On some systems it exists under another name e.g. lpr.
|
||||
The easiest way to call such a spooler is using a shell script
|
||||
with the name opr that calls lpr.
|
||||
This script should be placed in /usr/bin or $TARGET_HOME/bin or
|
||||
This script should be placed in /usr/bin or $ACK_HOME/bin or
|
||||
one of the directories in the PATH environment variable.
|
||||
.IP clean
|
||||
remove all files not needed for day-to-day use,
|
||||
that is binaries not in $TARGET_HOME/bin or $TARGET_HOME/lib.bin, object files etc.
|
||||
that is binaries not in $ACK_HOME/bin or $ACK_HOME/lib.bin, object files etc.
|
||||
.LP
|
||||
Example:
|
||||
.DS
|
||||
|
@ -1132,13 +1171,13 @@ make install
|
|||
.DE
|
||||
given as command in a configuration directory will cause
|
||||
compilation of all programs in the directory and copying of the results
|
||||
to the $TARGET_HOME/bin and $TARGET_HOME/lib.bin directories.
|
||||
to the $ACK_HOME/bin and $ACK_HOME/lib.bin directories.
|
||||
.NH
|
||||
Testing
|
||||
.PP
|
||||
Test sets are available in Pascal, C, Basic and EM assembly:
|
||||
.IP EM 8
|
||||
the directory $SRC_HOME/emtest contains a few EM test programs.
|
||||
the directory $ACK_SRC_HOME/emtest contains a few EM test programs.
|
||||
The EM assembly files in these tests must be transformed into
|
||||
load files.
|
||||
These tests use the LIN and NOP instructions to mark the passing of each
|
||||
|
@ -1151,7 +1190,7 @@ The test finishes normally with 0 as the last number printed
|
|||
In all other cases a bug showed its
|
||||
existence.
|
||||
.IP Pascal
|
||||
the directory $SRC_HOME/lang/pc/test contains a few Pascal test programs.
|
||||
the directory $ACK_SRC_HOME/lang/pc/test contains a few Pascal test programs.
|
||||
All these programs print the number of errors found and a
|
||||
identification of these errors.
|
||||
.sp 1
|
||||
|
@ -1170,7 +1209,7 @@ Easton, Pennsylvania 18042
|
|||
USA
|
||||
.DE
|
||||
.IP C
|
||||
the sub-directories in $SRC_HOME/lang/cem/ctest contain C test programs.
|
||||
the sub-directories in $ACK_SRC_HOME/lang/cem/ctest contain C test programs.
|
||||
The idea behind these tests is:
|
||||
if there is a program called xx.c, compile it into xx.cem.
|
||||
Run it with standard output to xx.cem.r, compare this file to
|
||||
|
@ -1184,7 +1223,7 @@ The contents of the result files depend on the word size,
|
|||
the xx.cem.g files on the distribution are intended for a
|
||||
32-bit machine.
|
||||
.IP Basic
|
||||
the directory $SRC_HOME/lang/basic/test contains some forty Basic programs.
|
||||
the directory $ACK_SRC_HOME/lang/basic/test contains some forty Basic programs.
|
||||
Not all of these programs are correct, some have syntactic errors,
|
||||
some simply don't work.
|
||||
The Makefile in that directory attempts to compile and run
|
||||
|
@ -1198,8 +1237,8 @@ An example of the output of a make is present in the file Out.std.
|
|||
Documentation
|
||||
.PP
|
||||
After installation, the manual pages for Amsterdam Compiler Kit can be found
|
||||
in the $TARGET_HOME/man directory. Also, the following documents are provided
|
||||
in the $TARGET_HOME/doc directory:
|
||||
in the $ACK_HOME/man directory. Also, the following documents are provided
|
||||
in the $ACK_HOME/doc directory:
|
||||
.TS
|
||||
l l.
|
||||
toolkit.doc general overview (CACM article)
|
||||
|
|
|
@ -514,7 +514,7 @@ contains routines to build the data structure from the input
|
|||
.BI C_ xxx
|
||||
routines and place the structure on the pattern queue. These routines are also
|
||||
used to build the data structures when a replacement is constructed.
|
||||
.IP aux.c 10
|
||||
.IP utils.c 10
|
||||
routines to implement the external functions used in the pattern table.
|
||||
|
||||
.LP
|
||||
|
|
|
@ -14,15 +14,6 @@
|
|||
Something wrong here! Only one of FM2, FPC, or FCC must be defined
|
||||
#endif
|
||||
|
||||
#ifdef sun3
|
||||
#define MACHNAME "m68020"
|
||||
#define SYSNAME "sun3"
|
||||
#endif
|
||||
|
||||
#ifdef vax4
|
||||
#define MACHNAME "vax4"
|
||||
#define SYSNAME "vax4"
|
||||
#endif
|
||||
|
||||
#ifdef i386
|
||||
#define MACHNAME "i386"
|
||||
|
@ -37,6 +28,8 @@ Something wrong here! Only one of FM2, FPC, or FCC must be defined
|
|||
#include <stdarg.h>
|
||||
#include <limits.h>
|
||||
#include <stddef.h>
|
||||
#include "smap.h"
|
||||
#include "stringlist.h"
|
||||
#include "em_path.h"
|
||||
#include "system.h"
|
||||
|
||||
|
@ -76,25 +69,158 @@ struct arglist
|
|||
|
||||
static char *CPP;
|
||||
static char *COMP;
|
||||
static char *LD;
|
||||
static char *cc = "cc";
|
||||
|
||||
static int kids = -1;
|
||||
static int ecount = 0;
|
||||
|
||||
struct arglist CPP_FLAGS =
|
||||
|
||||
struct size_info
|
||||
{
|
||||
/* size in bytes */
|
||||
int size;
|
||||
/* alignment */
|
||||
int align;
|
||||
};
|
||||
|
||||
/** Contains information on the different systems supported. */
|
||||
struct system_information
|
||||
{
|
||||
/** Architecture / machine name */
|
||||
char* arch;
|
||||
/** Platform name */
|
||||
char* platform;
|
||||
/** Linker path and name */
|
||||
char *linker;
|
||||
/** Runtime startup file */
|
||||
char *startup;
|
||||
/** Converter path and name */
|
||||
char *cv;
|
||||
/** C preprocessor command line arguments. */
|
||||
struct arglist cpp_flags;
|
||||
/** Compiler flags. */
|
||||
struct arglist compiler_flags;
|
||||
};
|
||||
|
||||
const struct system_information machine_info[2] =
|
||||
{
|
||||
{
|
||||
"em22" /* arch */,
|
||||
"em22" /* platform */,
|
||||
"$H/lib/ack/em_ass" /* linker */,
|
||||
#ifdef FCC
|
||||
7,
|
||||
"c-ansi.m" /* startup file */,
|
||||
#else
|
||||
13,
|
||||
#ifdef FPC
|
||||
"pascal.m" /* startup file */,
|
||||
#ifdef FM2
|
||||
"modula2.m" /* startup file */,
|
||||
#endif
|
||||
{ "-D__unix", "-D_EM_WSIZE=4", "-D_EM_PSIZE=4", "-D_EM_SSIZE=2",
|
||||
"-D_EM_LSIZE=4", "-D_EM_FSIZE=4", "-D_EM_DSIZE=8",
|
||||
#ifndef FCC
|
||||
"-DEM_WSIZE=4", "-DEM_PSIZE=4", "-DEM_SSIZE=2", "-DEM_LSIZE=4",
|
||||
"-DEM_FSIZE=4", "-DEM_DSIZE=8",
|
||||
#endif
|
||||
} };
|
||||
#endif
|
||||
NULL /* converter */,
|
||||
/** CPP Flags */
|
||||
{17,{
|
||||
"-DEM_WSIZE=2",
|
||||
"-DEM_PSIZE=2",
|
||||
"-DEM_SSIZE=2",
|
||||
"-DEM_LSIZE=4",
|
||||
"-DEM_FSIZE=4",
|
||||
"-DEM_DSIZE=8",
|
||||
"-DEM_XSIZE=8",
|
||||
"-D_EM_WSIZE=2",
|
||||
"-D_EM_PSIZE=2",
|
||||
"-D_EM_SSIZE=2",
|
||||
"-D_EM_LSIZE=4",
|
||||
"-D_EM_FSIZE=4",
|
||||
"-D_EM_DSIZE=8",
|
||||
"-D_EM_XSIZE=8",
|
||||
"-Dem22",
|
||||
"-D__em22",
|
||||
"-D__unix"}},
|
||||
/* compiler flags */
|
||||
#ifdef FCC
|
||||
{1, {
|
||||
"-Vw2.2i2.2p2.2f4.2s2.2l4.2d8.2x8.2"
|
||||
}}
|
||||
#else
|
||||
#ifdef FPC
|
||||
/* pc Flags */
|
||||
{1, {
|
||||
"-Vw2.2i2.2l4.2p2.2f8.2S2.2"
|
||||
}}
|
||||
#else
|
||||
#ifdef FM2
|
||||
/* pc Flags */
|
||||
{1, {
|
||||
"-Vw2.2i2.2l4.2p2.2f8.2S2.2"
|
||||
}}
|
||||
#endif
|
||||
#endif
|
||||
#endif
|
||||
},
|
||||
{
|
||||
"em24" /* arch */,
|
||||
"em24" /* platform */,
|
||||
"$H/lib/ack/em_ass" /* linker */,
|
||||
#ifdef FCC
|
||||
"c-ansi.m" /* startup file */,
|
||||
#else
|
||||
#ifdef FPC
|
||||
"pascal.m" /* startup file */,
|
||||
#ifdef FM2
|
||||
"modula2.m" /* startup file */,
|
||||
#endif
|
||||
#endif
|
||||
#endif
|
||||
NULL /* converter */,
|
||||
/** CPP Flags */
|
||||
{17,{
|
||||
"-DEM_WSIZE=2",
|
||||
"-DEM_PSIZE=4",
|
||||
"-DEM_SSIZE=2",
|
||||
"-DEM_LSIZE=4",
|
||||
"-DEM_FSIZE=4",
|
||||
"-DEM_DSIZE=8",
|
||||
"-DEM_XSIZE=8",
|
||||
"-D_EM_WSIZE=2",
|
||||
"-D_EM_PSIZE=4",
|
||||
"-D_EM_SSIZE=2",
|
||||
"-D_EM_LSIZE=4",
|
||||
"-D_EM_FSIZE=4",
|
||||
"-D_EM_DSIZE=8",
|
||||
"-D_EM_XSIZE=8",
|
||||
"-Dem24",
|
||||
"-D__em24",
|
||||
"-D__unix"}},
|
||||
/* compiler flags */
|
||||
#ifdef FCC
|
||||
{1, {
|
||||
"-Vw2.2i2.2p4.2f4.2s2.2l4.2d8.2x8.2"
|
||||
}}
|
||||
#else
|
||||
#ifdef FPC
|
||||
/* pc Flags */
|
||||
{1, {
|
||||
"-Vw2.2i2.2l4.2p4.2f8.2S2.2"
|
||||
}}
|
||||
#else
|
||||
#ifdef FM2
|
||||
/* pc Flags */
|
||||
{1, {
|
||||
"-Vw2.2i2.2l4.2p4.2f8.2S2.2"
|
||||
}}
|
||||
#endif
|
||||
#endif
|
||||
#endif
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
struct arglist CPP_FLAGS = {0,{NULL}};
|
||||
|
||||
|
||||
|
||||
struct arglist LD_HEAD =
|
||||
{ 2,
|
||||
|
@ -110,28 +236,6 @@ struct arglist LD_HEAD =
|
|||
#endif
|
||||
}};
|
||||
|
||||
struct arglist LD_TAIL =
|
||||
{
|
||||
#if defined(sun3) || defined(i386)
|
||||
5,
|
||||
#else
|
||||
4,
|
||||
#endif
|
||||
{
|
||||
#ifdef FCC
|
||||
"$H/lib/$S/tail_$A",
|
||||
#endif
|
||||
#ifdef FM2
|
||||
"$H/lib/$S/tail_m2",
|
||||
#endif
|
||||
#ifdef FPC
|
||||
"$H/lib/$S/tail_pc",
|
||||
#endif
|
||||
#if defined(sun3) || defined(i386)
|
||||
"$H/lib/$M/tail_fp",
|
||||
#endif
|
||||
"$H/lib/$M/tail_em", "$H/lib/$S/tail_mon",
|
||||
"$H/lib/$M/end_em" } };
|
||||
|
||||
struct arglist align =
|
||||
{ 5,
|
||||
|
@ -189,6 +293,7 @@ static int v_flag = 0;
|
|||
static int O_flag = 0;
|
||||
/* Only ANSI C is now supported. */
|
||||
static int ansi_c = 1;
|
||||
static int cv_flag = 0;
|
||||
|
||||
char *mkstr(char *, ...);
|
||||
static char *alloc(unsigned int);
|
||||
|
@ -346,49 +451,119 @@ int lang_opt(char *str)
|
|||
|
||||
char* stringdup(const char* s)
|
||||
{
|
||||
char *p;
|
||||
if (s == NULL)
|
||||
return NULL;
|
||||
char *p = alloc(strlen(s) + sizeof(char));
|
||||
p = alloc(strlen(s) + sizeof(char));
|
||||
strcpy(p, s);
|
||||
return p;
|
||||
}
|
||||
|
||||
char* getackhome(void)
|
||||
{
|
||||
char *value = stringdup(getenv("ACK_HOME"));
|
||||
char *value = getenv("ACK_HOME");
|
||||
if (value == NULL)
|
||||
{
|
||||
#ifndef EM_DIR
|
||||
panic("ACK_HOME must be set.");
|
||||
#else
|
||||
return stringdup(EM_DIR);
|
||||
return EM_DIR;
|
||||
#endif
|
||||
}
|
||||
return value;
|
||||
}
|
||||
|
||||
|
||||
#define LIB_PREFIX "lib"
|
||||
#define LIB_SUFFIX ".a"
|
||||
|
||||
/** From a library library directory list,
|
||||
* search for the libraries that exist, and return
|
||||
* the full path to the directory where the
|
||||
* library is located.
|
||||
*
|
||||
* The search starts from the first added directory
|
||||
* item at the command line.
|
||||
*
|
||||
* @param[in] dirs The directory list to search in.
|
||||
* @param[in] lib The library name to search for.
|
||||
* @returns The full path specification, allocated in the heap, it must
|
||||
* be freed by the caller.
|
||||
*/
|
||||
char* search_library_path(struct stringlist *dirs, char* lib)
|
||||
{
|
||||
char fname[FILENAME_MAX];
|
||||
FILE *fd;
|
||||
int len;
|
||||
int dirs_count;
|
||||
int index = stringlist_count(dirs)-1;
|
||||
|
||||
dirs_count = stringlist_count(dirs);
|
||||
for (index = 0; index < dirs_count; index++)
|
||||
{
|
||||
strcpy(fname, stringlist_get(dirs,index));
|
||||
len = strlen(fname);
|
||||
/* len-1 is the NULL character */
|
||||
if (fname[len-1] != '/')
|
||||
{
|
||||
/* Add trailing slash */
|
||||
fname[len] = '/';
|
||||
fname[len+1] = 0;
|
||||
len++;
|
||||
}
|
||||
fname[len] = 0;
|
||||
strcat(fname,lib);
|
||||
fd = fopen(fname,"rb");
|
||||
if (fd!=NULL)
|
||||
{
|
||||
/* Return the path! */
|
||||
fclose(fd);
|
||||
return stringdup(fname);
|
||||
}
|
||||
}
|
||||
return NULL;
|
||||
}
|
||||
|
||||
int main(int argc, char *argv[])
|
||||
{
|
||||
/* Contains the directories being searched for libraries */
|
||||
struct stringlist library_dirs;
|
||||
/* Contains the library lists */
|
||||
struct stringlist libraries;
|
||||
/* Contains the directory paths. */
|
||||
struct smap paths;
|
||||
/* Contains the src file list */
|
||||
struct stringlist srcfiles;
|
||||
char *str;
|
||||
char *startup_file;
|
||||
char **argvec;
|
||||
int count;
|
||||
int index;
|
||||
int libs_count;
|
||||
char *ext;
|
||||
FILE* fd;
|
||||
register struct arglist *call = &CALL_VEC;
|
||||
char tmpbuffer[256];
|
||||
char *file;
|
||||
char *ldfile;
|
||||
char *INCLUDE = NULL;
|
||||
int compile_cnt = 0;
|
||||
struct system_information* sys_info;
|
||||
|
||||
ackhome = getackhome();
|
||||
startup_file = NULL;
|
||||
sys_info = &machine_info[0];
|
||||
strcpy(tmpbuffer, LIB_PREFIX);
|
||||
stringlist_init(&library_dirs);
|
||||
stringlist_init(&libraries);
|
||||
stringlist_init(&srcfiles);
|
||||
smap_init(&paths);
|
||||
|
||||
ackhome = stringdup(getackhome());
|
||||
if (ackhome == NULL)
|
||||
{
|
||||
panic("ACK_HOME Environment variable is not set.");
|
||||
}
|
||||
tmpdir = sys_gettmpdir();
|
||||
tmpdir = stringdup(sys_gettmpdir());
|
||||
if (tmpdir == NULL)
|
||||
{
|
||||
panic("TMPDIR Environment variable is not set.");
|
||||
|
@ -402,17 +577,9 @@ int main(int argc, char *argv[])
|
|||
COMP = expand_string(comp_name());
|
||||
/* get c pre-processor to use */
|
||||
CPP = expand_string(CPP_NAME);
|
||||
/** get linker to use */
|
||||
LD = expand_string(sys_info->linker);
|
||||
|
||||
#ifdef vax4
|
||||
append(&CPP_FLAGS, "-D__vax");
|
||||
#endif
|
||||
#ifdef sun3
|
||||
append(&CPP_FLAGS, "-D__sun");
|
||||
#endif
|
||||
#ifdef m68020
|
||||
append(&CPP_FLAGS, "-D__mc68020");
|
||||
append(&CPP_FLAGS, "-D__mc68000");
|
||||
#endif
|
||||
|
||||
if (signal(SIGINT, SIG_IGN) != SIG_IGN)
|
||||
signal(SIGINT, trapcc);
|
||||
|
@ -422,7 +589,7 @@ int main(int argc, char *argv[])
|
|||
{
|
||||
if (*(str = *argv++) != '-')
|
||||
{
|
||||
append(&SRCFILES, str);
|
||||
stringlist_add(&srcfiles,stringdup(str));
|
||||
continue;
|
||||
}
|
||||
|
||||
|
@ -472,12 +639,26 @@ int main(int argc, char *argv[])
|
|||
if (str[2] == 'n')
|
||||
noexec = 1;
|
||||
break;
|
||||
case 'L':
|
||||
stringlist_add(&library_dirs,stringdup(str+2));
|
||||
break;
|
||||
case 'l': /* library file */
|
||||
append(&SRCFILES, str);
|
||||
stringlist_add(&srcfiles,stringdup(str));
|
||||
break;
|
||||
case 'M': /* use other compiler (for testing) */
|
||||
free(COMP);
|
||||
COMP = alloc(strlen(str)+2-1);
|
||||
strcpy(COMP, str + 2);
|
||||
break;
|
||||
case 'P': /* use other cpp (for testing) */
|
||||
free(CPP);
|
||||
CPP = alloc(strlen(str)+2-1);
|
||||
strcpy(CPP, str + 2);
|
||||
break;
|
||||
case 'X': /* use other linker (for testing) */
|
||||
LD = alloc(strlen(str)+2-1);
|
||||
strcpy(LD, str + 2);
|
||||
break;
|
||||
case 's': /* strip */
|
||||
if (str[2] == '\0')
|
||||
{
|
||||
|
@ -491,8 +672,48 @@ int main(int argc, char *argv[])
|
|||
}
|
||||
}
|
||||
|
||||
/* Add C preprocessor flags. */
|
||||
for (count = 0; count < sys_info->cpp_flags.al_argc; count++)
|
||||
{
|
||||
append(&CPP_FLAGS, sys_info->cpp_flags.al_argv[count]);
|
||||
}
|
||||
/* Add compiler flags. */
|
||||
for (count = 0; count < sys_info->compiler_flags.al_argc; count++)
|
||||
{
|
||||
append(&COMP_FLAGS, sys_info->compiler_flags.al_argv[count]);
|
||||
}
|
||||
|
||||
/* Now for each srcfile, if it starts with -l then replace it with the correct real
|
||||
* path immediately.
|
||||
*/
|
||||
count = stringlist_count(&srcfiles);
|
||||
for (index = 0; index < count; index++)
|
||||
{
|
||||
str = stringlist_get(&srcfiles,index);
|
||||
/* -l parameter */
|
||||
if (*str == '-')
|
||||
{
|
||||
/* Search for the directory where this library might be located. */
|
||||
strcpy(tmpbuffer,LIB_PREFIX);
|
||||
strcat(tmpbuffer,str+2);
|
||||
strcat(tmpbuffer,LIB_SUFFIX);
|
||||
str = search_library_path(&library_dirs,tmpbuffer);
|
||||
if (str != NULL)
|
||||
{
|
||||
stringlist_add(&srcfiles,str);
|
||||
append(&SRCFILES,str);
|
||||
}
|
||||
} else
|
||||
{
|
||||
append(&SRCFILES,str);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if (ecount)
|
||||
{
|
||||
exit(EXIT_FAILURE);
|
||||
}
|
||||
|
||||
count = SRCFILES.al_argc;
|
||||
argvec = &(SRCFILES.al_argv[0]);
|
||||
|
@ -519,12 +740,12 @@ int main(int argc, char *argv[])
|
|||
/* INCLUDE = expand_string(
|
||||
ansi_c ? "-I$H/include/tail_ac" : "-I$H/include/_tail_cc"); */
|
||||
INCLUDE = expand_string("-I$H/share/ack/include");
|
||||
append(&COMP_FLAGS, "-L");
|
||||
/* append(&COMP_FLAGS, "-L");*/
|
||||
#endif /* FCC */
|
||||
count = SRCFILES.al_argc;
|
||||
argvec = &(SRCFILES.al_argv[0]);
|
||||
|
||||
/* For each source file... */
|
||||
/* For argument file */
|
||||
while (count-- > 0)
|
||||
{
|
||||
register char *f;
|
||||
|
@ -532,7 +753,8 @@ int main(int argc, char *argv[])
|
|||
|
||||
ext = extension(file);
|
||||
|
||||
/* if not standard input and file is equal to the supported language suffix. */
|
||||
/* if not standard input and file is equal to the supported language suffix,
|
||||
* then compile it */
|
||||
if (file[0] != '-' && ext != file && (!strcmp(ext, lang_suffix())))
|
||||
{
|
||||
if (compile_cnt > 1)
|
||||
|
@ -610,7 +832,8 @@ int main(int argc, char *argv[])
|
|||
}
|
||||
cleanup(tmp_file);
|
||||
tmp_file[0] = '\0';
|
||||
}
|
||||
} /* endif compiling source file. */
|
||||
|
||||
|
||||
else if (file[0] != '-' && strcmp(ext, "o") && strcmp(ext, "a"))
|
||||
{
|
||||
|
@ -625,24 +848,48 @@ int main(int argc, char *argv[])
|
|||
append(&LDFILES, file);
|
||||
}
|
||||
|
||||
|
||||
/* See if we need to convert the flags. */
|
||||
cv_flag = sys_info->cv!=NULL;
|
||||
|
||||
/* *.s to a.out */
|
||||
if (RET_CODE == 0 && LDFILES.al_argc > 0)
|
||||
{
|
||||
init(call);
|
||||
// expand(&LD_HEAD);
|
||||
/* expand(&LD_HEAD);
|
||||
// cc = "cc.2g";
|
||||
// expand(&LD_TAIL);
|
||||
append(call, expand_string(LD_NAME));
|
||||
// concat(call, &align);
|
||||
expand(&LD_TAIL);*/
|
||||
append(call, LD);
|
||||
/* concat(call, &align);*/
|
||||
append(call, "-p");
|
||||
append(call, "-sx");
|
||||
append(call, "-o");
|
||||
|
||||
if (sys_tmpnam(tmp_file)==NULL)
|
||||
if (cv_flag)
|
||||
{
|
||||
panic("Cannot get temporary filename.");
|
||||
if (sys_tmpnam(tmp_file)==NULL)
|
||||
{
|
||||
panic("Cannot get temporary filename.");
|
||||
}
|
||||
append(call, tmp_file);
|
||||
} else
|
||||
{
|
||||
append(call, o_FILE);
|
||||
}
|
||||
/* concat(call, &LD_HEAD);
|
||||
concat(call, &LD_FLAGS);*/
|
||||
|
||||
if (sys_info->startup!=NULL)
|
||||
{
|
||||
startup_file = search_library_path(&library_dirs,sys_info->startup);
|
||||
if (startup_file!=NULL)
|
||||
{
|
||||
append(call,startup_file);
|
||||
} else
|
||||
{
|
||||
panic("Cannot find startup file.");
|
||||
}
|
||||
}
|
||||
append(call, tmp_file);
|
||||
// concat(call, &LD_HEAD);
|
||||
// concat(call, &LD_FLAGS);
|
||||
concat(call, &LDFILES);
|
||||
/* if (g_flag)
|
||||
append(call, expand_string("$H/lib/$M/tail_db"));
|
||||
|
@ -656,13 +903,35 @@ int main(int argc, char *argv[])
|
|||
cleanup(tmp_file);
|
||||
exit(RET_CODE);
|
||||
}
|
||||
/* init(call);
|
||||
append(call, expand_string(CV_NAME));
|
||||
append(call, tmp_file);
|
||||
append(call, o_FILE);
|
||||
runvec(call, (char *) 0);*/
|
||||
cleanup(tmp_file);
|
||||
|
||||
/* Check if we need to convert the file to
|
||||
* a standard executable file for the specific
|
||||
* target.
|
||||
*
|
||||
*/
|
||||
if (cv_flag)
|
||||
{
|
||||
init(call);
|
||||
append(call, expand_string(sys_info->cv));
|
||||
append(call, tmp_file);
|
||||
append(call, o_FILE);
|
||||
if (runvec(call, (char *) 0)==EXIT_FAILURE)
|
||||
{
|
||||
cleanup(tmp_file);
|
||||
exit(RET_CODE);
|
||||
}
|
||||
cleanup(tmp_file);
|
||||
}
|
||||
}
|
||||
if ((LDFILES.al_argc == 0) && (SRCFILES.al_argc==0))
|
||||
{
|
||||
panic("No input source files or input object files specified.");
|
||||
}
|
||||
stringlist_free(&library_dirs,1);
|
||||
stringlist_free(&libraries,1);
|
||||
if (startup_file!=NULL)
|
||||
free(startup_file);
|
||||
smap_free(&paths,1,1);
|
||||
exit(RET_CODE);
|
||||
}
|
||||
|
||||
|
@ -735,6 +1004,7 @@ static char * expand_string(char *s)
|
|||
if (!expanded)
|
||||
return s;
|
||||
*q++ = '\0';
|
||||
/* Do not forget the missing null character. */
|
||||
p = alloc((unsigned int) (q - buf));
|
||||
return strcpy(p, buf);
|
||||
}
|
||||
|
@ -799,7 +1069,7 @@ char *mkstr(char *dst, ...)
|
|||
return dst;
|
||||
}
|
||||
|
||||
static char * extension(char *fn)
|
||||
static char *extension(char *fn)
|
||||
{
|
||||
register char *c = fn;
|
||||
|
||||
|
@ -858,12 +1128,17 @@ static int runvec(struct arglist *vec, char *outp)
|
|||
}
|
||||
if(outp != NULL)
|
||||
{
|
||||
redirect = alloc(strlen(outp)+sizeof(char)*2);
|
||||
/* Don't forget the null character. */
|
||||
redirect = alloc(strlen(outp)+sizeof(char)*3);
|
||||
strcpy(redirect,"1>");
|
||||
strcat(redirect,outp);
|
||||
append(vec,redirect);
|
||||
}
|
||||
p = arg2str(vec);
|
||||
if ((v_flag) && (p != NULL))
|
||||
{
|
||||
fprintf(stdout,"Executing : %s\n",p);
|
||||
}
|
||||
|
||||
status = system(p);
|
||||
free(p);
|
||||
|
|
|
@ -7,6 +7,7 @@
|
|||
-- is = { set of rule types which made the target }
|
||||
-- }
|
||||
|
||||
local posix = require("posix")
|
||||
local emitter = {}
|
||||
local rules = {}
|
||||
local targets = {}
|
||||
|
@ -544,7 +545,7 @@ local function definerule(rulename, types, cb)
|
|||
|
||||
local args = {}
|
||||
for propname, typespec in pairs(types) do
|
||||
if not e[propname] then
|
||||
if e[propname] == nil then
|
||||
if not typespec.optional and (typespec.default == nil) then
|
||||
error(string.format("missing mandatory property '%s'", propname))
|
||||
end
|
||||
|
|
34
h/arch.h
34
h/arch.h
|
@ -9,9 +9,12 @@
|
|||
|
||||
#define ARMAG 0177545
|
||||
#define AALMAG 0177454
|
||||
#define AR_NAME_MAX 14
|
||||
|
||||
struct ar_hdr {
|
||||
char ar_name[14];
|
||||
/** null terminated filename. */
|
||||
char ar_name[AR_NAME_MAX];
|
||||
/** last modification time, defined as seconds since epoch. */
|
||||
long ar_date;
|
||||
char ar_uid;
|
||||
char ar_gid;
|
||||
|
@ -22,4 +25,33 @@ struct ar_hdr {
|
|||
#define AR_TOTAL 26
|
||||
#define AR_SIZE 22
|
||||
|
||||
|
||||
/** ar_mode Read permission bit for the owner of the file. */
|
||||
#define AR_IRUSR 0400
|
||||
/** ar_mode Write permission bit for the owner of the file. */
|
||||
#define AR_IWUSR 0200
|
||||
/** ar_mode Execute (for ordinary files) or search (for directories)
|
||||
* permission bit for the owner of the file.
|
||||
*/
|
||||
#define AR_IXUSR 0100
|
||||
/** ar_mode Read permission bit for the group owner of the file. */
|
||||
#define AR_IRGRP 040
|
||||
/** ar_mode Write permission bit for the group owner of the file. */
|
||||
#define AR_IWGRP 020
|
||||
/** ar_mode Execute or search permission bit for the group owner of the file. */
|
||||
#define AR_IXGRP 010
|
||||
/** ar_mode Read permission bit for other users. */
|
||||
#define AR_IROTH 04
|
||||
/** ar_mode Write permission for other users. */
|
||||
#define AR_IWOTH 02
|
||||
/** ar_mode Execute or search permission bit for other users. */
|
||||
#define AR_IXOTH 01
|
||||
|
||||
/* This is the set-user-ID on execute bit. */
|
||||
#define AR_ISUID 04000
|
||||
/* This is the set-group-ID on execute bit. */
|
||||
#define AR_ISGID 02000
|
||||
|
||||
|
||||
|
||||
#endif /* __ARCH_H_INCLUDED */
|
||||
|
|
|
@ -4,147 +4,147 @@
|
|||
*/
|
||||
|
||||
|
||||
#ifndef NORCSID
|
||||
static char rcs_lex[] = "$Id$" ;
|
||||
#endif
|
||||
|
||||
|
||||
/* This file contains the new lexical analizer */
|
||||
typedef struct {
|
||||
char *name;
|
||||
int token, classvalue,length;
|
||||
int token;
|
||||
int classvalue;
|
||||
int length;
|
||||
} Key;
|
||||
|
||||
Key keywords [] ={
|
||||
"abs", FUNCTION, ABSSYM, 0,
|
||||
"and", ANDSYM, ANDSYM, 0,
|
||||
"asc", FUNCTION, ASCSYM, 0,
|
||||
"as", ASSYM, 0, 0,
|
||||
"atn", FUNCTION, ATNSYM, 0,
|
||||
"auto", ILLEGAL, 0, 0,
|
||||
"base", BASESYM, 0, 0,
|
||||
"call", CALLSYM, 0, 0,
|
||||
"cdbl", FUNCTION, CDBLSYM, 0,
|
||||
"chain", ILLEGAL, 0, 0,
|
||||
"chr", FUNCTION, CHRSYM, 0,
|
||||
"cint", FUNCTION, CINTSYM, 0,
|
||||
"clear", CLEARSYM, 0, 0,
|
||||
"cload", ILLEGAL, 0, 0,
|
||||
"close", CLOSESYM, 0, 0,
|
||||
"common", ILLEGAL, 0, 0,
|
||||
"cont", ILLEGAL, 0, 0,
|
||||
"cos", FUNCTION, COSSYM, 0,
|
||||
"csng", FUNCTION, CSNGSYM, 0,
|
||||
"csave", ILLEGAL, 0, 0,
|
||||
"cvi", FUNCTION, CVISYM, 0,
|
||||
"cvs", FUNCTION, CVSSYM, 0,
|
||||
"cvd", FUNCTION, CVDSYM, 0,
|
||||
"data", DATASYM, 0, 0,
|
||||
"defint", DEFINTSYM, 0, 0,
|
||||
"defsng", DEFSNGSYM, 0, 0,
|
||||
"defdbl", DEFDBLSYM, 0, 0,
|
||||
"defstr", DEFSTRSYM, 0, 0,
|
||||
"def", DEFSYM, 0, 0,
|
||||
"delete", ILLEGAL, 0, 0,
|
||||
"dim", DIMSYM, 0, 0,
|
||||
"edit", ILLEGAL, 0, 0,
|
||||
"else", ELSESYM, 0, 0,
|
||||
"end", ENDSYM, 0, 0,
|
||||
"eof", FUNCTION, EOFSYM, 0,
|
||||
"eqv", EQVSYM, EQVSYM, 0,
|
||||
"erase", ILLEGAL, 0, 0,
|
||||
"error", ERRORSYM, 0, 0,
|
||||
"err", ERRSYM, 0, 0,
|
||||
"erl", ERLSYM, 0, 0,
|
||||
"exp", FUNCTION, EXPSYM, 0,
|
||||
"field", FIELDSYM, 0, 0,
|
||||
"fix", FUNCTION, FIXSYM, 0,
|
||||
"for", FORSYM, 0, 0,
|
||||
"fre", FUNCTION, FRESYM, 0,
|
||||
"get", GETSYM, 0, 0,
|
||||
"gosub", GOSUBSYM, 0, 0,
|
||||
"goto", GOTOSYM, 0, 0,
|
||||
"hex", FUNCTION, HEXSYM, 0,
|
||||
"if", IFSYM, 0, 0,
|
||||
"imp", IMPSYM, IMPSYM, 0,
|
||||
"inkey", INKEYSYM, 0, 0,
|
||||
"input", INPUTSYM, 0, 0,
|
||||
"inp", FUNCTION, INPSYM, 0,
|
||||
"instr", FUNCTION, INSTRSYM, 0,
|
||||
"int", FUNCTION, INTSYM, 0,
|
||||
"kill", ILLEGAL, 0, 0,
|
||||
"left", FUNCTION, LEFTSYM, 0,
|
||||
"len", FUNCTION, LENSYM, 0,
|
||||
"let", LETSYM, 0, 0,
|
||||
"line", LINESYM, 0, 0,
|
||||
"list", LISTSYM, 0, 0,
|
||||
"llist", ILLEGAL, 0, 0,
|
||||
"load", LOADSYM, 0, 0,
|
||||
"loc", FUNCTION, LOCSYM, 0,
|
||||
"log", FUNCTION, LOGSYM, 0,
|
||||
"lpos", FUNCTION, LPOSSYM, 0,
|
||||
"lprint", ILLEGAL, 0, 0,
|
||||
"lset", LSETSYM, 0, 0,
|
||||
"merge", MERGESYM, 0, 0,
|
||||
"mid", MIDSYM, 0, 0,
|
||||
"mki", FUNCTION, MKISYM, 0,
|
||||
"mks", FUNCTION, MKSSYM, 0,
|
||||
"mkd", FUNCTION, MKDSYM, 0,
|
||||
"mod", MODSYM, 0, 0,
|
||||
"name", ILLEGAL, 0, 0,
|
||||
"new", ILLEGAL, 0, 0,
|
||||
"next", NEXTSYM, 0, 0,
|
||||
"not", NOTSYM, 0, 0,
|
||||
"null", ILLEGAL, 0, 0,
|
||||
"on", ONSYM, 0, 0,
|
||||
"oct", FUNCTION, OCTSYM, 0,
|
||||
"open", OPENSYM, 0, 0,
|
||||
"option", OPTIONSYM, 0, 0,
|
||||
"or", ORSYM, ORSYM, 0,
|
||||
"out", FUNCTION, OUTSYM, 0,
|
||||
"peek", PEEKSYM, 0, 0,
|
||||
"poke", POKESYM, 0, 0,
|
||||
"print", PRINTSYM, 0, 0,
|
||||
"pos", FUNCTION, POSSYM, 0,
|
||||
"put", PUTSYM, 0, 0,
|
||||
"randomize", RANDOMIZESYM, 0, 0,
|
||||
"read", READSYM, 0, 0,
|
||||
"rem", REMSYM, 0, 0,
|
||||
"renum", ILLEGAL, 0, 0,
|
||||
"ren", ILLEGAL, 0, 0,
|
||||
"restore", RESTORESYM, 0, 0,
|
||||
"resume", ILLEGAL, 0, 0,
|
||||
"return", RETURNSYM, 0, 0,
|
||||
"right", FUNCTION, RIGHTSYM, 0,
|
||||
"rnd", FUNCTION, RNDSYM, 0,
|
||||
"run", ILLEGAL, 0, 0,
|
||||
"save", ILLEGAL, 0, 0,
|
||||
"step", STEPSYM, 0, 0,
|
||||
"sgn", FUNCTION, SGNSYM, 0,
|
||||
"sin", FUNCTION, SINSYM, 0,
|
||||
"space", FUNCTION, SPACESYM, 0,
|
||||
"spc", FUNCTION, SPCSYM, 0,
|
||||
"sqr", FUNCTION, SQRSYM, 0,
|
||||
"stop", STOPSYM, 0, 0,
|
||||
"string", FUNCTION, STRINGSYM, 0,
|
||||
"str", FUNCTION, STRSYM, 0,
|
||||
"swap", SWAPSYM, 0, 0,
|
||||
"tab", FUNCTION, TABSYM, 0,
|
||||
"tan", FUNCTION, TANSYM, 0,
|
||||
"then", THENSYM, 0, 0,
|
||||
"to", TOSYM, 0, 0,
|
||||
"tron", TRONOFFSYM, TRONSYM, 0,
|
||||
"troff", TRONOFFSYM, TROFFSYM, 0,
|
||||
"using", USINGSYM, 0, 0,
|
||||
"usr", FUNCTION, USRSYM, 0,
|
||||
"val", FUNCTION, VALSYM, 0,
|
||||
"varptr", FUNCTION, VARPTRSYM, 0,
|
||||
"wait", ILLEGAL, 0, 0,
|
||||
"while", WHILESYM, 0, 0,
|
||||
"wend", WENDSYM, 0, 0,
|
||||
"width", ILLEGAL, 0, 0,
|
||||
"write", WRITESYM, 0, 0,
|
||||
"xor", XORSYM, XORSYM, 0,
|
||||
0, 0, 0, 0
|
||||
{"abs", FUNCTION, ABSSYM, 0},
|
||||
{"and", ANDSYM, ANDSYM, 0},
|
||||
{"asc", FUNCTION, ASCSYM, 0},
|
||||
{"as", ASSYM, 0, 0},
|
||||
{"atn", FUNCTION, ATNSYM, 0},
|
||||
{"auto", ILLEGAL, 0, 0},
|
||||
{"base", BASESYM, 0, 0},
|
||||
{"call", CALLSYM, 0, 0},
|
||||
{"cdbl", FUNCTION, CDBLSYM, 0},
|
||||
{"chain", ILLEGAL, 0, 0},
|
||||
{"chr", FUNCTION, CHRSYM, 0},
|
||||
{"cint", FUNCTION, CINTSYM, 0},
|
||||
{"clear", CLEARSYM, 0, 0},
|
||||
{"cload", ILLEGAL, 0, 0},
|
||||
{"close", CLOSESYM, 0, 0},
|
||||
{"common", ILLEGAL, 0, 0},
|
||||
{"cont", ILLEGAL, 0, 0},
|
||||
{"cos", FUNCTION, COSSYM, 0},
|
||||
{"csng", FUNCTION, CSNGSYM, 0},
|
||||
{"csave", ILLEGAL, 0, 0},
|
||||
{"cvi", FUNCTION, CVISYM, 0},
|
||||
{"cvs", FUNCTION, CVSSYM, 0},
|
||||
{"cvd", FUNCTION, CVDSYM, 0},
|
||||
{"data", DATASYM, 0, 0},
|
||||
{"defint", DEFINTSYM, 0, 0},
|
||||
{"defsng", DEFSNGSYM, 0, 0},
|
||||
{"defdbl", DEFDBLSYM, 0, 0},
|
||||
{"defstr", DEFSTRSYM, 0, 0},
|
||||
{"def", DEFSYM, 0, 0},
|
||||
{"delete", ILLEGAL, 0, 0},
|
||||
{"dim", DIMSYM, 0, 0},
|
||||
{"edit", ILLEGAL, 0, 0},
|
||||
{"else", ELSESYM, 0, 0},
|
||||
{"end", ENDSYM, 0, 0},
|
||||
{"eof", FUNCTION, EOFSYM, 0},
|
||||
{"eqv", EQVSYM, EQVSYM, 0},
|
||||
{"erase", ILLEGAL, 0, 0},
|
||||
{"error", ERRORSYM, 0, 0},
|
||||
{"err", ERRSYM, 0, 0},
|
||||
{"erl", ERLSYM, 0, 0},
|
||||
{"exp", FUNCTION, EXPSYM, 0},
|
||||
{"field", FIELDSYM, 0, 0},
|
||||
{"fix", FUNCTION, FIXSYM, 0},
|
||||
{"for", FORSYM, 0, 0},
|
||||
{"fre", FUNCTION, FRESYM, 0},
|
||||
{"get", GETSYM, 0, 0},
|
||||
{"gosub", GOSUBSYM, 0, 0},
|
||||
{"goto", GOTOSYM, 0, 0},
|
||||
{"hex", FUNCTION, HEXSYM, 0},
|
||||
{"if", IFSYM, 0, 0},
|
||||
{"imp", IMPSYM, IMPSYM, 0},
|
||||
{"inkey", INKEYSYM, 0, 0},
|
||||
{"input", INPUTSYM, 0, 0},
|
||||
{"inp", FUNCTION, INPSYM, 0},
|
||||
{"instr", FUNCTION, INSTRSYM, 0},
|
||||
{"int", FUNCTION, INTSYM, 0},
|
||||
{"kill", ILLEGAL, 0, 0},
|
||||
{"left", FUNCTION, LEFTSYM, 0},
|
||||
{"len", FUNCTION, LENSYM, 0},
|
||||
{"let", LETSYM, 0, 0},
|
||||
{"line", LINESYM, 0, 0},
|
||||
{"list", LISTSYM, 0, 0},
|
||||
{"llist", ILLEGAL, 0, 0},
|
||||
{"load", LOADSYM, 0, 0},
|
||||
{"loc", FUNCTION, LOCSYM, 0},
|
||||
{"log", FUNCTION, LOGSYM, 0},
|
||||
{"lpos", FUNCTION, LPOSSYM, 0},
|
||||
{"lprint", ILLEGAL, 0, 0},
|
||||
{"lset", LSETSYM, 0, 0},
|
||||
{"merge", MERGESYM, 0, 0},
|
||||
{"mid", MIDSYM, 0, 0},
|
||||
{"mki", FUNCTION, MKISYM, 0},
|
||||
{"mks", FUNCTION, MKSSYM, 0},
|
||||
{"mkd", FUNCTION, MKDSYM, 0},
|
||||
{"mod", MODSYM, 0, 0},
|
||||
{"name", ILLEGAL, 0, 0},
|
||||
{"new", ILLEGAL, 0, 0},
|
||||
{"next", NEXTSYM, 0, 0},
|
||||
{"not", NOTSYM, 0, 0},
|
||||
{"null", ILLEGAL, 0, 0},
|
||||
{"on", ONSYM, 0, 0},
|
||||
{"oct", FUNCTION, OCTSYM, 0},
|
||||
{"open", OPENSYM, 0, 0},
|
||||
{"option", OPTIONSYM, 0, 0},
|
||||
{"or", ORSYM, ORSYM, 0},
|
||||
{"out", FUNCTION, OUTSYM, 0},
|
||||
{"peek", PEEKSYM, 0, 0},
|
||||
{"poke", POKESYM, 0, 0},
|
||||
{"print", PRINTSYM, 0, 0},
|
||||
{"pos", FUNCTION, POSSYM, 0},
|
||||
{"put", PUTSYM, 0, 0},
|
||||
{"randomize", RANDOMIZESYM, 0, 0},
|
||||
{"read", READSYM, 0, 0},
|
||||
{"rem", REMSYM, 0, 0},
|
||||
{"renum", ILLEGAL, 0, 0},
|
||||
{"ren", ILLEGAL, 0, 0},
|
||||
{"restore", RESTORESYM, 0, 0},
|
||||
{"resume", ILLEGAL, 0, 0},
|
||||
{"return", RETURNSYM, 0, 0},
|
||||
{"right", FUNCTION, RIGHTSYM, 0},
|
||||
{"rnd", FUNCTION, RNDSYM, 0},
|
||||
{"run", ILLEGAL, 0, 0},
|
||||
{"save", ILLEGAL, 0, 0},
|
||||
{"step", STEPSYM, 0, 0},
|
||||
{"sgn", FUNCTION, SGNSYM, 0},
|
||||
{"sin", FUNCTION, SINSYM, 0},
|
||||
{"space", FUNCTION, SPACESYM, 0},
|
||||
{"spc", FUNCTION, SPCSYM, 0},
|
||||
{"sqr", FUNCTION, SQRSYM, 0},
|
||||
{"stop", STOPSYM, 0, 0},
|
||||
{"string", FUNCTION, STRINGSYM, 0},
|
||||
{"str", FUNCTION, STRSYM, 0},
|
||||
{"swap", SWAPSYM, 0, 0},
|
||||
{"tab", FUNCTION, TABSYM, 0},
|
||||
{"tan", FUNCTION, TANSYM, 0},
|
||||
{"then", THENSYM, 0, 0},
|
||||
{"to", TOSYM, 0, 0},
|
||||
{"tron", TRONOFFSYM, TRONSYM, 0},
|
||||
{"troff", TRONOFFSYM, TROFFSYM, 0},
|
||||
{"using", USINGSYM, 0, 0},
|
||||
{"usr", FUNCTION, USRSYM, 0},
|
||||
{"val", FUNCTION, VALSYM, 0},
|
||||
{"varptr", FUNCTION, VARPTRSYM, 0},
|
||||
{"wait", ILLEGAL, 0, 0},
|
||||
{"while", WHILESYM, 0, 0},
|
||||
{"wend", WENDSYM, 0, 0},
|
||||
{"width", ILLEGAL, 0, 0},
|
||||
{"write", WRITESYM, 0, 0},
|
||||
{"xor", XORSYM, XORSYM, 0},
|
||||
{0, 0, 0, 0}
|
||||
};
|
||||
|
||||
/* Keyword index table */
|
||||
|
|
|
@ -13,11 +13,6 @@
|
|||
#include "util.h"
|
||||
|
||||
|
||||
|
||||
#ifndef NORCSID
|
||||
static char rcs_id[] = "$Id$" ;
|
||||
#endif
|
||||
|
||||
/* Symboltable management module */
|
||||
|
||||
int deftype[128]; /* default type declarer */
|
||||
|
@ -32,8 +27,8 @@ void initdeftype(void)
|
|||
{
|
||||
int i;
|
||||
|
||||
for(i='a';i<='z';i++) deftype[i]= DOUBLETYPE;
|
||||
for(i='A';i<='Z';i++) deftype[i]= DOUBLETYPE;
|
||||
for(i='a';i<='z';i++) deftype[(unsigned char)i]= DOUBLETYPE;
|
||||
for(i='A';i<='Z';i++) deftype[(unsigned char)i]= DOUBLETYPE;
|
||||
}
|
||||
|
||||
|
||||
|
@ -223,9 +218,9 @@ void setdefaulttype(int type)
|
|||
last= *cptr;
|
||||
if ( !isalpha(last))
|
||||
error("letter expected");
|
||||
else for(i=first;i<=last;i++) deftype[i]= type;
|
||||
else for(i=first;i<=last;i++) deftype[(unsigned char)i]= type;
|
||||
cptr++;
|
||||
} else deftype[first]=type;
|
||||
} else deftype[(unsigned char)first]=type;
|
||||
if ( *cptr== ',')
|
||||
{
|
||||
cptr++;
|
||||
|
|
|
@ -70,7 +70,7 @@ get rid of the compiler-predefined macro \fIname\fR.
|
|||
.br
|
||||
set the size and alignment requirements.
|
||||
The letter \fIc\fR indicates the simple type, which is one of
|
||||
\fBs\fR(short), \fBi\fR(int), \fBl\fR(long), \fBf\fR(float), \fBd\fR(double),
|
||||
\fBs\fR(short), \fBw\fR(word), \fBi\fR(int), \fBl\fR(long), \fBf\fR(float), \fBd\fR(double),
|
||||
\fBx\fR(long double) or
|
||||
\fBp\fR(pointer).
|
||||
The \fIm\fR parameter can be used to specify the length of the type (in bytes)
|
||||
|
|
|
@ -36,7 +36,7 @@ extern char *getwdir();
|
|||
|
||||
t_token dot,
|
||||
aside;
|
||||
t_type *toktype;
|
||||
struct type *toktype;
|
||||
int idfsize = IDFSIZE;
|
||||
int ForeignFlag;
|
||||
#ifdef DEBUG
|
||||
|
@ -347,7 +347,7 @@ again:
|
|||
case STIDF:
|
||||
{
|
||||
register char *tag = &buf[0];
|
||||
register t_idf *id;
|
||||
register struct idf *id;
|
||||
|
||||
do {
|
||||
if (tag - buf < idfsize) *tag++ = ch;
|
||||
|
|
|
@ -42,7 +42,7 @@ struct switch_hdr {
|
|||
label sh_break; /* label of statement after this one */
|
||||
label sh_default; /* label of ELSE part, or 0 */
|
||||
int sh_nrofentries; /* number of cases */
|
||||
t_type *sh_type; /* type of case expression */
|
||||
struct type *sh_type; /* type of case expression */
|
||||
arith sh_lowerbd; /* lowest case label */
|
||||
arith sh_upperbd; /* highest case label */
|
||||
struct case_entry *sh_entries; /* the cases with their generated
|
||||
|
@ -84,7 +84,7 @@ static int compact(int nr, arith low, arith up)
|
|||
}
|
||||
#define nd_lab nd_symb
|
||||
|
||||
static void AddOneCase(struct switch_hdr *sh, t_node *lnode, t_node *rnode, label lbl)
|
||||
static void AddOneCase(struct switch_hdr *sh, struct node *lnode, struct node *rnode, label lbl)
|
||||
{
|
||||
register struct case_entry *ce = new_case_entry();
|
||||
register struct case_entry *c1 = sh->sh_entries, *c2 = 0;
|
||||
|
@ -201,7 +201,7 @@ node_error(rnode, "multiple case entry for value %ld", (long)(ce->ce_up));
|
|||
}
|
||||
|
||||
|
||||
static void AddCases(struct switch_hdr *sh, register t_node *node, label lbl)
|
||||
static void AddCases(struct switch_hdr *sh, register struct node *node, label lbl)
|
||||
{
|
||||
/* Add case labels to the case label list
|
||||
*/
|
||||
|
@ -243,7 +243,7 @@ static void FreeSh(struct switch_hdr *sh)
|
|||
free_switch_hdr(sh);
|
||||
}
|
||||
|
||||
int CaseCode(t_node *nd, label exitlabel, int end_reached)
|
||||
int CaseCode(struct node *nd, label exitlabel, int end_reached)
|
||||
{
|
||||
/* Check the expression, stack a new case header and
|
||||
fill in the necessary fields.
|
||||
|
@ -251,7 +251,7 @@ int CaseCode(t_node *nd, label exitlabel, int end_reached)
|
|||
LOOP-statement, or 0.
|
||||
*/
|
||||
register struct switch_hdr *sh = new_switch_hdr();
|
||||
register t_node *pnode = nd;
|
||||
register struct node *pnode = nd;
|
||||
register struct case_entry *ce;
|
||||
register arith val;
|
||||
label CaseDescrLab;
|
||||
|
|
|
@ -26,8 +26,8 @@
|
|||
|
||||
#include "Lpars.h"
|
||||
#include "idf.h"
|
||||
#include "type.h"
|
||||
#include "LLlex.h"
|
||||
#include "type.h"
|
||||
#include "def.h"
|
||||
#include "node.h"
|
||||
#include "scope.h"
|
||||
|
@ -45,16 +45,16 @@
|
|||
extern char *symbol2str();
|
||||
|
||||
/* Forward file declarations */
|
||||
static int ChkStandard(t_node **);
|
||||
static int ChkCast(t_node **);
|
||||
static int ChkStandard(struct node **);
|
||||
static int ChkCast(struct node **);
|
||||
|
||||
|
||||
|
||||
|
||||
static void df_error(
|
||||
t_node *nd, /* node on which error occurred */
|
||||
struct node *nd, /* node on which error occurred */
|
||||
char *mess, /* error message */
|
||||
register t_def *edf) /* do we have a name? */
|
||||
register struct def *edf) /* do we have a name? */
|
||||
{
|
||||
if (edf) {
|
||||
if (edf->df_kind != D_ERROR) {
|
||||
|
@ -64,7 +64,7 @@ static void df_error(
|
|||
else node_error(nd, mess);
|
||||
}
|
||||
|
||||
void MkCoercion(t_node **pnd, register t_type *tp)
|
||||
void MkCoercion(struct node **pnd, register struct type *tp)
|
||||
{
|
||||
/* Make a coercion from the node indicated by *pnd to the
|
||||
type indicated by tp. If the node indicated by *pnd
|
||||
|
@ -74,8 +74,8 @@ void MkCoercion(t_node **pnd, register t_type *tp)
|
|||
- we are in the second pass and the coercion might cause
|
||||
an error
|
||||
*/
|
||||
register t_node *nd = *pnd;
|
||||
register t_type *nd_tp = nd->nd_type;
|
||||
register struct node *nd = *pnd;
|
||||
register struct type *nd_tp = nd->nd_type;
|
||||
extern int pass_1;
|
||||
char *wmess = 0;
|
||||
arith op;
|
||||
|
@ -170,12 +170,12 @@ void MkCoercion(t_node **pnd, register t_type *tp)
|
|||
*pnd = nd;
|
||||
}
|
||||
|
||||
int ChkVariable(register t_node **expp, int flags)
|
||||
int ChkVariable(register struct node **expp, int flags)
|
||||
{
|
||||
/* Check that "expp" indicates an item that can be
|
||||
assigned to.
|
||||
*/
|
||||
register t_node *exp;
|
||||
register struct node *exp;
|
||||
|
||||
if (! ChkDesig(expp, flags)) return 0;
|
||||
|
||||
|
@ -188,13 +188,13 @@ int ChkVariable(register t_node **expp, int flags)
|
|||
return 1;
|
||||
}
|
||||
|
||||
static int ChkArrow(t_node **expp, int flags)
|
||||
static int ChkArrow(struct node **expp, int flags)
|
||||
{
|
||||
/* Check an application of the '^' operator.
|
||||
The operand must be a variable of a pointer type.
|
||||
*/
|
||||
register t_type *tp;
|
||||
register t_node *exp = *expp;
|
||||
register struct type *tp;
|
||||
register struct node *exp = *expp;
|
||||
|
||||
assert(exp->nd_class == Arrow);
|
||||
assert(exp->nd_symb == '^');
|
||||
|
@ -215,7 +215,7 @@ static int ChkArrow(t_node **expp, int flags)
|
|||
return 1;
|
||||
}
|
||||
|
||||
static int ChkArr(t_node **expp, int flags)
|
||||
static int ChkArr(struct node **expp, int flags)
|
||||
{
|
||||
/* Check an array selection.
|
||||
The left hand side must be a variable of an array type,
|
||||
|
@ -223,8 +223,8 @@ static int ChkArr(t_node **expp, int flags)
|
|||
assignment compatible with the array-index.
|
||||
*/
|
||||
|
||||
register t_type *tpl;
|
||||
register t_node *exp = *expp;
|
||||
register struct type *tpl;
|
||||
register struct node *exp = *expp;
|
||||
|
||||
assert(exp->nd_class == Arrsel);
|
||||
assert(exp->nd_symb == '[' || exp->nd_symb == ',');
|
||||
|
@ -257,7 +257,7 @@ static int ChkArr(t_node **expp, int flags)
|
|||
}
|
||||
|
||||
/*ARGSUSED*/
|
||||
static int ChkValue(t_node **expp, int flags)
|
||||
static int ChkValue(struct node **expp, int flags)
|
||||
{
|
||||
#ifdef DEBUG
|
||||
switch((*expp)->nd_symb) {
|
||||
|
@ -273,13 +273,13 @@ static int ChkValue(t_node **expp, int flags)
|
|||
return 1;
|
||||
}
|
||||
|
||||
static int ChkSelOrName(t_node **expp, int flags)
|
||||
static int ChkSelOrName(struct node **expp, int flags)
|
||||
{
|
||||
/* Check either an ID or a construction of the form
|
||||
ID.ID [ .ID ]*
|
||||
*/
|
||||
register t_def *df;
|
||||
register t_node *exp = *expp;
|
||||
register struct def *df;
|
||||
register struct node *exp = *expp;
|
||||
|
||||
exp->nd_type = error_type;
|
||||
|
||||
|
@ -296,7 +296,7 @@ static int ChkSelOrName(t_node **expp, int flags)
|
|||
/* A selection from a record or a module.
|
||||
Modules also have a record type.
|
||||
*/
|
||||
register t_node *left;
|
||||
register struct node *left;
|
||||
|
||||
assert(exp->nd_symb == '.');
|
||||
|
||||
|
@ -346,13 +346,13 @@ static int ChkSelOrName(t_node **expp, int flags)
|
|||
return exp->nd_def->df_kind != D_ERROR;
|
||||
}
|
||||
|
||||
static int ChkExSelOrName(t_node **expp, int flags)
|
||||
static int ChkExSelOrName(struct node **expp, int flags)
|
||||
{
|
||||
/* Check either an ID or an ID.ID [.ID]* occurring in an
|
||||
expression.
|
||||
*/
|
||||
register t_def *df;
|
||||
register t_node *exp;
|
||||
register struct def *df;
|
||||
register struct node *exp;
|
||||
|
||||
if (! ChkSelOrName(expp, D_USED)) return 0;
|
||||
|
||||
|
@ -418,20 +418,20 @@ static int ChkExSelOrName(t_node **expp, int flags)
|
|||
return 1;
|
||||
}
|
||||
|
||||
static int ChkEl(register t_node **expp, t_type *tp)
|
||||
static int ChkEl(register struct node **expp, struct type *tp)
|
||||
{
|
||||
|
||||
return ChkExpression(expp) && ChkCompat(expp, tp, "set element");
|
||||
}
|
||||
|
||||
static int ChkElement(t_node **expp, t_type *tp, arith *set)
|
||||
static int ChkElement(struct node **expp, struct type *tp, arith *set)
|
||||
{
|
||||
/* Check elements of a set. This routine may call itself
|
||||
recursively.
|
||||
Also try to compute the set!
|
||||
*/
|
||||
register t_node *expr = *expp;
|
||||
t_type *el_type = ElementType(tp);
|
||||
register struct node *expr = *expp;
|
||||
struct type *el_type = ElementType(tp);
|
||||
register unsigned int i;
|
||||
arith low, high;
|
||||
|
||||
|
@ -504,15 +504,15 @@ void FreeSet(register arith *s)
|
|||
}
|
||||
}
|
||||
|
||||
static int ChkSet(t_node **expp, int flags)
|
||||
static int ChkSet(struct node **expp, int flags)
|
||||
{
|
||||
/* Check the legality of a SET aggregate, and try to evaluate it
|
||||
compile time. Unfortunately this is all rather complicated.
|
||||
*/
|
||||
register t_type *tp;
|
||||
register t_node *exp = *expp;
|
||||
register t_node *nd;
|
||||
register t_def *df;
|
||||
register struct type *tp;
|
||||
register struct node *exp = *expp;
|
||||
register struct node *nd;
|
||||
register struct def *df;
|
||||
int retval = 1;
|
||||
int SetIsConstant = 1;
|
||||
|
||||
|
@ -570,9 +570,9 @@ static int ChkSet(t_node **expp, int flags)
|
|||
return retval;
|
||||
}
|
||||
|
||||
static t_node *nextarg(t_node **argp, t_def *edf)
|
||||
static struct node *nextarg(struct node **argp, struct def *edf)
|
||||
{
|
||||
register t_node *arg = (*argp)->nd_RIGHT;
|
||||
register struct node *arg = (*argp)->nd_RIGHT;
|
||||
|
||||
if (! arg) {
|
||||
df_error(*argp, "too few arguments supplied", edf);
|
||||
|
@ -583,7 +583,7 @@ static t_node *nextarg(t_node **argp, t_def *edf)
|
|||
return arg;
|
||||
}
|
||||
|
||||
static t_node *getarg(t_node **argp, int bases, int designator, t_def *edf)
|
||||
static struct node *getarg(struct node **argp, int bases, int designator, struct def *edf)
|
||||
{
|
||||
/* This routine is used to fetch the next argument from an
|
||||
argument list. The argument list is indicated by "argp".
|
||||
|
@ -593,8 +593,8 @@ static t_node *getarg(t_node **argp, int bases, int designator, t_def *edf)
|
|||
that it must be a designator and may not be a register
|
||||
variable.
|
||||
*/
|
||||
register t_node *arg = nextarg(argp, edf);
|
||||
register t_node *left;
|
||||
register struct node *arg = nextarg(argp, edf);
|
||||
register struct node *left;
|
||||
|
||||
if (! arg ||
|
||||
! arg->nd_LEFT ||
|
||||
|
@ -608,7 +608,7 @@ static t_node *getarg(t_node **argp, int bases, int designator, t_def *edf)
|
|||
}
|
||||
|
||||
if (bases) {
|
||||
t_type *tp = BaseType(left->nd_type);
|
||||
struct type *tp = BaseType(left->nd_type);
|
||||
|
||||
if (! designator) MkCoercion(&(arg->nd_LEFT), tp);
|
||||
left = arg->nd_LEFT;
|
||||
|
@ -621,14 +621,14 @@ static t_node *getarg(t_node **argp, int bases, int designator, t_def *edf)
|
|||
return left;
|
||||
}
|
||||
|
||||
static t_node *getname(t_node **argp, int kinds, int bases, t_def *edf)
|
||||
static struct node *getname(struct node **argp, int kinds, int bases, struct def *edf)
|
||||
{
|
||||
/* Get the next argument from argument list "argp".
|
||||
The argument must indicate a definition, and the
|
||||
definition kind must be one of "kinds".
|
||||
*/
|
||||
register t_node *arg = nextarg(argp, edf);
|
||||
register t_node *left;
|
||||
register struct node *arg = nextarg(argp, edf);
|
||||
register struct node *left;
|
||||
|
||||
if (!arg || !arg->nd_LEFT || ! ChkDesig(&(arg->nd_LEFT), D_USED)) return 0;
|
||||
|
||||
|
@ -647,14 +647,14 @@ static t_node *getname(t_node **argp, int kinds, int bases, t_def *edf)
|
|||
return left;
|
||||
}
|
||||
|
||||
static int ChkProcCall(register t_node *exp)
|
||||
static int ChkProcCall(register struct node *exp)
|
||||
{
|
||||
/* Check a procedure call
|
||||
*/
|
||||
register t_node *left;
|
||||
t_node *argp;
|
||||
t_def *edf = 0;
|
||||
register t_param *param;
|
||||
register struct node *left;
|
||||
struct node *argp;
|
||||
struct def *edf = 0;
|
||||
register struct paramlist *param;
|
||||
int retval = 1;
|
||||
int cnt = 0;
|
||||
|
||||
|
@ -708,7 +708,7 @@ static int ChkProcCall(register t_node *exp)
|
|||
return retval;
|
||||
}
|
||||
|
||||
static int ChkFunCall(register t_node **expp, int flags)
|
||||
static int ChkFunCall(register struct node **expp, int flags)
|
||||
{
|
||||
/* Check a call that must have a result
|
||||
*/
|
||||
|
@ -723,7 +723,7 @@ static int ChkFunCall(register t_node **expp, int flags)
|
|||
|
||||
|
||||
|
||||
int ChkCall(t_node **expp)
|
||||
int ChkCall(struct node **expp)
|
||||
{
|
||||
/* Check something that looks like a procedure or function call.
|
||||
Of course this does not have to be a call at all,
|
||||
|
@ -733,7 +733,7 @@ int ChkCall(t_node **expp)
|
|||
/* First, get the name of the function or procedure
|
||||
*/
|
||||
if (ChkDesig(&((*expp)->nd_LEFT), D_USED)) {
|
||||
register t_node *left = (*expp)->nd_LEFT;
|
||||
register struct node *left = (*expp)->nd_LEFT;
|
||||
|
||||
if (IsCast(left)) {
|
||||
/* It was a type cast.
|
||||
|
@ -763,7 +763,7 @@ int ChkCall(t_node **expp)
|
|||
return ChkProcCall(*expp);
|
||||
}
|
||||
|
||||
static t_type *ResultOfOperation(int operator, t_type *tp)
|
||||
static struct type *ResultOfOperation(int operator, struct type *tp)
|
||||
{
|
||||
/* Return the result type of the binary operation "operator",
|
||||
with operand type "tp".
|
||||
|
@ -820,9 +820,9 @@ static int AllowedTypes(int operator)
|
|||
}
|
||||
|
||||
static int ChkAddressOper(
|
||||
register t_type *tpl,
|
||||
register t_type *tpr,
|
||||
register t_node *expp)
|
||||
register struct type *tpl,
|
||||
register struct type *tpr,
|
||||
register struct node *expp)
|
||||
{
|
||||
/* Check that either "tpl" or "tpr" are both of type
|
||||
address_type, or that one of them is, but the other is
|
||||
|
@ -833,8 +833,8 @@ static int ChkAddressOper(
|
|||
|
||||
if (tpr == address_type && expp->nd_symb == '+') {
|
||||
/* use the fact that '+' is a commutative operator */
|
||||
t_type *tmptype = tpr;
|
||||
t_node *tmpnode = expp->nd_RIGHT;
|
||||
struct type *tmptype = tpr;
|
||||
struct node *tmpnode = expp->nd_RIGHT;
|
||||
|
||||
tpr = tpl;
|
||||
expp->nd_RIGHT = expp->nd_LEFT;
|
||||
|
@ -866,13 +866,13 @@ static int ChkAddressOper(
|
|||
return 0;
|
||||
}
|
||||
|
||||
static int ChkBinOper(t_node **expp, int flags)
|
||||
static int ChkBinOper(struct node **expp, int flags)
|
||||
{
|
||||
/* Check a binary operation.
|
||||
*/
|
||||
register t_node *exp = *expp;
|
||||
register t_type *tpl, *tpr;
|
||||
t_type *result_type;
|
||||
register struct node *exp = *expp;
|
||||
register struct type *tpl, *tpr;
|
||||
struct type *result_type;
|
||||
int allowed;
|
||||
int retval;
|
||||
char *symb;
|
||||
|
@ -981,13 +981,13 @@ static int ChkBinOper(t_node **expp, int flags)
|
|||
return 1;
|
||||
}
|
||||
|
||||
static int ChkUnOper(t_node **expp, int flags)
|
||||
static int ChkUnOper(struct node **expp, int flags)
|
||||
{
|
||||
/* Check an unary operation.
|
||||
*/
|
||||
register t_node *exp = *expp;
|
||||
register t_node *right = exp->nd_RIGHT;
|
||||
register t_type *tpr;
|
||||
register struct node *exp = *expp;
|
||||
register struct node *right = exp->nd_RIGHT;
|
||||
register struct type *tpr;
|
||||
|
||||
if (exp->nd_symb == COERCION) return 1;
|
||||
if (exp->nd_symb == '(') {
|
||||
|
@ -1054,12 +1054,12 @@ static int ChkUnOper(t_node **expp, int flags)
|
|||
return 0;
|
||||
}
|
||||
|
||||
static t_node *getvariable(t_node **argp, t_def *edf, int flags)
|
||||
static struct node *getvariable(struct node **argp, struct def *edf, int flags)
|
||||
{
|
||||
/* Get the next argument from argument list "argp".
|
||||
It must obey the rules of "ChkVariable".
|
||||
*/
|
||||
register t_node *arg = nextarg(argp, edf);
|
||||
register struct node *arg = nextarg(argp, edf);
|
||||
|
||||
if (! arg ||
|
||||
! arg->nd_LEFT ||
|
||||
|
@ -1068,14 +1068,14 @@ static t_node *getvariable(t_node **argp, t_def *edf, int flags)
|
|||
return arg->nd_LEFT;
|
||||
}
|
||||
|
||||
static int ChkStandard(t_node **expp)
|
||||
static int ChkStandard(struct node **expp)
|
||||
{
|
||||
/* Check a call of a standard procedure or function
|
||||
*/
|
||||
register t_node *exp = *expp;
|
||||
t_node *arglink = exp;
|
||||
register t_node *arg;
|
||||
register t_def *edf = exp->nd_LEFT->nd_def;
|
||||
register struct node *exp = *expp;
|
||||
struct node *arglink = exp;
|
||||
register struct node *arg;
|
||||
register struct def *edf = exp->nd_LEFT->nd_def;
|
||||
int free_it = 0;
|
||||
int isconstant = 0;
|
||||
|
||||
|
@ -1126,8 +1126,8 @@ static int ChkStandard(t_node **expp)
|
|||
|
||||
case S_SHORT:
|
||||
case S_LONG: {
|
||||
t_type *tp;
|
||||
t_type *s1, *s2, *s3, *d1, *d2, *d3;
|
||||
struct type *tp;
|
||||
struct type *s1, *s2, *s3, *d1, *d2, *d3;
|
||||
|
||||
if (!(arg = getarg(&arglink, 0, 0, edf))) {
|
||||
return 0;
|
||||
|
@ -1349,8 +1349,8 @@ static int ChkStandard(t_node **expp)
|
|||
case S_EXCL:
|
||||
case S_INCL:
|
||||
{
|
||||
register t_type *tp;
|
||||
t_node *dummy;
|
||||
register struct type *tp;
|
||||
struct node *dummy;
|
||||
|
||||
exp->nd_type = 0;
|
||||
if (!(arg = getvariable(&arglink, edf, D_USED|D_DEFINED))) return 0;
|
||||
|
@ -1398,7 +1398,7 @@ static int ChkStandard(t_node **expp)
|
|||
return 1;
|
||||
}
|
||||
|
||||
static int ChkCast(t_node **expp)
|
||||
static int ChkCast(struct node **expp)
|
||||
{
|
||||
/* Check a cast and perform it if the argument is constant.
|
||||
If the sizes don't match, only complain if at least one of them
|
||||
|
@ -1407,10 +1407,10 @@ static int ChkCast(t_node **expp)
|
|||
is no problem as such values take a word on the EM stack
|
||||
anyway.
|
||||
*/
|
||||
register t_node *exp = *expp;
|
||||
register t_node *arg = exp->nd_RIGHT;
|
||||
register t_type *lefttype = exp->nd_LEFT->nd_type;
|
||||
t_def *df = exp->nd_LEFT->nd_def;
|
||||
register struct node *exp = *expp;
|
||||
register struct node *arg = exp->nd_RIGHT;
|
||||
register struct type *lefttype = exp->nd_LEFT->nd_type;
|
||||
struct def *df = exp->nd_LEFT->nd_def;
|
||||
|
||||
if ((! arg) || arg->nd_RIGHT) {
|
||||
df_error(exp, "type cast must have 1 parameter", df);
|
||||
|
@ -1461,7 +1461,7 @@ static int ChkCast(t_node **expp)
|
|||
return 1;
|
||||
}
|
||||
|
||||
void TryToString(register t_node *nd, t_type *tp)
|
||||
void TryToString(register struct node *nd, struct type *tp)
|
||||
{
|
||||
/* Try a coercion from character constant to string.
|
||||
*/
|
||||
|
@ -1479,20 +1479,20 @@ void TryToString(register t_node *nd, t_type *tp)
|
|||
}
|
||||
}
|
||||
|
||||
static int no_desig(t_node **expp, int flags)
|
||||
static int no_desig(struct node **expp, int flags)
|
||||
{
|
||||
node_error(*expp, "designator expected");
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int add_flags(t_node **expp, int flags)
|
||||
static int add_flags(struct node **expp, int flags)
|
||||
{
|
||||
(*expp)->nd_def->df_flags |= flags;
|
||||
return 1;
|
||||
}
|
||||
|
||||
|
||||
int (*ExprChkTable[])(t_node **, int) = {
|
||||
int (*ExprChkTable[])(struct node **, int) = {
|
||||
ChkValue,
|
||||
ChkArr,
|
||||
ChkBinOper,
|
||||
|
@ -1508,7 +1508,7 @@ int (*ExprChkTable[])(t_node **, int) = {
|
|||
PNodeCrash,
|
||||
};
|
||||
|
||||
int (*DesigChkTable[])(t_node **, int) = {
|
||||
int (*DesigChkTable[])(struct node **, int) = {
|
||||
no_desig,
|
||||
ChkArr,
|
||||
no_desig,
|
||||
|
|
|
@ -11,10 +11,10 @@
|
|||
|
||||
/* $Id$ */
|
||||
|
||||
extern int (*ExprChkTable[])(t_node **, int); /* table of expression checking
|
||||
extern int (*ExprChkTable[])(struct node **, int); /* table of expression checking
|
||||
functions, indexed by node class
|
||||
*/
|
||||
extern int (*DesigChkTable[])(t_node **, int); /* table of designator checking
|
||||
extern int (*DesigChkTable[])(struct node **, int); /* table of designator checking
|
||||
functions, indexed by node class
|
||||
*/
|
||||
|
||||
|
@ -26,10 +26,10 @@ extern int (*DesigChkTable[])(t_node **, int); /* table of designator checking
|
|||
#define dec_refcount(s) (*((int *)(s) - 1) -= 1)
|
||||
#define refcount(s) (*((int *)(s) - 1))
|
||||
|
||||
void MkCoercion(t_node **pnd, register t_type *tp);
|
||||
int ChkVariable(register t_node **expp, int flags);
|
||||
int ChkCall(t_node **expp);
|
||||
void TryToString(register t_node *nd, t_type *tp);
|
||||
void MkCoercion(struct node **pnd, register struct type *tp);
|
||||
int ChkVariable(register struct node **expp, int flags);
|
||||
int ChkCall(struct node **expp);
|
||||
void TryToString(register struct node *nd, struct type *tp);
|
||||
|
||||
/* Generates a set of "size" bytes and increments its reference count. */
|
||||
arith *MkSet(unsigned int size);
|
||||
|
|
|
@ -38,19 +38,19 @@
|
|||
|
||||
extern int proclevel;
|
||||
extern char options[];
|
||||
extern t_desig null_desig;
|
||||
extern struct desig null_desig;
|
||||
int fp_used;
|
||||
|
||||
/* Forward declarations */
|
||||
static void CodeParameters(t_param *, register t_node *);
|
||||
static void CodeStd(t_node *);
|
||||
static void CodeParameters(struct paramlist *, register struct node *);
|
||||
static void CodeStd(struct node *);
|
||||
static void compare(int, label);
|
||||
static void truthvalue(int);
|
||||
static void CodeUoper(register t_node *);
|
||||
static void CodeSet(register t_node *, int);
|
||||
static void CodeEl(register t_node *, register t_type *, int);
|
||||
static void CodeDAddress(t_node *, int);
|
||||
static void DoHIGH(register t_def *);
|
||||
static void CodeUoper(register struct node *);
|
||||
static void CodeSet(register struct node *, int);
|
||||
static void CodeEl(register struct node *, register struct type *, int);
|
||||
static void CodeDAddress(struct node *, int);
|
||||
static void DoHIGH(register struct def *);
|
||||
|
||||
void CodeConst(arith cst, int size)
|
||||
{
|
||||
|
@ -65,7 +65,7 @@ void CodeConst(arith cst, int size)
|
|||
}
|
||||
}
|
||||
|
||||
void CodeString(register t_node *nd)
|
||||
void CodeString(register struct node *nd)
|
||||
{
|
||||
if (nd->nd_type->tp_fund != T_STRING) {
|
||||
/* Character constant */
|
||||
|
@ -77,9 +77,9 @@ void CodeString(register t_node *nd)
|
|||
c_lae_dlb(data_label);
|
||||
}
|
||||
|
||||
void CodeExpr(t_node *nd, t_desig *ds, label true_label, label false_label)
|
||||
void CodeExpr(struct node *nd, struct desig *ds, label true_label, label false_label)
|
||||
{
|
||||
register t_type *tp = nd->nd_type;
|
||||
register struct type *tp = nd->nd_type;
|
||||
|
||||
DoLineno(nd);
|
||||
if (tp->tp_fund == T_REAL) fp_used = 1;
|
||||
|
@ -174,7 +174,7 @@ void CodeExpr(t_node *nd, t_desig *ds, label true_label, label false_label)
|
|||
}
|
||||
}
|
||||
|
||||
void CodeCoercion(t_type *t1, t_type *t2)
|
||||
void CodeCoercion(struct type *t1, struct type *t2)
|
||||
{
|
||||
int fund1, fund2;
|
||||
int sz1 = t1->tp_size;
|
||||
|
@ -293,11 +293,11 @@ void CodeCoercion(t_type *t1, t_type *t2)
|
|||
}
|
||||
}
|
||||
|
||||
void CodeCall(t_node *nd)
|
||||
void CodeCall(struct node *nd)
|
||||
{
|
||||
|
||||
register t_node *left = nd->nd_LEFT;
|
||||
t_type *result_tp;
|
||||
register struct node *left = nd->nd_LEFT;
|
||||
struct type *result_tp;
|
||||
int needs_fn;
|
||||
|
||||
if (left->nd_type == std_type) {
|
||||
|
@ -320,7 +320,7 @@ void CodeCall(t_node *nd)
|
|||
|
||||
switch(left->nd_class) {
|
||||
case Def: {
|
||||
register t_def *df = left->nd_def;
|
||||
register struct def *df = left->nd_def;
|
||||
|
||||
if (df->df_kind == D_CONST) {
|
||||
/* a procedure address */
|
||||
|
@ -358,10 +358,10 @@ void CodeCall(t_node *nd)
|
|||
}
|
||||
|
||||
/* Generates code to setup the parameters of a procedure call. */
|
||||
static void CodeParameters(t_param *param, register t_node *arg)
|
||||
static void CodeParameters(struct paramlist *param, register struct node *arg)
|
||||
{
|
||||
register t_type *tp;
|
||||
register t_type *arg_type;
|
||||
register struct type *tp;
|
||||
register struct type *arg_type;
|
||||
|
||||
assert(param != 0 && arg != 0);
|
||||
|
||||
|
@ -373,7 +373,7 @@ static void CodeParameters(t_param *param, register t_node *arg)
|
|||
arg = arg->nd_LEFT;
|
||||
arg_type = arg->nd_type;
|
||||
if (IsConformantArray(tp)) {
|
||||
register t_type *elem = tp->arr_elem;
|
||||
register struct type *elem = tp->arr_elem;
|
||||
|
||||
C_loc(tp->arr_elsize);
|
||||
if (IsConformantArray(arg_type)) {
|
||||
|
@ -439,7 +439,7 @@ static void CodeParameters(t_param *param, register t_node *arg)
|
|||
CodePExpr(arg);
|
||||
}
|
||||
|
||||
void CodePString(t_node *nd, t_type *tp)
|
||||
void CodePString(struct node *nd, struct type *tp)
|
||||
{
|
||||
arith szarg = WA(nd->nd_type->tp_size);
|
||||
register arith zersz = WA(tp->tp_size) - szarg;
|
||||
|
@ -471,7 +471,7 @@ static void addu(int sz)
|
|||
C_adu((arith)sz);
|
||||
}
|
||||
|
||||
static int complex_lhs(register t_node *nd)
|
||||
static int complex_lhs(register struct node *nd)
|
||||
{
|
||||
switch(nd->nd_class) {
|
||||
case Value:
|
||||
|
@ -487,11 +487,11 @@ static int complex_lhs(register t_node *nd)
|
|||
}
|
||||
|
||||
/* Generate code for internal procedures */
|
||||
static void CodeStd(t_node *nd)
|
||||
static void CodeStd(struct node *nd)
|
||||
{
|
||||
register t_node *arg = nd->nd_RIGHT;
|
||||
register t_node *left = 0;
|
||||
register t_type *tp = 0;
|
||||
register struct node *arg = nd->nd_RIGHT;
|
||||
register struct node *left = 0;
|
||||
register struct type *tp = 0;
|
||||
int std = nd->nd_LEFT->nd_def->df_value.df_stdname;
|
||||
|
||||
if (arg) {
|
||||
|
@ -642,7 +642,7 @@ static void CodeStd(t_node *nd)
|
|||
}
|
||||
}
|
||||
|
||||
static int needs_rangecheck(register t_type *tpl, t_type *tpr)
|
||||
static int needs_rangecheck(register struct type *tpl, struct type *tpr)
|
||||
{
|
||||
arith rlo, rhi;
|
||||
|
||||
|
@ -665,7 +665,7 @@ static int needs_rangecheck(register t_type *tpl, t_type *tpr)
|
|||
return 0;
|
||||
}
|
||||
|
||||
void RangeCheck(register t_type *tpl, t_type *tpr)
|
||||
void RangeCheck(register struct type *tpl, struct type *tpr)
|
||||
{
|
||||
arith rlo, rhi;
|
||||
|
||||
|
@ -690,7 +690,7 @@ void RangeCheck(register t_type *tpl, t_type *tpr)
|
|||
}
|
||||
}
|
||||
|
||||
void Operands(register t_node *nd)
|
||||
void Operands(register struct node *nd)
|
||||
{
|
||||
|
||||
CodePExpr(nd->nd_LEFT);
|
||||
|
@ -699,13 +699,13 @@ void Operands(register t_node *nd)
|
|||
}
|
||||
|
||||
void CodeOper(
|
||||
register t_node *expr, /* the expression tree itself */
|
||||
register struct node *expr, /* the expression tree itself */
|
||||
label true_label,
|
||||
label false_label /* labels to jump to in logical expr's */
|
||||
)
|
||||
{
|
||||
register t_node *leftop = expr->nd_LEFT;
|
||||
register t_node *rightop = expr->nd_RIGHT;
|
||||
register struct node *leftop = expr->nd_LEFT;
|
||||
register struct node *rightop = expr->nd_RIGHT;
|
||||
int fund = expr->nd_type->tp_fund;
|
||||
arith size = expr->nd_type->tp_size;
|
||||
|
||||
|
@ -850,7 +850,7 @@ void CodeOper(
|
|||
case GREATEREQUAL:
|
||||
case '=':
|
||||
case '#': {
|
||||
t_type *tp;
|
||||
struct type *tp;
|
||||
|
||||
Operands(expr);
|
||||
tp = BaseType(leftop->nd_type);
|
||||
|
@ -913,7 +913,7 @@ void CodeOper(
|
|||
stack
|
||||
*/
|
||||
label l_toolarge = NO_LABEL, l_cont = NO_LABEL;
|
||||
t_type *ltp = leftop->nd_type;
|
||||
struct type *ltp = leftop->nd_type;
|
||||
|
||||
if (leftop->nd_symb == COERCION) {
|
||||
/* Could be coercion to word_type. */
|
||||
|
@ -968,7 +968,7 @@ void CodeOper(
|
|||
case OR:
|
||||
case AND: {
|
||||
label l_maybe = ++text_label, l_end = NO_LABEL;
|
||||
t_desig Des;
|
||||
struct desig Des;
|
||||
|
||||
Des = null_desig;
|
||||
|
||||
|
@ -1056,9 +1056,9 @@ static void truthvalue(int relop)
|
|||
|
||||
|
||||
/* Generates code for an unary expression */
|
||||
void CodeUoper(register t_node *nd)
|
||||
void CodeUoper(register struct node *nd)
|
||||
{
|
||||
register t_type *tp = nd->nd_type;
|
||||
register struct type *tp = nd->nd_type;
|
||||
|
||||
CodePExpr(nd->nd_RIGHT);
|
||||
switch(nd->nd_symb) {
|
||||
|
@ -1089,9 +1089,9 @@ void CodeUoper(register t_node *nd)
|
|||
}
|
||||
}
|
||||
|
||||
static void CodeSet(register t_node *nd, int null_set)
|
||||
static void CodeSet(register struct node *nd, int null_set)
|
||||
{
|
||||
register t_type *tp = nd->nd_type;
|
||||
register struct type *tp = nd->nd_type;
|
||||
|
||||
nd = nd->nd_NEXT;
|
||||
while (nd) {
|
||||
|
@ -1106,9 +1106,9 @@ static void CodeSet(register t_node *nd, int null_set)
|
|||
if (null_set) C_zer(tp->tp_size);
|
||||
}
|
||||
|
||||
static void CodeEl(register t_node *nd, register t_type *tp, int null_set)
|
||||
static void CodeEl(register struct node *nd, register struct type *tp, int null_set)
|
||||
{
|
||||
register t_type *eltype = ElementType(tp);
|
||||
register struct type *eltype = ElementType(tp);
|
||||
|
||||
if (nd->nd_class == Link && nd->nd_symb == UPTO) {
|
||||
if (null_set) C_zer(tp->tp_size);
|
||||
|
@ -1131,23 +1131,23 @@ static void CodeEl(register t_node *nd, register t_type *tp, int null_set)
|
|||
}
|
||||
}
|
||||
|
||||
void CodePExpr(register t_node *nd)
|
||||
void CodePExpr(register struct node *nd)
|
||||
{
|
||||
|
||||
t_desig designator;
|
||||
struct desig designator;
|
||||
|
||||
designator = null_desig;
|
||||
CodeExpr(nd, &designator, NO_LABEL, NO_LABEL);
|
||||
CodeValue(&designator, nd->nd_type);
|
||||
}
|
||||
|
||||
static void CodeDAddress(t_node *nd, int chk_controlvar)
|
||||
static void CodeDAddress(struct node *nd, int chk_controlvar)
|
||||
{
|
||||
/* Generate code to push the address of the designator "nd"
|
||||
on the stack.
|
||||
*/
|
||||
|
||||
t_desig designator;
|
||||
struct desig designator;
|
||||
int chkptr;
|
||||
|
||||
designator = null_desig;
|
||||
|
@ -1167,11 +1167,11 @@ static void CodeDAddress(t_node *nd, int chk_controlvar)
|
|||
}
|
||||
}
|
||||
|
||||
void CodeDStore(register t_node *nd)
|
||||
void CodeDStore(register struct node *nd)
|
||||
{
|
||||
|
||||
|
||||
t_desig designator;
|
||||
struct desig designator;
|
||||
|
||||
designator = null_desig;
|
||||
ChkForFOR(nd);
|
||||
|
@ -1179,7 +1179,7 @@ void CodeDStore(register t_node *nd)
|
|||
CodeStore(&designator, nd->nd_type);
|
||||
}
|
||||
|
||||
static void DoHIGH(register t_def *df)
|
||||
static void DoHIGH(register struct def *df)
|
||||
{
|
||||
/* Get the high index of a conformant array, indicated by "nd".
|
||||
The high index is the second field in the descriptor of
|
||||
|
|
|
@ -13,32 +13,33 @@
|
|||
#include <em_label.h>
|
||||
|
||||
/* Forward declarations. */
|
||||
typedef struct node t_node;
|
||||
typedef struct desig t_desig;
|
||||
typedef struct type t_type;
|
||||
struct node;
|
||||
struct desig;
|
||||
struct type;
|
||||
|
||||
|
||||
/* Generate code to push constant "cst" with size "size" bytes. */
|
||||
void CodeConst(arith cst, int size);
|
||||
/* Generate constant character or string. */
|
||||
void CodeString(register t_node *nd);
|
||||
void CodeString(register struct node *nd);
|
||||
/* Generate code for an expression contained in "nd". */
|
||||
void CodeExpr(t_node *nd, t_desig *ds, label true_label, label false_label);
|
||||
void CodeExpr(struct node *nd, struct desig *ds, label true_label, label false_label);
|
||||
/* Generate implicit type conversion code. */
|
||||
void CodeCoercion(t_type *t1, t_type *t2);
|
||||
void CodeCoercion(struct type *t1, struct type *t2);
|
||||
/* Generate code for a procedure call including parameter setup. Checking of parameters
|
||||
and result is already done. */
|
||||
void CodeCall(t_node *nd);
|
||||
void CodePString(t_node *nd, t_type *tp);
|
||||
void CodeCall(struct node *nd);
|
||||
void CodePString(struct node *nd, struct type *tp);
|
||||
/* Generate a range check if necessary */
|
||||
void RangeCheck(register t_type *tpl, t_type *tpr);
|
||||
void CodeOper(register t_node *expr, label true_label, label false_label);
|
||||
void RangeCheck(register struct type *tpl, struct type *tpr);
|
||||
void CodeOper(register struct node *expr, label true_label, label false_label);
|
||||
/* Generate code to push the value of the expression "nd"
|
||||
on the stack. */
|
||||
void CodePExpr(register t_node *nd);
|
||||
void CodePExpr(register struct node *nd);
|
||||
/* Generate code to store the expression on the stack into the
|
||||
designator "nd".
|
||||
*/
|
||||
void CodeDStore(register t_node *nd);
|
||||
void CodeDStore(register struct node *nd);
|
||||
|
||||
#ifdef SQUEEZE
|
||||
void c_bra(label l);
|
||||
|
|
|
@ -48,21 +48,21 @@ arith min_int[] = { 0L, -128L, -32768L, 0L, -2147483647L-1 };
|
|||
|
||||
extern char options[];
|
||||
|
||||
static void CutSize(register t_node *);
|
||||
static void CutSize(register struct node *);
|
||||
|
||||
|
||||
static void overflow(t_node *expp)
|
||||
static void overflow(struct node *expp)
|
||||
{
|
||||
if (expp->nd_type != address_type) {
|
||||
node_warning(expp, W_ORDINARY, "overflow in constant expression");
|
||||
}
|
||||
}
|
||||
|
||||
static void commonbin(t_node **expp)
|
||||
static void commonbin(struct node **expp)
|
||||
{
|
||||
register t_node *exp = *expp;
|
||||
t_type *tp = exp->nd_type;
|
||||
register t_node *right = exp->nd_RIGHT;
|
||||
register struct node *exp = *expp;
|
||||
struct type *tp = exp->nd_type;
|
||||
register struct node *right = exp->nd_RIGHT;
|
||||
|
||||
exp->nd_RIGHT = 0;
|
||||
FreeNode(exp);
|
||||
|
@ -70,13 +70,13 @@ static void commonbin(t_node **expp)
|
|||
right->nd_type = tp;
|
||||
}
|
||||
|
||||
void cstunary(t_node **expp)
|
||||
void cstunary(struct node **expp)
|
||||
{
|
||||
/* The unary operation in "expp" is performed on the constant
|
||||
expression below it, and the result stored in expp.
|
||||
*/
|
||||
register t_node *exp = *expp;
|
||||
register t_node *right = exp->nd_RIGHT;
|
||||
register struct node *exp = *expp;
|
||||
register struct node *right = exp->nd_RIGHT;
|
||||
register arith o1 = right->nd_INT;
|
||||
|
||||
switch(exp->nd_symb) {
|
||||
|
@ -119,13 +119,13 @@ static void divide(arith *pdiv, arith *prem)
|
|||
*prem = (unsigned arith) o1 % (unsigned arith) o2;
|
||||
}
|
||||
|
||||
void cstibin(t_node **expp)
|
||||
void cstibin(struct node **expp)
|
||||
{
|
||||
/* The binary operation in "expp" is performed on the constant
|
||||
expressions below it, and the result restored in expp.
|
||||
This version is for INTEGER expressions.
|
||||
*/
|
||||
register t_node *exp = *expp;
|
||||
register struct node *exp = *expp;
|
||||
register arith o1 = exp->nd_LEFT->nd_INT;
|
||||
register arith o2 = exp->nd_RIGHT->nd_INT;
|
||||
register int sz = exp->nd_type->tp_size;
|
||||
|
@ -228,13 +228,13 @@ void cstibin(t_node **expp)
|
|||
CutSize(*expp);
|
||||
}
|
||||
|
||||
void cstfbin(t_node **expp)
|
||||
void cstfbin(struct node **expp)
|
||||
{
|
||||
/* The binary operation in "expp" is performed on the constant
|
||||
expressions below it, and the result restored in expp.
|
||||
This version is for REAL expressions.
|
||||
*/
|
||||
register t_node *exp = *expp;
|
||||
register struct node *exp = *expp;
|
||||
register struct real *p = exp->nd_LEFT->nd_REAL;
|
||||
register flt_arith *o1 = &p->r_val;
|
||||
register flt_arith *o2 = &exp->nd_RIGHT->nd_RVAL;
|
||||
|
@ -288,7 +288,7 @@ void cstfbin(t_node **expp)
|
|||
|
||||
switch(flt_status) {
|
||||
case FLT_OVFL:
|
||||
node_warning(exp, "floating point overflow on %s",
|
||||
node_warning(exp, W_ORDINARY, "floating point overflow on %s",
|
||||
symbol2str(exp->nd_symb));
|
||||
break;
|
||||
case FLT_DIV0:
|
||||
|
@ -315,13 +315,13 @@ void cstfbin(t_node **expp)
|
|||
CutSize(exp);
|
||||
}
|
||||
|
||||
void cstubin(t_node **expp)
|
||||
void cstubin(struct node **expp)
|
||||
{
|
||||
/* The binary operation in "expp" is performed on the constant
|
||||
expressions below it, and the result restored in
|
||||
expp.
|
||||
*/
|
||||
register t_node *exp = *expp;
|
||||
register struct node *exp = *expp;
|
||||
arith o1 = exp->nd_LEFT->nd_INT;
|
||||
arith o2 = exp->nd_RIGHT->nd_INT;
|
||||
register int sz = exp->nd_type->tp_size;
|
||||
|
@ -420,10 +420,10 @@ void cstubin(t_node **expp)
|
|||
CutSize(exp);
|
||||
}
|
||||
|
||||
void cstset(t_node **expp)
|
||||
void cstset(struct node **expp)
|
||||
{
|
||||
extern arith *MkSet();
|
||||
register t_node *exp = *expp;
|
||||
register struct node *exp = *expp;
|
||||
register arith *set1, *set2, *set3;
|
||||
register unsigned int setsize;
|
||||
register int j;
|
||||
|
@ -535,13 +535,13 @@ void cstset(t_node **expp)
|
|||
FreeNode(exp);
|
||||
}
|
||||
|
||||
void cstcall(t_node **expp, int call)
|
||||
void cstcall(struct node **expp, int call)
|
||||
{
|
||||
/* a standard procedure call is found that can be evaluated
|
||||
compile time, so do so.
|
||||
*/
|
||||
register t_node *expr;
|
||||
register t_type *tp;
|
||||
register struct node *expr;
|
||||
register struct type *tp;
|
||||
|
||||
assert((*expp)->nd_class == Call);
|
||||
expr = (*expp)->nd_RIGHT->nd_LEFT;
|
||||
|
@ -609,12 +609,12 @@ void cstcall(t_node **expp, int call)
|
|||
}
|
||||
}
|
||||
|
||||
static void CutSize(register t_node *expr)
|
||||
static void CutSize(register struct node *expr)
|
||||
{
|
||||
/* The constant value of the expression expr is made to
|
||||
conform to the size of the type of the expression.
|
||||
*/
|
||||
register t_type *tp = BaseType(expr->nd_type);
|
||||
register struct type *tp = BaseType(expr->nd_type);
|
||||
|
||||
assert(expr->nd_class == Value);
|
||||
if (tp->tp_fund == T_REAL) return;
|
||||
|
|
|
@ -11,18 +11,18 @@
|
|||
/* Compile time constant evaluations */
|
||||
|
||||
|
||||
void cstunary(t_node **expp);
|
||||
void cstibin(t_node **expp);
|
||||
void cstfbin(t_node **expp);
|
||||
void cstubin(t_node **expp);
|
||||
void cstunary(struct node **expp);
|
||||
void cstibin(struct node **expp);
|
||||
void cstfbin(struct node **expp);
|
||||
void cstubin(struct node **expp);
|
||||
/** Evaluates the constant set operators at compile time
|
||||
* and returns the result in "expp".
|
||||
*/
|
||||
void cstset(t_node **expp);
|
||||
void cstset(struct node **expp);
|
||||
/* Evaluates the result of internal procedures on constants
|
||||
* at compile time, and returns the result in "expp".
|
||||
*/
|
||||
void cstcall(t_node **expp, int call);
|
||||
void cstcall(struct node **expp, int call);
|
||||
/* Compile time constant evaluator system initialization. */
|
||||
void InitCst(void);
|
||||
|
||||
|
|
|
@ -35,7 +35,7 @@
|
|||
int proclevel = 0; /* nesting level of procedures */
|
||||
int return_occurred; /* set if a return occurs in a block */
|
||||
|
||||
extern t_node *EmptyStatement;
|
||||
extern struct node *EmptyStatement;
|
||||
|
||||
#define needs_static_link() (proclevel > 1)
|
||||
}
|
||||
|
@ -43,7 +43,7 @@ extern t_node *EmptyStatement;
|
|||
/* inline in declaration: need space
|
||||
* ProcedureDeclaration
|
||||
* {
|
||||
* t_def *df;
|
||||
* struct def *df;
|
||||
* } :
|
||||
* { ++proclevel; }
|
||||
* ProcedureHeading(&df, D_PROCEDURE)
|
||||
|
@ -55,11 +55,11 @@ extern t_node *EmptyStatement;
|
|||
* ;
|
||||
*/
|
||||
|
||||
ProcedureHeading(t_def **pdf; int type;)
|
||||
ProcedureHeading(struct def **pdf; int type;)
|
||||
{
|
||||
t_type *tp = 0;
|
||||
struct type *tp = 0;
|
||||
arith parmaddr = needs_static_link() ? pointer_size : 0;
|
||||
t_param *pr = 0;
|
||||
struct paramlist *pr = 0;
|
||||
} :
|
||||
PROCEDURE IDENT
|
||||
{ *pdf = DeclProc(type, dot.TOK_IDF); }
|
||||
|
@ -88,7 +88,7 @@ warning(W_STRICT, "procedure \"%s\" has a constructed result type",
|
|||
}
|
||||
;
|
||||
|
||||
block(t_node **pnd;) :
|
||||
block(struct node **pnd;) :
|
||||
[ %persistent
|
||||
declaration
|
||||
]*
|
||||
|
@ -104,7 +104,7 @@ block(t_node **pnd;) :
|
|||
|
||||
declaration
|
||||
{
|
||||
t_def *df;
|
||||
struct def *df;
|
||||
} :
|
||||
CONST [ ConstantDeclaration ';' ]*
|
||||
|
|
||||
|
@ -129,7 +129,7 @@ declaration
|
|||
;
|
||||
|
||||
/* inline in procedureheading: need space
|
||||
* FormalParameters(t_param **ppr; arith *parmaddr; t_type **ptp;):
|
||||
* FormalParameters(struct paramlist **ppr; arith *parmaddr; struct type **ptp;):
|
||||
* '('
|
||||
* [
|
||||
* FPSection(ppr, parmaddr)
|
||||
|
@ -145,21 +145,21 @@ declaration
|
|||
* ;
|
||||
*/
|
||||
|
||||
FPSection(t_param **ppr; arith *parmaddr;)
|
||||
FPSection(struct paramlist **ppr; arith *parmaddr;)
|
||||
{
|
||||
t_node *FPList;
|
||||
t_type *tp;
|
||||
struct node *FPList;
|
||||
struct type *tp;
|
||||
int VARp;
|
||||
} :
|
||||
var(&VARp) IdentList(&FPList) ':' FormalType(&tp)
|
||||
{ EnterParamList(ppr, FPList, tp, VARp, parmaddr); }
|
||||
;
|
||||
|
||||
FormalType(t_type **ptp;)
|
||||
FormalType(struct type **ptp;)
|
||||
/* index type of conformant array is "CARDINAL".
|
||||
Recognize a conformant array by size 0.
|
||||
*/
|
||||
{ register t_type *tp;
|
||||
{ register struct type *tp;
|
||||
} :
|
||||
ARRAY OF
|
||||
{ tp = construct_type(T_ARRAY, card_type); }
|
||||
|
@ -173,9 +173,9 @@ FormalType(t_type **ptp;)
|
|||
|
||||
TypeDeclaration
|
||||
{
|
||||
t_def *df;
|
||||
t_type *tp;
|
||||
register t_node *nd;
|
||||
struct def *df;
|
||||
struct type *tp;
|
||||
register struct node *nd;
|
||||
}:
|
||||
IDENT { df = define(dot.TOK_IDF, CurrentScope, D_TYPE);
|
||||
nd = dot2leaf(Name);
|
||||
|
@ -186,7 +186,7 @@ TypeDeclaration
|
|||
}
|
||||
;
|
||||
|
||||
type(register t_type **ptp;):
|
||||
type(register struct type **ptp;):
|
||||
%default SimpleType(ptp)
|
||||
|
|
||||
ArrayType(ptp)
|
||||
|
@ -200,7 +200,7 @@ type(register t_type **ptp;):
|
|||
ProcedureType(ptp)
|
||||
;
|
||||
|
||||
SimpleType(register t_type **ptp;) :
|
||||
SimpleType(register struct type **ptp;) :
|
||||
qualtype(ptp)
|
||||
[
|
||||
/* nothing */
|
||||
|
@ -216,17 +216,17 @@ SimpleType(register t_type **ptp;) :
|
|||
SubrangeType(ptp)
|
||||
;
|
||||
|
||||
enumeration(t_type **ptp;)
|
||||
enumeration(struct type **ptp;)
|
||||
{
|
||||
t_node *EnumList;
|
||||
struct node *EnumList;
|
||||
} :
|
||||
'(' IdentList(&EnumList) ')'
|
||||
{ *ptp = enum_type(EnumList); }
|
||||
;
|
||||
|
||||
IdentList(t_node **p;)
|
||||
IdentList(struct node **p;)
|
||||
{
|
||||
register t_node *q;
|
||||
register struct node *q;
|
||||
} :
|
||||
IDENT { *p = q = dot2leaf(Select); }
|
||||
[ %persistent
|
||||
|
@ -237,9 +237,9 @@ IdentList(t_node **p;)
|
|||
]*
|
||||
;
|
||||
|
||||
SubrangeType(t_type **ptp;)
|
||||
SubrangeType(struct type **ptp;)
|
||||
{
|
||||
t_node *nd1, *nd2;
|
||||
struct node *nd1, *nd2;
|
||||
}:
|
||||
/*
|
||||
This is not exactly the rule in the new report, but see
|
||||
|
@ -254,10 +254,10 @@ SubrangeType(t_type **ptp;)
|
|||
}
|
||||
;
|
||||
|
||||
ArrayType(t_type **ptp;)
|
||||
ArrayType(struct type **ptp;)
|
||||
{
|
||||
t_type *tp;
|
||||
register t_type *tp1, *tp2;
|
||||
struct type *tp;
|
||||
register struct type *tp1, *tp2;
|
||||
} :
|
||||
ARRAY SimpleType(&tp)
|
||||
{ tp1 = tp2 = construct_type(T_ARRAY, tp); }
|
||||
|
@ -273,9 +273,9 @@ ArrayType(t_type **ptp;)
|
|||
}
|
||||
;
|
||||
|
||||
RecordType(t_type **ptp;)
|
||||
RecordType(struct type **ptp;)
|
||||
{
|
||||
register t_scope *scope;
|
||||
register struct scope *scope;
|
||||
arith size = 0;
|
||||
int xalign = struct_align;
|
||||
}
|
||||
|
@ -294,19 +294,19 @@ RecordType(t_type **ptp;)
|
|||
END
|
||||
;
|
||||
|
||||
FieldListSequence(t_scope *scope; arith *cnt; int *palign;):
|
||||
FieldListSequence(struct scope *scope; arith *cnt; int *palign;):
|
||||
FieldList(scope, cnt, palign)
|
||||
[
|
||||
';' FieldList(scope, cnt, palign)
|
||||
]*
|
||||
;
|
||||
|
||||
FieldList(t_scope *scope; arith *cnt; int *palign;)
|
||||
FieldList(struct scope *scope; arith *cnt; int *palign;)
|
||||
{
|
||||
t_node *FldList;
|
||||
t_type *tp;
|
||||
t_node *nd;
|
||||
register t_def *df;
|
||||
struct node *FldList;
|
||||
struct type *tp;
|
||||
struct node *nd;
|
||||
register struct def *df;
|
||||
arith tcnt, max;
|
||||
} :
|
||||
[
|
||||
|
@ -374,9 +374,9 @@ FieldList(t_scope *scope; arith *cnt; int *palign;)
|
|||
]
|
||||
;
|
||||
|
||||
variant(t_scope *scope; arith *cnt; t_type *tp; int *palign;)
|
||||
variant(struct scope *scope; arith *cnt; struct type *tp; int *palign;)
|
||||
{
|
||||
t_node *nd;
|
||||
struct node *nd;
|
||||
} :
|
||||
[
|
||||
CaseLabelList(&tp, &nd)
|
||||
|
@ -392,7 +392,7 @@ variant(t_scope *scope; arith *cnt; t_type *tp; int *palign;)
|
|||
/* Changed rule in new modula-2 */
|
||||
;
|
||||
|
||||
CaseLabelList(t_type **ptp; t_node **pnd;):
|
||||
CaseLabelList(struct type **ptp; struct node **pnd;):
|
||||
CaseLabels(ptp, pnd)
|
||||
[
|
||||
{ *pnd = dot2node(Link, *pnd, NULLNODE); }
|
||||
|
@ -401,14 +401,14 @@ CaseLabelList(t_type **ptp; t_node **pnd;):
|
|||
]*
|
||||
;
|
||||
|
||||
CaseLabels(t_type **ptp; register t_node **pnd;)
|
||||
CaseLabels(struct type **ptp; register struct node **pnd;)
|
||||
{
|
||||
register t_node *nd;
|
||||
register struct node *nd;
|
||||
}:
|
||||
ConstExpression(pnd)
|
||||
{
|
||||
if (*ptp != 0) {
|
||||
t_type *tp = intorcard(*ptp,
|
||||
struct type *tp = intorcard(*ptp,
|
||||
BaseType((*pnd)->nd_type));
|
||||
if (tp) *ptp = tp;
|
||||
ChkCompat(pnd, *ptp, "case label");
|
||||
|
@ -444,8 +444,8 @@ CaseLabels(t_type **ptp; register t_node **pnd;)
|
|||
}
|
||||
;
|
||||
|
||||
SetType(t_type **ptp;)
|
||||
{ t_type *tp;
|
||||
SetType(struct type **ptp;)
|
||||
{ struct type *tp;
|
||||
} :
|
||||
SET OF SimpleType(&tp)
|
||||
{ *ptp = set_type(tp); }
|
||||
|
@ -455,8 +455,8 @@ SetType(t_type **ptp;)
|
|||
have to be declared yet, so be careful about identifying
|
||||
type-identifiers.
|
||||
*/
|
||||
PointerType(register t_type **ptp;)
|
||||
{ register t_type *tp;
|
||||
PointerType(register struct type **ptp;)
|
||||
{ register struct type *tp;
|
||||
} :
|
||||
{ tp = construct_type(T_POINTER, NULLTYPE); }
|
||||
POINTER TO
|
||||
|
@ -468,19 +468,19 @@ PointerType(register t_type **ptp;)
|
|||
{ *ptp = tp; }
|
||||
;
|
||||
|
||||
qualtype(t_type **ptp;)
|
||||
qualtype(struct type **ptp;)
|
||||
{
|
||||
t_node *nd;
|
||||
struct node *nd;
|
||||
} :
|
||||
qualident(&nd)
|
||||
{ *ptp = qualified_type(&nd); }
|
||||
;
|
||||
|
||||
ProcedureType(t_type **ptp;)
|
||||
ProcedureType(struct type **ptp;)
|
||||
{
|
||||
t_param *pr = 0;
|
||||
struct paramlist *pr = 0;
|
||||
arith parmaddr = 0;
|
||||
t_type *tp = 0;
|
||||
struct type *tp = 0;
|
||||
} :
|
||||
PROCEDURE
|
||||
[
|
||||
|
@ -490,7 +490,7 @@ ProcedureType(t_type **ptp;)
|
|||
{ *ptp = proc_type(tp, pr, parmaddr); }
|
||||
;
|
||||
|
||||
FormalTypeList(t_param **ppr; arith *pparmaddr; t_type **ptp;) :
|
||||
FormalTypeList(struct paramlist **ppr; arith *pparmaddr; struct type **ptp;) :
|
||||
'('
|
||||
[
|
||||
VarFormalType(ppr, pparmaddr)
|
||||
|
@ -505,9 +505,9 @@ FormalTypeList(t_param **ppr; arith *pparmaddr; t_type **ptp;) :
|
|||
]
|
||||
;
|
||||
|
||||
VarFormalType(t_param **ppr; arith *pparmaddr;)
|
||||
VarFormalType(struct paramlist **ppr; arith *pparmaddr;)
|
||||
{
|
||||
t_type *tp;
|
||||
struct type *tp;
|
||||
int isvar;
|
||||
} :
|
||||
var(&isvar)
|
||||
|
@ -525,9 +525,9 @@ var(int *VARp;) :
|
|||
|
||||
ConstantDeclaration
|
||||
{
|
||||
t_idf *id;
|
||||
t_node *nd;
|
||||
register t_def *df;
|
||||
struct idf *id;
|
||||
struct node *nd;
|
||||
register struct def *df;
|
||||
}:
|
||||
IDENT { id = dot.TOK_IDF; }
|
||||
'=' ConstExpression(&nd)
|
||||
|
@ -540,9 +540,9 @@ ConstantDeclaration
|
|||
|
||||
VariableDeclaration
|
||||
{
|
||||
t_node *VarList;
|
||||
register t_node *nd;
|
||||
t_type *tp;
|
||||
struct node *VarList;
|
||||
register struct node *nd;
|
||||
struct type *tp;
|
||||
} :
|
||||
IdentAddr(&VarList)
|
||||
{ nd = VarList; }
|
||||
|
@ -554,9 +554,9 @@ VariableDeclaration
|
|||
{ EnterVarList(VarList, tp, proclevel > 0); }
|
||||
;
|
||||
|
||||
IdentAddr(t_node **pnd;)
|
||||
IdentAddr(struct node **pnd;)
|
||||
{
|
||||
register t_node *nd;
|
||||
register struct node *nd;
|
||||
} :
|
||||
IDENT { nd = dot2leaf(Name);
|
||||
*pnd = dot2node(Link, nd, NULLNODE);
|
||||
|
|
|
@ -48,14 +48,14 @@ static void internal(register char *c)
|
|||
C_inp(c);
|
||||
}
|
||||
|
||||
static void DefInFront(register t_def *df)
|
||||
static void DefInFront(register struct def *df)
|
||||
{
|
||||
/* Put definition "df" in front of the list of definitions
|
||||
in its scope.
|
||||
This is neccessary because in some cases the order in this
|
||||
list is important.
|
||||
*/
|
||||
register t_def *df1 = df->df_scope->sc_def;
|
||||
register struct def *df1 = df->df_scope->sc_def;
|
||||
|
||||
if (df1 != df)
|
||||
{
|
||||
|
@ -82,12 +82,12 @@ static void DefInFront(register t_def *df)
|
|||
}
|
||||
}
|
||||
|
||||
t_def *MkDef(register t_idf *id, register t_scope *scope, int kind)
|
||||
struct def *MkDef(register struct idf *id, register struct scope *scope, int kind)
|
||||
{
|
||||
/* Create a new definition structure in scope "scope", with
|
||||
id "id" and kind "kind".
|
||||
*/
|
||||
register t_def *df;
|
||||
register struct def *df;
|
||||
|
||||
df = new_def();
|
||||
df->df_idf = id;
|
||||
|
@ -109,14 +109,14 @@ t_def *MkDef(register t_idf *id, register t_scope *scope, int kind)
|
|||
return df;
|
||||
}
|
||||
|
||||
t_def *define(register t_idf *id, register t_scope *scope, int kind)
|
||||
struct def *define(register struct idf *id, register struct scope *scope, int kind)
|
||||
{
|
||||
/* Declare an identifier in a scope, but first check if it
|
||||
already has been defined.
|
||||
If so, then check for the cases in which this is legal,
|
||||
and otherwise give an error message.
|
||||
*/
|
||||
register t_def *df;
|
||||
register struct def *df;
|
||||
|
||||
DO_DEBUG(options['S'], print("define %s, %x\n", id->id_text, kind));
|
||||
df = lookup(id, scope, D_IMPORT, 0);
|
||||
|
@ -211,14 +211,14 @@ t_def *define(register t_idf *id, register t_scope *scope, int kind)
|
|||
return MkDef(id, scope, kind);
|
||||
}
|
||||
|
||||
void end_definition_list(register t_def **pdf)
|
||||
void end_definition_list(register struct def **pdf)
|
||||
{
|
||||
/* Remove all imports from a definition module. This is
|
||||
neccesary because the implementation module might import
|
||||
them again.
|
||||
Also, mark all other definitions "QUALIFIED EXPORT".
|
||||
*/
|
||||
register t_def *df;
|
||||
register struct def *df;
|
||||
|
||||
while ( (df = *pdf) )
|
||||
{
|
||||
|
@ -241,12 +241,12 @@ void end_definition_list(register t_def **pdf)
|
|||
}
|
||||
}
|
||||
|
||||
void RemoveFromIdList(register t_def *df)
|
||||
void RemoveFromIdList(register struct def *df)
|
||||
{
|
||||
/* Remove definition "df" from the definition list
|
||||
*/
|
||||
register t_idf *id = df->df_idf;
|
||||
register t_def *df1;
|
||||
register struct idf *id = df->df_idf;
|
||||
register struct def *df1;
|
||||
|
||||
if ((df1 = id->id_def) == df)
|
||||
id->id_def = df->df_next;
|
||||
|
@ -261,14 +261,14 @@ void RemoveFromIdList(register t_def *df)
|
|||
}
|
||||
}
|
||||
|
||||
t_def * DeclProc(int type, register t_idf *id)
|
||||
struct def * DeclProc(int type, register struct idf *id)
|
||||
{
|
||||
/* A procedure is declared, either in a definition or a program
|
||||
module. Create a def structure for it (if neccessary).
|
||||
Also create a name for it.
|
||||
*/
|
||||
register t_def *df;
|
||||
register t_scope *scope;
|
||||
register struct def *df;
|
||||
register struct scope *scope;
|
||||
static int nmcount;
|
||||
char buf[256];
|
||||
|
||||
|
@ -326,7 +326,7 @@ t_def * DeclProc(int type, register t_idf *id)
|
|||
return df;
|
||||
}
|
||||
|
||||
void EndProc(register t_def *df, t_idf *id)
|
||||
void EndProc(register struct def *df, struct idf *id)
|
||||
{
|
||||
/* The end of a procedure declaration.
|
||||
Check that the closing identifier matches the name of the
|
||||
|
@ -344,13 +344,13 @@ void EndProc(register t_def *df, t_idf *id)
|
|||
}
|
||||
}
|
||||
|
||||
t_def * DefineLocalModule(t_idf *id)
|
||||
struct def * DefineLocalModule(struct idf *id)
|
||||
{
|
||||
/* Create a definition for a local module. Also give it
|
||||
a name to be used for code generation.
|
||||
*/
|
||||
register t_def *df = define(id, CurrentScope, D_MODULE);
|
||||
register t_scope *sc;
|
||||
register struct def *df = define(id, CurrentScope, D_MODULE);
|
||||
register struct scope *sc;
|
||||
static int modulecount = 0;
|
||||
char buf[256];
|
||||
extern int proclevel;
|
||||
|
@ -385,7 +385,7 @@ t_def * DefineLocalModule(t_idf *id)
|
|||
return df;
|
||||
}
|
||||
|
||||
void CheckWithDef(register t_def *df, t_type *tp)
|
||||
void CheckWithDef(register struct def *df, struct type *tp)
|
||||
{
|
||||
/* Check the header of a procedure declaration against a
|
||||
possible earlier definition in the definition module.
|
||||
|
@ -409,7 +409,7 @@ void CheckWithDef(register t_def *df, t_type *tp)
|
|||
}
|
||||
|
||||
#ifdef DEBUG
|
||||
void PrDef(register t_def *df)
|
||||
void PrDef(register struct def *df)
|
||||
{
|
||||
print("n: %s, k: %d\n", df->df_idf->id_text, df->df_kind);
|
||||
}
|
||||
|
|
|
@ -131,23 +131,23 @@ struct def { /* list of definitions for a name */
|
|||
} df_value;
|
||||
};
|
||||
|
||||
typedef struct def t_def;
|
||||
|
||||
/* ALLOCDEF "def" 50 */
|
||||
|
||||
|
||||
#define NULLDEF ((t_def *) 0)
|
||||
#define NULLDEF ((struct def *) 0)
|
||||
|
||||
typedef struct scope t_scope;
|
||||
typedef struct idf t_idf;
|
||||
typedef struct type t_type;
|
||||
struct scope;
|
||||
struct idf;
|
||||
|
||||
t_def *MkDef(register t_idf *id, register t_scope *scope, int kind);
|
||||
t_def *define(register t_idf *id, register t_scope *scope, int kind);
|
||||
void RemoveFromIdList(register t_def *df);
|
||||
t_def * DeclProc(int type, register t_idf *id);
|
||||
void EndProc(register t_def *df, t_idf *id);
|
||||
t_def * DefineLocalModule(t_idf *id);
|
||||
void CheckWithDef(register t_def *df, t_type *tp);
|
||||
void end_definition_list(register t_def **pdf);
|
||||
|
||||
struct def *MkDef(register struct idf *id, register struct scope *scope, int kind);
|
||||
struct def *define(register struct idf *id, register struct scope *scope, int kind);
|
||||
void RemoveFromIdList(register struct def *df);
|
||||
struct def * DeclProc(int type, register struct idf *id);
|
||||
void EndProc(register struct def *df, struct idf *id);
|
||||
struct def * DefineLocalModule(struct idf *id);
|
||||
void CheckWithDef(register struct def *df, struct type *tp);
|
||||
void end_definition_list(register struct def **pdf);
|
||||
|
||||
#endif /* DEF_H_ */
|
|
@ -41,7 +41,7 @@ size_t sys_filesize();
|
|||
|
||||
extern void DefModule(void); /* Lpars */
|
||||
|
||||
t_idf* DefId;
|
||||
struct idf* DefId;
|
||||
|
||||
char* getwdir(register char *fn)
|
||||
{
|
||||
|
@ -90,19 +90,19 @@ static int GetFile(char *name)
|
|||
return 1;
|
||||
}
|
||||
|
||||
t_def* GetDefinitionModule(register t_idf* id, int incr)
|
||||
struct def* GetDefinitionModule(register struct idf* id, int incr)
|
||||
{
|
||||
/* Return a pointer to the "def" structure of the definition
|
||||
module indicated by "id".
|
||||
We may have to read the definition module itself.
|
||||
Also increment level by "incr".
|
||||
*/
|
||||
register t_def* df;
|
||||
register struct def* df;
|
||||
static int level;
|
||||
t_scopelist* vis;
|
||||
struct scopelist* vis;
|
||||
char* fn = FileName;
|
||||
int ln = LineNumber;
|
||||
t_scope* newsc;
|
||||
struct scope* newsc;
|
||||
|
||||
level += incr;
|
||||
df = lookup(id, GlobalScope, D_IMPORTED, 0);
|
||||
|
@ -139,9 +139,9 @@ t_def* GetDefinitionModule(register t_idf* id, int incr)
|
|||
remember its name because we have
|
||||
to call its initialization routine
|
||||
*/
|
||||
static t_node* nd_end;
|
||||
register t_node* n;
|
||||
extern t_node* Modules;
|
||||
static struct node* nd_end;
|
||||
register struct node* n;
|
||||
extern struct node* Modules;
|
||||
|
||||
n = dot2leaf(Def);
|
||||
n->nd_def = newsc->sc_definedby;
|
||||
|
|
|
@ -40,7 +40,7 @@
|
|||
extern int proclevel;
|
||||
extern char options[];
|
||||
|
||||
static int WordOrDouble(t_desig *ds, arith size)
|
||||
static int WordOrDouble(struct desig *ds, arith size)
|
||||
{
|
||||
/* Check if designator is suitable for word or double-word
|
||||
operation
|
||||
|
@ -80,7 +80,7 @@ void STL(arith offset, arith size)
|
|||
}
|
||||
}
|
||||
|
||||
int DoLoad(register t_desig *ds, arith size)
|
||||
int DoLoad(register struct desig *ds, arith size)
|
||||
{
|
||||
/* Try to load designator with word or double-word operation.
|
||||
Return 0 if not done
|
||||
|
@ -104,7 +104,7 @@ int DoLoad(register t_desig *ds, arith size)
|
|||
return 1;
|
||||
}
|
||||
|
||||
int DoStore(register t_desig *ds, arith size)
|
||||
int DoStore(register struct desig *ds, arith size)
|
||||
{
|
||||
/* Try to store designator with word or double-word operation.
|
||||
Return 0 if not done
|
||||
|
@ -152,7 +152,7 @@ int DoStore(register t_desig *ds, arith size)
|
|||
multiple of word_size only
|
||||
*/
|
||||
|
||||
static int suitable_move(register t_type *tp)
|
||||
static int suitable_move(register struct type *tp)
|
||||
{
|
||||
/* Find out how to load or store the value indicated by "ds".
|
||||
There are four ways:
|
||||
|
@ -170,7 +170,7 @@ static int suitable_move(register t_type *tp)
|
|||
return USE_BLM;
|
||||
}
|
||||
|
||||
void CodeValue(register t_desig *ds, register t_type *tp)
|
||||
void CodeValue(register struct desig *ds, register struct type *tp)
|
||||
{
|
||||
/* Generate code to load the value of the designator described
|
||||
in "ds".
|
||||
|
@ -233,12 +233,12 @@ void CodeValue(register t_desig *ds, register t_type *tp)
|
|||
ds->dsg_kind = DSG_LOADED;
|
||||
}
|
||||
|
||||
void ChkForFOR(register t_node *nd)
|
||||
void ChkForFOR(register struct node *nd)
|
||||
{
|
||||
/* Check for an assignment to a FOR-loop control variable
|
||||
*/
|
||||
if (nd->nd_class == Def) {
|
||||
register t_def *df = nd->nd_def;
|
||||
register struct def *df = nd->nd_def;
|
||||
|
||||
if (df->df_flags & D_FORLOOP) {
|
||||
node_warning(nd,
|
||||
|
@ -250,7 +250,7 @@ void ChkForFOR(register t_node *nd)
|
|||
}
|
||||
}
|
||||
|
||||
void CodeStore(register t_desig *ds, register t_type *tp)
|
||||
void CodeStore(register struct desig *ds, register struct type *tp)
|
||||
{
|
||||
/* Generate code to store the value on the stack in the designator
|
||||
described in "ds"
|
||||
|
@ -295,12 +295,12 @@ void CodeStore(register t_desig *ds, register t_type *tp)
|
|||
ds->dsg_kind = DSG_INIT;
|
||||
}
|
||||
|
||||
void CodeCopy(register t_desig *lhs, register t_desig *rhs, arith sz, arith *psize)
|
||||
void CodeCopy(register struct desig *lhs, register struct desig *rhs, arith sz, arith *psize)
|
||||
{
|
||||
/* Do part of a copy, which is assumed to be "reasonable",
|
||||
so that it can be done with LOI/STI or BLM.
|
||||
*/
|
||||
t_desig l, r;
|
||||
struct desig l, r;
|
||||
|
||||
l = *lhs; r = *rhs;
|
||||
*psize -= sz;
|
||||
|
@ -318,17 +318,17 @@ void CodeCopy(register t_desig *lhs, register t_desig *rhs, arith sz, arith *psi
|
|||
}
|
||||
}
|
||||
|
||||
t_desig null_desig;
|
||||
struct desig null_desig;
|
||||
|
||||
void CodeMove(register t_desig *rhs, register t_node *left, t_type *rtp)
|
||||
void CodeMove(register struct desig *rhs, register struct node *left, struct type *rtp)
|
||||
{
|
||||
/* Generate code for an assignment. Testing of type
|
||||
compatibility and the like is already done.
|
||||
Go through some (considerable) trouble to see if a BLM can be
|
||||
generated.
|
||||
*/
|
||||
t_desig lhs;
|
||||
register t_type *tp = left->nd_type;
|
||||
struct desig lhs;
|
||||
register struct type *tp = left->nd_type;
|
||||
int loadedflag = 0;
|
||||
|
||||
lhs = null_desig;
|
||||
|
@ -419,7 +419,7 @@ void CodeMove(register t_desig *rhs, register t_node *left, t_type *rtp)
|
|||
}
|
||||
}
|
||||
|
||||
void CodeAddress(register t_desig *ds)
|
||||
void CodeAddress(register struct desig *ds)
|
||||
{
|
||||
/* Generate code to load the address of the designator described
|
||||
in "ds"
|
||||
|
@ -459,7 +459,7 @@ void CodeAddress(register t_desig *ds)
|
|||
ds->dsg_kind = DSG_PLOADED;
|
||||
}
|
||||
|
||||
void CodeFieldDesig(register t_def *df, register t_desig *ds)
|
||||
void CodeFieldDesig(register struct def *df, register struct desig *ds)
|
||||
{
|
||||
/* Generate code for a field designator. Only the code common for
|
||||
address as well as value computation is generated, and the
|
||||
|
@ -509,14 +509,14 @@ void CodeFieldDesig(register t_def *df, register t_desig *ds)
|
|||
}
|
||||
}
|
||||
|
||||
void CodeVarDesig(register t_def *df, register t_desig *ds)
|
||||
void CodeVarDesig(register struct def *df, register struct desig *ds)
|
||||
{
|
||||
/* Generate code for a variable represented by a "def" structure.
|
||||
Of course, there are numerous cases: the variable is local,
|
||||
it is a value parameter, it is a var parameter, it is one of
|
||||
those of an enclosing procedure, or it is global.
|
||||
*/
|
||||
register t_scope *sc = df->df_scope;
|
||||
register struct scope *sc = df->df_scope;
|
||||
int difflevel;
|
||||
|
||||
/* Selections from a module are handled earlier, when identifying
|
||||
|
@ -585,12 +585,12 @@ void CodeVarDesig(register t_def *df, register t_desig *ds)
|
|||
ds->dsg_def = df;
|
||||
}
|
||||
|
||||
void CodeDesig(register t_node *nd, register t_desig *ds)
|
||||
void CodeDesig(register struct node *nd, register struct desig *ds)
|
||||
{
|
||||
/* Generate code for a designator. Use divide and conquer
|
||||
principle
|
||||
*/
|
||||
register t_def *df;
|
||||
register struct def *df;
|
||||
|
||||
switch(nd->nd_class) { /* Divide */
|
||||
case Def:
|
||||
|
|
|
@ -49,7 +49,6 @@ struct desig {
|
|||
*/
|
||||
};
|
||||
|
||||
typedef struct desig t_desig;
|
||||
|
||||
/* The next structure describes the designator in a with-statement.
|
||||
We have a linked list of them, as with-statements may be nested.
|
||||
|
@ -61,7 +60,7 @@ struct withdesig {
|
|||
struct scope *w_scope; /* scope in which fields of this record
|
||||
reside
|
||||
*/
|
||||
t_desig w_desig; /* a desig structure for this particular
|
||||
struct desig w_desig; /* a desig structure for this particular
|
||||
designator
|
||||
*/
|
||||
};
|
||||
|
@ -70,20 +69,20 @@ extern struct withdesig *WithDesigs;
|
|||
|
||||
#define NO_LABEL ((label) 0)
|
||||
|
||||
typedef struct type t_type;
|
||||
typedef struct node t_node;
|
||||
struct type;
|
||||
struct node;
|
||||
|
||||
|
||||
void LOL(arith offset, arith size);
|
||||
void STL(arith offset, arith size);
|
||||
void CodeValue(register t_desig *ds, register t_type *tp);
|
||||
void ChkForFOR(register t_node *nd);
|
||||
void CodeStore(register t_desig *ds, register t_type *tp);
|
||||
void CodeCopy(register t_desig *lhs, register t_desig *rhs, arith sz, arith *psize);
|
||||
void CodeMove(register t_desig *rhs, register t_node *left, t_type *rtp);
|
||||
void CodeAddress(register t_desig *ds);
|
||||
void CodeFieldDesig(register t_def *df, register t_desig *ds);
|
||||
void CodeVarDesig(register t_def *df, register t_desig *ds);
|
||||
void CodeDesig(register t_node *nd, register t_desig *ds);
|
||||
void CodeValue(register struct desig *ds, register struct type *tp);
|
||||
void ChkForFOR(register struct node *nd);
|
||||
void CodeStore(register struct desig *ds, register struct type *tp);
|
||||
void CodeCopy(register struct desig *lhs, register struct desig *rhs, arith sz, arith *psize);
|
||||
void CodeMove(register struct desig *rhs, register struct node *left, struct type *rtp);
|
||||
void CodeAddress(register struct desig *ds);
|
||||
void CodeFieldDesig(register struct def *df, register struct desig *ds);
|
||||
void CodeVarDesig(register struct def *df, register struct desig *ds);
|
||||
void CodeDesig(register struct node *nd, register struct desig *ds);
|
||||
|
||||
#endif /* DESIG_H_ */
|
||||
|
|
|
@ -37,15 +37,15 @@
|
|||
#include "f_info.h"
|
||||
|
||||
|
||||
static t_def *DoImport(register t_def *, t_scope *, int);
|
||||
static struct def *DoImport(register struct def *, struct scope *, int);
|
||||
|
||||
t_def *Enter(char *name, int kind, t_type *type, int pnam)
|
||||
struct def *Enter(char *name, int kind, struct type *type, int pnam)
|
||||
{
|
||||
/* Enter a definition for "name" with kind "kind" and type
|
||||
"type" in the Current Scope. If it is a standard name, also
|
||||
put its number in the definition structure.
|
||||
*/
|
||||
register t_def *df;
|
||||
register struct def *df;
|
||||
|
||||
df = define(str2idf(name, 0), CurrentScope, kind);
|
||||
df->df_type = type;
|
||||
|
@ -56,7 +56,7 @@ t_def *Enter(char *name, int kind, t_type *type, int pnam)
|
|||
return df;
|
||||
}
|
||||
|
||||
t_def *EnterType(char *name, t_type *type)
|
||||
struct def *EnterType(char *name, struct type *type)
|
||||
{
|
||||
/* Enter a type definition for "name" and type
|
||||
"type" in the Current Scope.
|
||||
|
@ -65,7 +65,7 @@ t_def *EnterType(char *name, t_type *type)
|
|||
return Enter(name, D_TYPE, type, 0);
|
||||
}
|
||||
|
||||
void EnterEnumList(t_node *Idlist, register t_type *type)
|
||||
void EnterEnumList(struct node *Idlist, register struct type *type)
|
||||
{
|
||||
/* Put a list of enumeration literals in the symbol table.
|
||||
They all have type "type".
|
||||
|
@ -74,8 +74,8 @@ void EnterEnumList(t_node *Idlist, register t_type *type)
|
|||
be exported, in which case its literals must also be exported.
|
||||
Thus, we need an easy way to get to them.
|
||||
*/
|
||||
register t_def *df, *df1 = 0;
|
||||
register t_node *idlist = Idlist;
|
||||
register struct def *df, *df1 = 0;
|
||||
register struct node *idlist = Idlist;
|
||||
|
||||
type->enm_ncst = 0;
|
||||
for (; idlist; idlist = idlist->nd_NEXT) {
|
||||
|
@ -91,7 +91,7 @@ void EnterEnumList(t_node *Idlist, register t_type *type)
|
|||
FreeNode(Idlist);
|
||||
}
|
||||
|
||||
void EnterFieldList(t_node *Idlist, register t_type *type, t_scope *scope,
|
||||
void EnterFieldList(struct node *Idlist, register struct type *type, struct scope *scope,
|
||||
arith *addr)
|
||||
{
|
||||
/* Put a list of fields in the symbol table.
|
||||
|
@ -99,8 +99,8 @@ void EnterFieldList(t_node *Idlist, register t_type *type, t_scope *scope,
|
|||
Mark them as QUALIFIED EXPORT, because that's exactly what
|
||||
fields are, you can get to them by qualifying them.
|
||||
*/
|
||||
register t_def *df;
|
||||
register t_node *idlist = Idlist;
|
||||
register struct def *df;
|
||||
register struct node *idlist = Idlist;
|
||||
|
||||
for (; idlist; idlist = idlist->nd_NEXT) {
|
||||
df = define(idlist->nd_IDF, scope, D_FIELD);
|
||||
|
@ -112,11 +112,11 @@ void EnterFieldList(t_node *Idlist, register t_type *type, t_scope *scope,
|
|||
FreeNode(Idlist);
|
||||
}
|
||||
|
||||
void EnterVarList(t_node *Idlist, t_type *type, int local)
|
||||
void EnterVarList(struct node *Idlist, struct type *type, int local)
|
||||
{
|
||||
register t_def *df;
|
||||
register t_node *idlist = Idlist;
|
||||
register t_scopelist *sc = CurrVis;
|
||||
register struct def *df;
|
||||
register struct node *idlist = Idlist;
|
||||
register struct scopelist *sc = CurrVis;
|
||||
char buf[256];
|
||||
extern char *sprint();
|
||||
|
||||
|
@ -133,7 +133,7 @@ void EnterVarList(t_node *Idlist, t_type *type, int local)
|
|||
if (idlist->nd_LEFT->nd_NEXT) {
|
||||
/* An address was supplied
|
||||
*/
|
||||
register t_type *tp = idlist->nd_LEFT->nd_NEXT->nd_type;
|
||||
register struct type *tp = idlist->nd_LEFT->nd_NEXT->nd_type;
|
||||
|
||||
df->df_flags |= D_ADDRGIVEN | D_NOREG;
|
||||
if (tp != error_type && !(tp->tp_fund & T_CARDINAL)){
|
||||
|
@ -180,17 +180,17 @@ void EnterVarList(t_node *Idlist, t_type *type, int local)
|
|||
FreeNode(Idlist);
|
||||
}
|
||||
|
||||
void EnterParamList(t_param **ppr,
|
||||
t_node *Idlist,
|
||||
t_type *type,
|
||||
void EnterParamList(struct paramlist **ppr,
|
||||
struct node *Idlist,
|
||||
struct type *type,
|
||||
int VARp,
|
||||
arith *off)
|
||||
{
|
||||
register t_param *pr;
|
||||
register t_def *df;
|
||||
register t_node *idlist = Idlist;
|
||||
t_node *dummy = 0;
|
||||
static t_param *last;
|
||||
register struct paramlist *pr;
|
||||
register struct def *df;
|
||||
register struct node *idlist = Idlist;
|
||||
struct node *dummy = 0;
|
||||
static struct paramlist *last;
|
||||
|
||||
if (! idlist) {
|
||||
/* Can only happen when a procedure type is defined */
|
||||
|
@ -230,14 +230,14 @@ void EnterParamList(t_param **ppr,
|
|||
}
|
||||
|
||||
|
||||
static void ImportEffects(register t_def *idef, t_scope *scope, int flag)
|
||||
static void ImportEffects(register struct def *idef, struct scope *scope, int flag)
|
||||
{
|
||||
/* Handle side effects of an import:
|
||||
- a module could have unqualified exports ???
|
||||
- importing an enumeration type also imports literals
|
||||
*/
|
||||
register t_def *df = idef;
|
||||
register t_type *tp;
|
||||
register struct def *df = idef;
|
||||
register struct type *tp;
|
||||
|
||||
while ((df->df_kind & D_IMPORTED) && df->imp_def != df) {
|
||||
/* The second condition could occur on some (erroneous and
|
||||
|
@ -262,7 +262,7 @@ static void ImportEffects(register t_def *idef, t_scope *scope, int flag)
|
|||
in some way, don't do it again; we don't want
|
||||
a multiple defined error message here.
|
||||
*/
|
||||
t_def *df1;
|
||||
struct def *df1;
|
||||
|
||||
df->df_flags |= D_QEXPORTED;
|
||||
if ((!(df1 = lookup(df->df_idf, scope, D_IMPORT, 0)) ||
|
||||
|
@ -296,11 +296,11 @@ static void ImportEffects(register t_def *idef, t_scope *scope, int flag)
|
|||
}
|
||||
}
|
||||
|
||||
static t_def *DoImport(register t_def *df, t_scope *scope, int flag)
|
||||
static struct def *DoImport(register struct def *df, struct scope *scope, int flag)
|
||||
{
|
||||
/* Definition "df" is imported to scope "scope".
|
||||
*/
|
||||
register t_def *idef = define(df->df_idf, scope, D_IMPORT);
|
||||
register struct def *idef = define(df->df_idf, scope, D_IMPORT);
|
||||
|
||||
idef->imp_def = df;
|
||||
idef->df_flags |= flag;
|
||||
|
@ -309,13 +309,13 @@ static t_def *DoImport(register t_def *df, t_scope *scope, int flag)
|
|||
}
|
||||
|
||||
|
||||
static void ForwModule(register t_def *df, t_node *nd)
|
||||
static void ForwModule(register struct def *df, struct node *nd)
|
||||
{
|
||||
/* An import is done from a not yet defined module "df".
|
||||
We could also end up here for not found DEFINITION MODULES.
|
||||
Create a declaration and a scope for this module.
|
||||
*/
|
||||
register t_scopelist *vis;
|
||||
register struct scopelist *vis;
|
||||
|
||||
if (df->df_scope != GlobalScope) {
|
||||
df->df_scope = enclosing(CurrVis)->sc_scope;
|
||||
|
@ -334,12 +334,12 @@ static void ForwModule(register t_def *df, t_node *nd)
|
|||
df->for_node = nd;
|
||||
}
|
||||
|
||||
static t_def *ForwDef(register t_node *ids, t_scope *scope)
|
||||
static struct def *ForwDef(register struct node *ids, struct scope *scope)
|
||||
{
|
||||
/* Enter a forward definition of "ids" in scope "scope",
|
||||
if it is not already defined.
|
||||
*/
|
||||
register t_def *df;
|
||||
register struct def *df;
|
||||
|
||||
if (!(df = lookup(ids->nd_IDF, scope, 0, 0))) {
|
||||
df = define(ids->nd_IDF, scope, D_FORWARD);
|
||||
|
@ -350,10 +350,10 @@ static t_def *ForwDef(register t_node *ids, t_scope *scope)
|
|||
return df;
|
||||
}
|
||||
|
||||
void EnterExportList(t_node *Idlist, int qualified)
|
||||
void EnterExportList(struct node *Idlist, int qualified)
|
||||
{
|
||||
register t_node *idlist = Idlist;
|
||||
register t_def *df, *df1;
|
||||
register struct node *idlist = Idlist;
|
||||
register struct def *df, *df1;
|
||||
|
||||
for (;idlist; idlist = idlist->nd_NEXT) {
|
||||
df = lookup(idlist->nd_IDF, CurrentScope, 0, 0);
|
||||
|
@ -400,7 +400,7 @@ void EnterExportList(t_node *Idlist, int qualified)
|
|||
scope. There are two legal possibilities,
|
||||
which are examined below.
|
||||
*/
|
||||
t_def *df2 = df;
|
||||
struct def *df2 = df;
|
||||
|
||||
while (df2->df_kind & D_IMPORTED) {
|
||||
df2 = df2->imp_def;
|
||||
|
@ -426,16 +426,16 @@ void EnterExportList(t_node *Idlist, int qualified)
|
|||
FreeNode(Idlist);
|
||||
}
|
||||
|
||||
void CheckForImports(t_def *df)
|
||||
void CheckForImports(struct def *df)
|
||||
{
|
||||
/* We have a definition for "df"; check all imports of
|
||||
it for side-effects
|
||||
*/
|
||||
register t_def *df1 = df->df_idf->id_def;
|
||||
register struct def *df1 = df->df_idf->id_def;
|
||||
|
||||
while (df1) {
|
||||
if (df1->df_kind & D_IMPORTED) {
|
||||
register t_def *df2 = df1->imp_def;
|
||||
register struct def *df2 = df1->imp_def;
|
||||
|
||||
while (df2->df_kind & D_IMPORTED) df2 = df2->imp_def;
|
||||
if (df2 == df) {
|
||||
|
@ -446,12 +446,12 @@ void CheckForImports(t_def *df)
|
|||
}
|
||||
}
|
||||
|
||||
void EnterFromImportList(t_node *idlist, t_def *FromDef, t_node *FromId)
|
||||
void EnterFromImportList(struct node *idlist, struct def *FromDef, struct node *FromId)
|
||||
{
|
||||
/* Import the list Idlist from the module indicated by Fromdef.
|
||||
*/
|
||||
t_scope *sc;
|
||||
register t_def *df;
|
||||
struct scope *sc;
|
||||
register struct def *df;
|
||||
char *module_name = FromDef->df_idf->id_text;
|
||||
|
||||
switch(FromDef->df_kind) {
|
||||
|
@ -504,13 +504,13 @@ node_error(FromId,"identifier \"%s\" does not represent a module",module_name);
|
|||
FreeNode(FromId);
|
||||
}
|
||||
|
||||
void EnterImportList(t_node *idlist, int local, t_scope *sc)
|
||||
void EnterImportList(struct node *idlist, int local, struct scope *sc)
|
||||
{
|
||||
/* Import "idlist" from scope "sc".
|
||||
If the import is not local, definition modules must be read
|
||||
for "idlist".
|
||||
*/
|
||||
extern t_def *GetDefinitionModule();
|
||||
extern struct def *GetDefinitionModule();
|
||||
struct f_info f;
|
||||
|
||||
f = file_info;
|
||||
|
|
|
@ -9,38 +9,38 @@
|
|||
#define ENTER_H_
|
||||
|
||||
/* Forward declarations. */
|
||||
typedef struct type t_type;
|
||||
typedef struct def t_def;
|
||||
typedef struct node t_node;
|
||||
typedef struct scope t_scope;
|
||||
typedef struct paramlist t_param;
|
||||
struct type;
|
||||
struct node;
|
||||
struct scope;
|
||||
struct paramlist;
|
||||
struct def;
|
||||
|
||||
|
||||
t_def *Enter(char *name, int kind, t_type *type, int pnam);
|
||||
t_def *EnterType(char *name, t_type *type);
|
||||
void EnterEnumList(t_node *Idlist, register t_type *type);
|
||||
void EnterFieldList(t_node *Idlist, register t_type *type, t_scope *scope,
|
||||
struct def *Enter(char *name, int kind, struct type *type, int pnam);
|
||||
struct def *EnterType(char *name, struct type *type);
|
||||
void EnterEnumList(struct node *Idlist, register struct type *type);
|
||||
void EnterFieldList(struct node *Idlist, register struct type *type, struct scope *scope,
|
||||
arith *addr);
|
||||
/* Enter a list of identifiers representing variables into the
|
||||
name list. "type" represents the type of the variables.
|
||||
"local" is set if the variables are declared local to a
|
||||
procedure.
|
||||
*/
|
||||
void EnterVarList(t_node *Idlist, t_type *type, int local);
|
||||
void EnterVarList(struct node *Idlist, struct type *type, int local);
|
||||
/* Create (part of) a parameterlist of a procedure.
|
||||
"ids" indicates the list of identifiers, "tp" their type, and
|
||||
"VARp" indicates D_VARPAR or D_VALPAR.
|
||||
*/
|
||||
void EnterParamList(t_param **ppr, t_node *Idlist, t_type *type,
|
||||
void EnterParamList(struct paramlist **ppr, struct node *Idlist, struct type *type,
|
||||
int VARp, arith *off);
|
||||
/* From the current scope, the list of identifiers "ids" is
|
||||
exported. Note this fact. If the export is not qualified, make
|
||||
all the "ids" visible in the enclosing scope by defining them
|
||||
in this scope as "imported".
|
||||
*/
|
||||
void EnterExportList(t_node *Idlist, int qualified);
|
||||
void CheckForImports(t_def *df);
|
||||
void EnterFromImportList(t_node *idlist, t_def *FromDef, t_node *FromId);
|
||||
void EnterImportList(t_node *idlist, int local, t_scope *sc);
|
||||
void EnterExportList(struct node *Idlist, int qualified);
|
||||
void CheckForImports(struct def *df);
|
||||
void EnterFromImportList(struct node *idlist, struct def *FromDef, struct node *FromId);
|
||||
void EnterImportList(struct node *idlist, int local, struct scope *sc);
|
||||
|
||||
#endif /* ENTER_H_ */
|
||||
|
|
|
@ -62,7 +62,7 @@ extern char *symbol2str();
|
|||
FileName, node errors get their information from the
|
||||
node, whereas other errors use the information in the token.
|
||||
*/
|
||||
static void _error(int, t_node *, char *, register va_list, int);
|
||||
static void _error(int, struct node *, char *, register va_list, int);
|
||||
|
||||
#if __STDC__
|
||||
#ifdef DEBUG
|
||||
|
@ -92,7 +92,7 @@ void error(char *fmt, ...)
|
|||
}
|
||||
|
||||
/*VARARGS*/
|
||||
void node_error(t_node *node, char *fmt, ...)
|
||||
void node_error(struct node *node, char *fmt, ...)
|
||||
{
|
||||
va_list ap;
|
||||
|
||||
|
@ -116,7 +116,7 @@ void warning(int class, char *fmt, ...)
|
|||
}
|
||||
|
||||
/*VARARGS*/
|
||||
void node_warning(t_node *node, int class, char *fmt, ...)
|
||||
void node_warning(struct node *node, int class, char *fmt, ...)
|
||||
{
|
||||
va_list ap;
|
||||
|
||||
|
@ -219,7 +219,7 @@ void node_error(va_alist)
|
|||
|
||||
va_start(ap);
|
||||
{
|
||||
t_node *node = va_arg(ap, t_node *);
|
||||
struct node *node = va_arg(ap, struct node *);
|
||||
char *fmt = va_arg(ap, char *);
|
||||
_error(ERROR, node, fmt, ap, 0);
|
||||
}
|
||||
|
@ -249,7 +249,7 @@ void node_warning(va_alist)
|
|||
|
||||
va_start(ap);
|
||||
{
|
||||
t_node *nd = va_arg(ap, t_node *);
|
||||
struct node *nd = va_arg(ap, struct node *);
|
||||
int class = va_arg(ap, int);
|
||||
char *fmt = va_arg(ap, char *);
|
||||
_error(WARNING, nd, fmt, ap, class);
|
||||
|
@ -321,7 +321,7 @@ void crash(va_alist)
|
|||
}
|
||||
#endif
|
||||
|
||||
static void _error(int class, t_node *node, char *fmt, register va_list ap, int warn_class)
|
||||
static void _error(int class, struct node *node, char *fmt, register va_list ap, int warn_class)
|
||||
{
|
||||
/* _error attempts to limit the number of error messages
|
||||
for a given line to MAXERR_LINE.
|
||||
|
|
|
@ -8,7 +8,7 @@
|
|||
#ifndef ERROR_H_
|
||||
#define ERROR_H_
|
||||
|
||||
typedef struct node t_node;
|
||||
struct node;
|
||||
|
||||
#if __STDC__
|
||||
#ifdef DEBUG
|
||||
|
@ -19,11 +19,11 @@ void debug(char *fmt, ...);
|
|||
/*VARARGS*/
|
||||
void error(char *fmt, ...);
|
||||
/*VARARGS*/
|
||||
void node_error(t_node *node, char *fmt, ...);
|
||||
void node_error(struct node *node, char *fmt, ...);
|
||||
/*VARARGS*/
|
||||
void warning(int class, char *fmt, ...);
|
||||
/*VARARGS*/
|
||||
void node_warning(t_node *node, int class, char *fmt, ...);
|
||||
void node_warning(struct node *node, int class, char *fmt, ...);
|
||||
/*VARARGS*/
|
||||
void lexerror(char *fmt, ...);
|
||||
/*VARARGS*/
|
||||
|
|
|
@ -31,7 +31,7 @@ extern char options[];
|
|||
}
|
||||
|
||||
/* inline, we need room for pdp/11
|
||||
number(t_node **p;) :
|
||||
number(struct node **p;) :
|
||||
[
|
||||
%default
|
||||
INTEGER
|
||||
|
@ -43,7 +43,7 @@ number(t_node **p;) :
|
|||
;
|
||||
*/
|
||||
|
||||
qualident(t_node **p;)
|
||||
qualident(struct node **p;)
|
||||
{
|
||||
} :
|
||||
IDENT { *p = dot2leaf(Name); }
|
||||
|
@ -52,16 +52,16 @@ qualident(t_node **p;)
|
|||
]*
|
||||
;
|
||||
|
||||
selector(register t_node **pnd;)
|
||||
{ t_node *nd;
|
||||
selector(register struct node **pnd;)
|
||||
{ struct node *nd;
|
||||
} :
|
||||
'.' { nd = dot2leaf(Select); nd->nd_NEXT = *pnd; *pnd = nd; }
|
||||
IDENT { (*pnd)->nd_IDF = dot.TOK_IDF; }
|
||||
;
|
||||
|
||||
ExpList(t_node **pnd;)
|
||||
ExpList(struct node **pnd;)
|
||||
{
|
||||
register t_node *nd;
|
||||
register struct node *nd;
|
||||
} :
|
||||
expression(pnd) { *pnd = nd = dot2node(Link,*pnd,NULLNODE);
|
||||
nd->nd_symb = ',';
|
||||
|
@ -74,7 +74,7 @@ ExpList(t_node **pnd;)
|
|||
]*
|
||||
;
|
||||
|
||||
ConstExpression(register t_node **pnd;)
|
||||
ConstExpression(register struct node **pnd;)
|
||||
{
|
||||
}:
|
||||
expression(pnd)
|
||||
|
@ -98,7 +98,7 @@ ConstExpression(register t_node **pnd;)
|
|||
}
|
||||
;
|
||||
|
||||
expression(register t_node **pnd;)
|
||||
expression(register struct node **pnd;)
|
||||
{
|
||||
} :
|
||||
SimpleExpression(pnd)
|
||||
|
@ -117,9 +117,9 @@ relation:
|
|||
;
|
||||
*/
|
||||
|
||||
SimpleExpression(register t_node **pnd;)
|
||||
SimpleExpression(register struct node **pnd;)
|
||||
{
|
||||
register t_node *nd = 0;
|
||||
register struct node *nd = 0;
|
||||
} :
|
||||
[
|
||||
[ '+' | '-' ]
|
||||
|
@ -150,9 +150,9 @@ AddOperator:
|
|||
;
|
||||
*/
|
||||
|
||||
term(t_node **pnd;)
|
||||
term(struct node **pnd;)
|
||||
{
|
||||
register t_node *nd;
|
||||
register struct node *nd;
|
||||
}:
|
||||
factor(pnd) { nd = *pnd; }
|
||||
[
|
||||
|
@ -170,10 +170,10 @@ MulOperator:
|
|||
;
|
||||
*/
|
||||
|
||||
factor(register t_node **p;)
|
||||
factor(register struct node **p;)
|
||||
{
|
||||
register t_node *nd;
|
||||
t_node *nd1;
|
||||
register struct node *nd;
|
||||
struct node *nd1;
|
||||
} :
|
||||
qualident(p)
|
||||
[
|
||||
|
@ -224,9 +224,9 @@ factor(register t_node **p;)
|
|||
factor(&((*p)->nd_RIGHT))
|
||||
;
|
||||
|
||||
bare_set(t_node **pnd;)
|
||||
bare_set(struct node **pnd;)
|
||||
{
|
||||
register t_node *nd;
|
||||
register struct node *nd;
|
||||
} :
|
||||
'{' { DOT = SET;
|
||||
*pnd = nd = dot2leaf(Xset);
|
||||
|
@ -242,11 +242,11 @@ bare_set(t_node **pnd;)
|
|||
'}'
|
||||
;
|
||||
|
||||
ActualParameters(t_node **pnd;):
|
||||
ActualParameters(struct node **pnd;):
|
||||
'(' ExpList(pnd)? ')'
|
||||
;
|
||||
|
||||
element(register t_node *nd;) :
|
||||
element(register struct node *nd;) :
|
||||
expression(&(nd->nd_RIGHT))
|
||||
[
|
||||
UPTO
|
||||
|
@ -259,13 +259,13 @@ element(register t_node *nd;) :
|
|||
}
|
||||
;
|
||||
|
||||
designator(t_node **pnd;)
|
||||
designator(struct node **pnd;)
|
||||
:
|
||||
qualident(pnd)
|
||||
designator_tail(pnd)
|
||||
;
|
||||
|
||||
designator_tail(register t_node **pnd;):
|
||||
designator_tail(register struct node **pnd;):
|
||||
visible_designator_tail(pnd)
|
||||
[ %persistent
|
||||
%default
|
||||
|
@ -276,9 +276,9 @@ designator_tail(register t_node **pnd;):
|
|||
|
|
||||
;
|
||||
|
||||
visible_designator_tail(t_node **pnd;)
|
||||
visible_designator_tail(struct node **pnd;)
|
||||
{
|
||||
register t_node *nd = *pnd;
|
||||
register struct node *nd = *pnd;
|
||||
}:
|
||||
'[' { nd = dot2node(Arrsel, nd, NULLNODE); }
|
||||
expression(&(nd->nd_RIGHT))
|
||||
|
|
|
@ -20,4 +20,4 @@ struct id_u {
|
|||
|
||||
#include <idf_pkg.spec>
|
||||
|
||||
typedef struct idf t_idf;
|
||||
|
||||
|
|
|
@ -30,14 +30,14 @@ extern int pass_1;
|
|||
extern char options[];
|
||||
#endif
|
||||
|
||||
t_def *lookup(register t_idf *id, t_scope *scope, int import, int flags)
|
||||
struct def *lookup(register struct idf *id, struct scope *scope, int import, int flags)
|
||||
{
|
||||
/* Look up a definition of an identifier in scope "scope".
|
||||
Make the "def" list self-organizing.
|
||||
Return a pointer to its "def" structure if it exists,
|
||||
otherwise return 0.
|
||||
*/
|
||||
register t_def *df, *df1;
|
||||
register struct def *df, *df1;
|
||||
|
||||
/* Look in the chain of definitions of this "id" for one with scope
|
||||
"scope".
|
||||
|
@ -72,15 +72,15 @@ t_def *lookup(register t_idf *id, t_scope *scope, int import, int flags)
|
|||
return df;
|
||||
}
|
||||
|
||||
t_def *lookfor(register t_node *id, register t_scopelist *vis, int message, int flags)
|
||||
struct def *lookfor(register struct node *id, register struct scopelist *vis, int message, int flags)
|
||||
{
|
||||
/* Look for an identifier in the visibility range started by "vis".
|
||||
If it is not defined create a dummy definition and,
|
||||
if message is set, give an error message
|
||||
*/
|
||||
register t_scopelist *sc;
|
||||
t_scopelist *sc1 = 0;
|
||||
t_def *df;
|
||||
register struct scopelist *sc;
|
||||
struct scopelist *sc1 = 0;
|
||||
struct def *df;
|
||||
|
||||
for (sc = vis; sc; sc = nextvisible(sc)) {
|
||||
df = lookup(id->nd_IDF, sc->sc_scope, D_IMPORTED, flags);
|
||||
|
|
|
@ -9,13 +9,13 @@
|
|||
#define LOOKUP_H_
|
||||
|
||||
/* Forward declarations. */
|
||||
typedef struct idf t_idf;
|
||||
typedef struct scope t_scope;
|
||||
typedef struct node t_node;
|
||||
typedef struct def t_def;
|
||||
typedef struct scopelist t_scopelist;
|
||||
struct idf;
|
||||
struct scope;
|
||||
struct node;
|
||||
struct scopelist;
|
||||
struct def;
|
||||
|
||||
t_def *lookup(register t_idf *id, t_scope *scope, int import, int flags);
|
||||
t_def *lookfor(register t_node *id, register t_scopelist *vis, int message, int flags);
|
||||
struct def *lookup(register struct idf *id, struct scope *scope, int import, int flags);
|
||||
struct def *lookfor(register struct node *id, register struct scopelist *vis, int message, int flags);
|
||||
|
||||
#endif /* LOOKUP_H_ */
|
||||
|
|
|
@ -47,11 +47,11 @@ char *ProgName;
|
|||
char **DEFPATH;
|
||||
int nDEF = 2, mDEF = 10;
|
||||
int pass_1 = 1;
|
||||
t_def *Defined;
|
||||
struct def *Defined;
|
||||
extern int err_occurred;
|
||||
extern int fp_used; /* set if floating point used */
|
||||
static t_node _emptystat = { Stat, 0, NULLTYPE, { ';' }};
|
||||
t_node *EmptyStatement = &_emptystat;
|
||||
static struct node _emptystat = { Stat, 0, NULLTYPE, { ';' }};
|
||||
struct node *EmptyStatement = &_emptystat;
|
||||
|
||||
|
||||
/* Forward declarations. */
|
||||
|
@ -211,7 +211,7 @@ static struct stdproc sysprocs[] = {
|
|||
{ 0, 0 }
|
||||
};
|
||||
|
||||
extern t_def *Enter(), *EnterType();
|
||||
extern struct def *Enter(), *EnterType();
|
||||
|
||||
static void AddProcs(register struct stdproc *p)
|
||||
{
|
||||
|
@ -224,7 +224,7 @@ static void AddProcs(register struct stdproc *p)
|
|||
|
||||
static void AddStandards(void)
|
||||
{
|
||||
register t_def *df;
|
||||
register struct def *df;
|
||||
static t_token nilconst = { INTEGER, 0};
|
||||
|
||||
AddProcs(stdprocs);
|
||||
|
|
|
@ -25,7 +25,7 @@
|
|||
#include "node.h"
|
||||
#include "error.h"
|
||||
|
||||
void match_id(register t_idf *id1, t_idf *id2)
|
||||
void match_id(register struct idf *id1, struct idf *id2)
|
||||
{
|
||||
/* Check that identifiers id1 and id2 are equal. If they
|
||||
are not, check that we did'nt generate them in the
|
||||
|
@ -39,7 +39,7 @@ void match_id(register t_idf *id1, t_idf *id2)
|
|||
}
|
||||
}
|
||||
|
||||
t_idf *gen_anon_idf(void)
|
||||
struct idf *gen_anon_idf(void)
|
||||
{
|
||||
/* A new idf is created out of nowhere, to serve as an
|
||||
anonymous name.
|
||||
|
@ -54,7 +54,7 @@ t_idf *gen_anon_idf(void)
|
|||
return str2idf(s, 0);
|
||||
}
|
||||
|
||||
void not_declared(char *what, t_node *id, char *where)
|
||||
void not_declared(char *what, struct node *id, char *where)
|
||||
{
|
||||
/* The identifier "id" is not declared. If it is not generated,
|
||||
give an error message
|
||||
|
|
|
@ -13,9 +13,9 @@
|
|||
#define id_not_declared(x) (not_declared("identifier", (x), ""))
|
||||
|
||||
/* Forward declarations. */
|
||||
typedef struct idf t_idf;
|
||||
typedef struct node t_node;
|
||||
struct idf;
|
||||
struct node;
|
||||
|
||||
void match_id(register t_idf *id1, t_idf *id2);
|
||||
t_idf *gen_anon_idf(void);
|
||||
void not_declared(char *what, t_node *id, char *where);
|
||||
void match_id(register struct idf *id1, struct idf *id2);
|
||||
struct idf *gen_anon_idf(void);
|
||||
void not_declared(char *what, struct node *id, char *where);
|
||||
|
|
|
@ -40,9 +40,9 @@ static int nsubnodes[] = {
|
|||
2
|
||||
};
|
||||
|
||||
t_node *getnode(int class)
|
||||
struct node *getnode(int class)
|
||||
{
|
||||
register t_node *nd = new_node();
|
||||
register struct node *nd = new_node();
|
||||
|
||||
if (options['R']) nd->nd_flags |= ROPTION;
|
||||
if (options['A']) nd->nd_flags |= AOPTION;
|
||||
|
@ -50,9 +50,9 @@ t_node *getnode(int class)
|
|||
return nd;
|
||||
}
|
||||
|
||||
t_node *dot2node(int class, t_node *left, t_node *right)
|
||||
struct node *dot2node(int class, struct node *left, struct node *right)
|
||||
{
|
||||
register t_node *nd = getnode(class);
|
||||
register struct node *nd = getnode(class);
|
||||
|
||||
nd->nd_symb = dot.tk_symb;
|
||||
nd->nd_lineno = dot.tk_lineno;
|
||||
|
@ -61,9 +61,9 @@ t_node *dot2node(int class, t_node *left, t_node *right)
|
|||
return nd;
|
||||
}
|
||||
|
||||
t_node *dot2leaf(int class)
|
||||
struct node *dot2leaf(int class)
|
||||
{
|
||||
register t_node *nd = getnode(class);
|
||||
register struct node *nd = getnode(class);
|
||||
|
||||
nd->nd_token = dot;
|
||||
switch(nsubnodes[class]) {
|
||||
|
@ -78,7 +78,7 @@ t_node *dot2leaf(int class)
|
|||
return nd;
|
||||
}
|
||||
|
||||
void FreeNode(register t_node *nd)
|
||||
void FreeNode(register struct node *nd)
|
||||
{
|
||||
/* Put nodes that are no longer needed back onto the free
|
||||
list
|
||||
|
@ -97,13 +97,13 @@ void FreeNode(register t_node *nd)
|
|||
}
|
||||
|
||||
/*ARGSUSED*/
|
||||
int NodeCrash(register t_node* expp, label exit_label, int end_reached)
|
||||
int NodeCrash(register struct node* expp, label exit_label, int end_reached)
|
||||
{
|
||||
crash("(NodeCrash) Illegal node");
|
||||
}
|
||||
|
||||
/*ARGSUSED*/
|
||||
int PNodeCrash(t_node **expp, int flags)
|
||||
int PNodeCrash(struct node **expp, int flags)
|
||||
{
|
||||
crash("(PNodeCrash) Illegal node");
|
||||
}
|
||||
|
@ -119,7 +119,7 @@ void indnt(int lvl)
|
|||
}
|
||||
}
|
||||
|
||||
void printnode(register t_node *nd, int lvl)
|
||||
void printnode(register struct node *nd, int lvl)
|
||||
{
|
||||
indnt(lvl);
|
||||
print("Class: %d; Symbol: %s; Flags: %d\n", nd->nd_class, symbol2str(nd->nd_symb), nd->nd_flags);
|
||||
|
@ -131,7 +131,7 @@ void printnode(register t_node *nd, int lvl)
|
|||
}
|
||||
}
|
||||
|
||||
void PrNode(register t_node *nd, int lvl)
|
||||
void PrNode(register struct node *nd, int lvl)
|
||||
{
|
||||
if (! nd) {
|
||||
indnt(lvl); print("<nilnode>\n");
|
||||
|
|
|
@ -4,10 +4,15 @@
|
|||
*
|
||||
* Author: Ceriel J.H. Jacobs
|
||||
*/
|
||||
#ifndef NODE_H_
|
||||
#define NODE_H_
|
||||
|
||||
#include "em_arith.h"
|
||||
#include "em_label.h"
|
||||
|
||||
/* N O D E O F A N A B S T R A C T P A R S E T R E E */
|
||||
|
||||
/* $Id$ */
|
||||
|
||||
|
||||
struct node {
|
||||
char nd_class; /* kind of node */
|
||||
|
@ -47,13 +52,13 @@ struct node {
|
|||
#define nd_RVAL nd_token.TOK_RVAL
|
||||
};
|
||||
|
||||
typedef struct node t_node;
|
||||
|
||||
|
||||
/* ALLOCDEF "node" 50 */
|
||||
|
||||
extern t_node *dot2node(), *dot2leaf(), *getnode();
|
||||
extern struct node *dot2node(), *dot2leaf(), *getnode();
|
||||
|
||||
#define NULLNODE ((t_node *) 0)
|
||||
#define NULLNODE ((struct node *) 0)
|
||||
|
||||
#define HASSELECTORS 002
|
||||
#define VARIABLE 004
|
||||
|
@ -64,10 +69,11 @@ extern t_node *dot2node(), *dot2leaf(), *getnode();
|
|||
|
||||
|
||||
|
||||
t_node *getnode(int class);
|
||||
t_node *dot2node(int class, t_node *left, t_node *right);
|
||||
t_node *dot2leaf(int class);
|
||||
void FreeNode(register t_node *nd);
|
||||
int NodeCrash(register t_node* expp, label exit_label, int end_reached);
|
||||
int PNodeCrash(t_node **expp, int flags);
|
||||
struct node *getnode(int class);
|
||||
struct node *dot2node(int class, struct node *left, struct node *right);
|
||||
struct node *dot2leaf(int class);
|
||||
void FreeNode(register struct node *nd);
|
||||
int NodeCrash(register struct node* expp, label exit_label, int end_reached);
|
||||
int PNodeCrash(struct node **expp, int flags);
|
||||
|
||||
#endif /* NODE_H_ */
|
|
@ -36,7 +36,7 @@
|
|||
#include "warning.h"
|
||||
#include "misc.h"
|
||||
|
||||
extern t_def *GetDefinitionModule();
|
||||
extern struct def *GetDefinitionModule();
|
||||
|
||||
}
|
||||
/*
|
||||
|
@ -60,8 +60,8 @@ extern t_def *GetDefinitionModule();
|
|||
|
||||
ModuleDeclaration
|
||||
{
|
||||
register t_def *df;
|
||||
t_node *exportlist;
|
||||
register struct def *df;
|
||||
struct node *exportlist;
|
||||
int qualified;
|
||||
} :
|
||||
MODULE IDENT { df = DefineLocalModule(dot.TOK_IDF); }
|
||||
|
@ -76,7 +76,7 @@ ModuleDeclaration
|
|||
}
|
||||
;
|
||||
|
||||
priority(register t_node **prio;):
|
||||
priority(register struct node **prio;):
|
||||
[
|
||||
'[' ConstExpression(prio) ']'
|
||||
{ if (! ((*prio)->nd_type->tp_fund & T_CARDINAL)) {
|
||||
|
@ -87,7 +87,7 @@ priority(register t_node **prio;):
|
|||
]
|
||||
;
|
||||
|
||||
export(int *QUALflag; t_node **ExportList;):
|
||||
export(int *QUALflag; struct node **ExportList;):
|
||||
{ *ExportList = 0; *QUALflag = D_EXPORTED; }
|
||||
[
|
||||
EXPORT
|
||||
|
@ -103,9 +103,9 @@ export(int *QUALflag; t_node **ExportList;):
|
|||
|
||||
import(int local;)
|
||||
{
|
||||
t_node *ImportList;
|
||||
register t_node *FromId = 0;
|
||||
register t_def *df;
|
||||
struct node *ImportList;
|
||||
register struct node *FromId = 0;
|
||||
register struct def *df;
|
||||
} :
|
||||
/*
|
||||
When parsing a global module, this is the place where we must
|
||||
|
@ -139,13 +139,13 @@ import(int local;)
|
|||
|
||||
DefinitionModule
|
||||
{
|
||||
register t_def *df;
|
||||
t_node *exportlist;
|
||||
register struct def *df;
|
||||
struct node *exportlist;
|
||||
int dummy;
|
||||
extern t_idf *DefId;
|
||||
extern struct idf *DefId;
|
||||
extern int ForeignFlag;
|
||||
extern char *sprint();
|
||||
register t_scope *currscope = CurrentScope;
|
||||
register struct scope *currscope = CurrentScope;
|
||||
char buf[512];
|
||||
} :
|
||||
DEFINITION
|
||||
|
@ -196,8 +196,8 @@ node_warning(exportlist, W_OLDFASHIONED, "export list in definition module ignor
|
|||
|
||||
definition
|
||||
{
|
||||
register t_def *df;
|
||||
t_def *dummy;
|
||||
register struct def *df;
|
||||
struct def *dummy;
|
||||
} :
|
||||
CONST [ %persistent ConstantDeclaration ';' ]*
|
||||
|
|
||||
|
@ -231,7 +231,7 @@ definition
|
|||
|
||||
ProgramModule
|
||||
{
|
||||
register t_def *df;
|
||||
register struct def *df;
|
||||
} :
|
||||
MODULE
|
||||
IDENT
|
||||
|
|
|
@ -9,7 +9,7 @@
|
|||
#ifndef SCOPE_H_
|
||||
#define SCOPE_H_
|
||||
|
||||
|
||||
struct def;
|
||||
|
||||
#define OPENSCOPE 0 /* Indicating an open scope */
|
||||
#define CLOSEDSCOPE 1 /* Indicating a closed scope (module) */
|
||||
|
@ -45,13 +45,12 @@ struct scopelist {
|
|||
int sc_count;
|
||||
};
|
||||
|
||||
typedef struct scope t_scope;
|
||||
typedef struct scopelist t_scopelist;
|
||||
|
||||
extern t_scope
|
||||
|
||||
extern struct scope
|
||||
*PervasiveScope;
|
||||
|
||||
extern t_scopelist
|
||||
extern struct scopelist
|
||||
*CurrVis, *GlobalVis;
|
||||
|
||||
#define CurrentScope (CurrVis->sc_scope)
|
||||
|
@ -61,15 +60,15 @@ extern t_scopelist
|
|||
#define nextvisible(x) ((x)->sc_next) /* use with scopelists */
|
||||
|
||||
|
||||
typedef struct def t_def;
|
||||
|
||||
void Reverse(t_def **pdf);
|
||||
|
||||
void Reverse(struct def **pdf);
|
||||
void open_scope(int scopetype);
|
||||
t_scope * open_and_close_scope(int scopetype);
|
||||
struct scope * open_and_close_scope(int scopetype);
|
||||
void InitScope(void);
|
||||
void close_scope(int flag);
|
||||
#ifdef DEBUG
|
||||
void DumpScope(register t_def *df);
|
||||
void DumpScope(register struct def *df);
|
||||
#endif
|
||||
|
||||
|
||||
|
|
|
@ -26,8 +26,8 @@
|
|||
#include "lookup.h"
|
||||
#include "error.h"
|
||||
|
||||
t_scope *PervasiveScope;
|
||||
t_scopelist *CurrVis, *GlobalVis;
|
||||
struct scope *PervasiveScope;
|
||||
struct scopelist *CurrVis, *GlobalVis;
|
||||
extern int proclevel;
|
||||
extern char options[];
|
||||
|
||||
|
@ -41,8 +41,8 @@ void open_scope(int scopetype)
|
|||
{
|
||||
/* Open a scope that is either open (automatic imports) or closed.
|
||||
*/
|
||||
register t_scope *sc = new_scope();
|
||||
register t_scopelist *ls = new_scopelist();
|
||||
register struct scope *sc = new_scope();
|
||||
register struct scopelist *ls = new_scopelist();
|
||||
|
||||
assert(scopetype == OPENSCOPE || scopetype == CLOSEDSCOPE);
|
||||
|
||||
|
@ -57,9 +57,9 @@ void open_scope(int scopetype)
|
|||
CurrVis = ls;
|
||||
}
|
||||
|
||||
t_scope * open_and_close_scope(int scopetype)
|
||||
struct scope * open_and_close_scope(int scopetype)
|
||||
{
|
||||
t_scope *sc;
|
||||
struct scope *sc;
|
||||
|
||||
open_scope(scopetype);
|
||||
sc = CurrentScope;
|
||||
|
@ -69,8 +69,8 @@ t_scope * open_and_close_scope(int scopetype)
|
|||
|
||||
void InitScope(void)
|
||||
{
|
||||
register t_scope *sc = new_scope();
|
||||
register t_scopelist *ls = new_scopelist();
|
||||
register struct scope *sc = new_scope();
|
||||
register struct scopelist *ls = new_scopelist();
|
||||
|
||||
sc->sc_level = proclevel;
|
||||
PervasiveScope = sc;
|
||||
|
@ -78,7 +78,7 @@ void InitScope(void)
|
|||
CurrVis = ls;
|
||||
}
|
||||
|
||||
static void chk_proc(register t_def *df)
|
||||
static void chk_proc(register struct def *df)
|
||||
{
|
||||
/* Called at scope closing. Check all definitions, and if one
|
||||
is a D_PROCHEAD, the procedure was not defined.
|
||||
|
@ -100,13 +100,13 @@ static void chk_proc(register t_def *df)
|
|||
}
|
||||
}
|
||||
|
||||
static void chk_forw(t_def **pdf)
|
||||
static void chk_forw(struct def **pdf)
|
||||
{
|
||||
/* Called at scope close. Look for all forward definitions and
|
||||
if the scope was a closed scope, give an error message for
|
||||
them, and otherwise move them to the enclosing scope.
|
||||
*/
|
||||
register t_def *df;
|
||||
register struct def *df;
|
||||
|
||||
while ( (df = *pdf) ) {
|
||||
if (df->df_kind == D_FORWTYPE) {
|
||||
|
@ -131,9 +131,9 @@ df->df_idf->id_text);
|
|||
Maybe the definitions are in the
|
||||
enclosing scope?
|
||||
*/
|
||||
register t_scopelist *ls =
|
||||
register struct scopelist *ls =
|
||||
nextvisible(CurrVis);
|
||||
register t_def *df1 = lookup(df->df_idf, ls->sc_scope, 0, 0);
|
||||
register struct def *df1 = lookup(df->df_idf, ls->sc_scope, 0, 0);
|
||||
|
||||
*pdf = df->df_nextinscope;
|
||||
|
||||
|
@ -154,14 +154,14 @@ df->df_idf->id_text);
|
|||
}
|
||||
}
|
||||
|
||||
void Reverse(t_def **pdf)
|
||||
void Reverse(struct def **pdf)
|
||||
{
|
||||
/* Reverse the order in the list of definitions in a scope.
|
||||
This is neccesary because this list is built in reverse.
|
||||
Also, while we're at it, remove uninteresting definitions
|
||||
from this list.
|
||||
*/
|
||||
register t_def *df, *df1;
|
||||
register struct def *df, *df1;
|
||||
#define INTERESTING (D_MODULE|D_PROCEDURE|D_PROCHEAD|D_VARIABLE|D_IMPORTED|D_TYPE|D_CONST|D_FIELD)
|
||||
|
||||
df = 0;
|
||||
|
@ -169,7 +169,7 @@ void Reverse(t_def **pdf)
|
|||
|
||||
while (df1) {
|
||||
if (df1->df_kind & INTERESTING) {
|
||||
t_def *prev = df;
|
||||
struct def *prev = df;
|
||||
|
||||
df = df1;
|
||||
df1 = df1->df_nextinscope;
|
||||
|
@ -186,7 +186,7 @@ void close_scope(int flag)
|
|||
either POINTER declarations, or EXPORTs, or forward references
|
||||
to MODULES
|
||||
*/
|
||||
register t_scope *sc = CurrentScope;
|
||||
register struct scope *sc = CurrentScope;
|
||||
|
||||
assert(sc != 0);
|
||||
|
||||
|
@ -203,7 +203,7 @@ void close_scope(int flag)
|
|||
}
|
||||
|
||||
#ifdef DEBUG
|
||||
void DumpScope(register t_def *df)
|
||||
void DumpScope(register struct def *df)
|
||||
{
|
||||
while (df) {
|
||||
PrDef(df);
|
||||
|
|
|
@ -68,7 +68,7 @@ static void adds_db_str(char *s)
|
|||
while (*s) addc_db_str(*s++);
|
||||
}
|
||||
|
||||
static void stb_type(register t_type *tp, int assign_num)
|
||||
static void stb_type(register struct type *tp, int assign_num)
|
||||
{
|
||||
char buf[128];
|
||||
static int stb_count;
|
||||
|
@ -249,7 +249,7 @@ static void stb_type(register t_type *tp, int assign_num)
|
|||
}
|
||||
}
|
||||
|
||||
void stb_addtp(char *s, t_type *tp)
|
||||
void stb_addtp(char *s, struct type *tp)
|
||||
{
|
||||
create_db_str();
|
||||
adds_db_str(s);
|
||||
|
@ -265,9 +265,9 @@ void stb_addtp(char *s, t_type *tp)
|
|||
(arith) 0);
|
||||
}
|
||||
|
||||
void stb_string(register t_def *df, int kind)
|
||||
void stb_string(register struct def *df, int kind)
|
||||
{
|
||||
register t_type *tp = df->df_type;
|
||||
register struct type *tp = df->df_type;
|
||||
char buf[64];
|
||||
|
||||
create_db_str();
|
||||
|
@ -291,10 +291,10 @@ void stb_string(register t_def *df, int kind)
|
|||
else adds_db_str(sprint(buf, "Q%d;", df->prc_vis->sc_count));
|
||||
stb_type(tp->tp_next ? tp->tp_next : void_type, 0);
|
||||
if (gdb_flag) {
|
||||
t_scopelist *sc = df->prc_vis;
|
||||
struct scopelist *sc = df->prc_vis;
|
||||
sc = enclosing(sc);
|
||||
while (sc) {
|
||||
t_def *d = sc->sc_scope->sc_definedby;
|
||||
struct def *d = sc->sc_scope->sc_definedby;
|
||||
|
||||
if (d && d->df_kind == D_PROCEDURE) {
|
||||
adds_db_str(sprint(buf, ",%s", d->df_idf->id_text));
|
||||
|
|
|
@ -9,11 +9,11 @@
|
|||
#define STAB_H_
|
||||
/* D E B U G G E R S Y M B O L T A B L E */
|
||||
|
||||
typedef struct type t_type;
|
||||
typedef struct def t_def;
|
||||
|
||||
void stb_addtp(char *s, t_type *tp);
|
||||
void stb_string(register t_def *df, int kind);
|
||||
struct def;
|
||||
|
||||
void stb_addtp(char *s, struct type *tp);
|
||||
void stb_string(register struct def *df, int kind);
|
||||
|
||||
|
||||
#endif /* STAB_H_ */
|
||||
|
|
|
@ -24,12 +24,12 @@
|
|||
#include "node.h"
|
||||
|
||||
static int loopcount = 0; /* Count nested loops */
|
||||
extern t_node *EmptyStatement;
|
||||
extern struct node *EmptyStatement;
|
||||
}
|
||||
|
||||
statement(register t_node **pnd;)
|
||||
statement(register struct node **pnd;)
|
||||
{
|
||||
register t_node *nd;
|
||||
register struct node *nd;
|
||||
extern int return_occurred;
|
||||
} :
|
||||
/*
|
||||
|
@ -110,10 +110,10 @@ ProcedureCall:
|
|||
;
|
||||
*/
|
||||
|
||||
StatementSequence(register t_node **pnd;)
|
||||
StatementSequence(register struct node **pnd;)
|
||||
{
|
||||
t_node *nd;
|
||||
register t_node *nd1;
|
||||
struct node *nd;
|
||||
register struct node *nd1;
|
||||
} :
|
||||
statement(pnd)
|
||||
[ %persistent
|
||||
|
@ -129,9 +129,9 @@ StatementSequence(register t_node **pnd;)
|
|||
]*
|
||||
;
|
||||
|
||||
IfStatement(t_node **pnd;)
|
||||
IfStatement(struct node **pnd;)
|
||||
{
|
||||
register t_node *nd;
|
||||
register struct node *nd;
|
||||
} :
|
||||
IF { nd = dot2leaf(Stat);
|
||||
*pnd = nd;
|
||||
|
@ -160,10 +160,10 @@ IfStatement(t_node **pnd;)
|
|||
END
|
||||
;
|
||||
|
||||
CaseStatement(t_node **pnd;)
|
||||
CaseStatement(struct node **pnd;)
|
||||
{
|
||||
register t_node *nd;
|
||||
t_type *tp = 0;
|
||||
register struct node *nd;
|
||||
struct type *tp = 0;
|
||||
} :
|
||||
CASE { *pnd = nd = dot2leaf(Stat); }
|
||||
expression(&(nd->nd_LEFT))
|
||||
|
@ -181,7 +181,7 @@ CaseStatement(t_node **pnd;)
|
|||
END
|
||||
;
|
||||
|
||||
case(t_node **pnd; t_type **ptp;) :
|
||||
case(struct node **pnd; struct type **ptp;) :
|
||||
[ CaseLabelList(ptp, pnd)
|
||||
':' { *pnd = dot2node(Link, *pnd, NULLNODE); }
|
||||
StatementSequence(&((*pnd)->nd_RIGHT))
|
||||
|
@ -193,9 +193,9 @@ case(t_node **pnd; t_type **ptp;) :
|
|||
;
|
||||
|
||||
/* inline in statement; lack of space
|
||||
WhileStatement(t_node **pnd;)
|
||||
WhileStatement(struct node **pnd;)
|
||||
{
|
||||
register t_node *nd;
|
||||
register struct node *nd;
|
||||
}:
|
||||
WHILE { *pnd = nd = dot2leaf(Stat); }
|
||||
expression(&(nd->nd_LEFT))
|
||||
|
@ -204,9 +204,9 @@ WhileStatement(t_node **pnd;)
|
|||
END
|
||||
;
|
||||
|
||||
RepeatStatement(t_node **pnd;)
|
||||
RepeatStatement(struct node **pnd;)
|
||||
{
|
||||
register t_node *nd;
|
||||
register struct node *nd;
|
||||
}:
|
||||
REPEAT { *pnd = nd = dot2leaf(Stat); }
|
||||
StatementSequence(&(nd->nd_LEFT))
|
||||
|
@ -215,9 +215,9 @@ RepeatStatement(t_node **pnd;)
|
|||
;
|
||||
*/
|
||||
|
||||
ForStatement(t_node **pnd;)
|
||||
ForStatement(struct node **pnd;)
|
||||
{
|
||||
register t_node *nd, *nd1;
|
||||
register struct node *nd, *nd1;
|
||||
}:
|
||||
FOR { *pnd = nd = dot2leaf(Stat); }
|
||||
IDENT { nd1 = dot2leaf(Name); }
|
||||
|
@ -249,15 +249,15 @@ ForStatement(t_node **pnd;)
|
|||
;
|
||||
|
||||
/* inline in Statement; lack of space
|
||||
LoopStatement(t_node **pnd;):
|
||||
LoopStatement(struct node **pnd;):
|
||||
LOOP { *pnd = dot2leaf(Stat); }
|
||||
StatementSequence(&((*pnd)->nd_RIGHT))
|
||||
END
|
||||
;
|
||||
|
||||
WithStatement(t_node **pnd;)
|
||||
WithStatement(struct node **pnd;)
|
||||
{
|
||||
register t_node *nd;
|
||||
register struct node *nd;
|
||||
}:
|
||||
WITH { *pnd = nd = dot2leaf(Stat); }
|
||||
designator(&(nd->nd_LEFT))
|
||||
|
@ -267,11 +267,11 @@ WithStatement(t_node **pnd;)
|
|||
;
|
||||
*/
|
||||
|
||||
ReturnStatement(t_node **pnd;)
|
||||
ReturnStatement(struct node **pnd;)
|
||||
{
|
||||
register t_def *df = CurrentScope->sc_definedby;
|
||||
register t_type *tp = df->df_type ? ResultType(df->df_type) : 0;
|
||||
register t_node *nd;
|
||||
register struct def *df = CurrentScope->sc_definedby;
|
||||
register struct type *tp = df->df_type ? ResultType(df->df_type) : 0;
|
||||
register struct node *nd;
|
||||
} :
|
||||
|
||||
RETURN { *pnd = nd = dot2leaf(Stat); }
|
||||
|
|
|
@ -11,9 +11,9 @@
|
|||
|
||||
#include "em_arith.h"
|
||||
|
||||
typedef struct scope t_scope;
|
||||
struct scope;
|
||||
|
||||
void TmpOpen(t_scope *sc);
|
||||
void TmpOpen(struct scope *sc);
|
||||
arith TmpSpace(arith sz, int al);
|
||||
arith NewInt(void);
|
||||
arith NewPtr(void);
|
||||
|
|
|
@ -42,11 +42,11 @@ struct tmpvar {
|
|||
|
||||
static struct tmpvar *TmpInts, /* for integer temporaries */
|
||||
*TmpPtrs; /* for pointer temporaries */
|
||||
static t_scope *ProcScope; /* scope of procedure in which the
|
||||
static struct scope *ProcScope; /* scope of procedure in which the
|
||||
temporaries are allocated
|
||||
*/
|
||||
|
||||
void TmpOpen(t_scope *sc)
|
||||
void TmpOpen(struct scope *sc)
|
||||
{
|
||||
/* Initialize for temporaries in scope "sc".
|
||||
*/
|
||||
|
@ -55,7 +55,7 @@ void TmpOpen(t_scope *sc)
|
|||
|
||||
arith TmpSpace(arith sz, int al)
|
||||
{
|
||||
register t_scope *sc = ProcScope;
|
||||
register struct scope *sc = ProcScope;
|
||||
|
||||
sc->sc_off = - WA(align(sz - sc->sc_off, al));
|
||||
return sc->sc_off;
|
||||
|
|
|
@ -104,7 +104,7 @@ void reserve(register struct tokenname *resv)
|
|||
/* The names of the tokens described in resv are entered
|
||||
as reserved words.
|
||||
*/
|
||||
register t_idf *p;
|
||||
register struct idf *p;
|
||||
|
||||
while (resv->tn_symbol) {
|
||||
p = str2idf(resv->tn_name, 0);
|
||||
|
|
|
@ -59,7 +59,7 @@ arith
|
|||
|
||||
arith ret_area_size;
|
||||
|
||||
t_type
|
||||
struct type
|
||||
*bool_type,
|
||||
*char_type,
|
||||
*int_type,
|
||||
|
@ -79,12 +79,12 @@ t_type
|
|||
*error_type;
|
||||
|
||||
|
||||
t_type *construct_type(int fund, register t_type *tp)
|
||||
struct type *construct_type(int fund, register struct type *tp)
|
||||
{
|
||||
/* fund must be a type constructor.
|
||||
The pointer to the constructed type is returned.
|
||||
*/
|
||||
register t_type *dtp = new_type();
|
||||
register struct type *dtp = new_type();
|
||||
|
||||
switch (dtp->tp_fund = fund) {
|
||||
case T_PROCEDURE:
|
||||
|
@ -129,9 +129,9 @@ arith align(arith pos, int al)
|
|||
return pos;
|
||||
}
|
||||
|
||||
t_type *standard_type(int fund, int algn, arith size)
|
||||
struct type *standard_type(int fund, int algn, arith size)
|
||||
{
|
||||
register t_type *tp = new_type();
|
||||
register struct type *tp = new_type();
|
||||
|
||||
tp->tp_fund = fund;
|
||||
tp->tp_align = algn;
|
||||
|
@ -145,7 +145,7 @@ t_type *standard_type(int fund, int algn, arith size)
|
|||
|
||||
void InitTypes(void)
|
||||
{
|
||||
register t_type *tp;
|
||||
register struct type *tp;
|
||||
|
||||
/* first, do some checking
|
||||
*/
|
||||
|
@ -221,7 +221,7 @@ int fit(arith sz, int nbytes)
|
|||
return ((sz) + ((arith)0x80<<(((nbytes)-1)*8)) & ~full_mask[(nbytes)]) == 0;
|
||||
}
|
||||
|
||||
static void u_small(register t_type *tp, arith n)
|
||||
static void u_small(register struct type *tp, arith n)
|
||||
{
|
||||
if (ufit(n, 1)) {
|
||||
tp->tp_size = 1;
|
||||
|
@ -233,9 +233,9 @@ static void u_small(register t_type *tp, arith n)
|
|||
}
|
||||
}
|
||||
|
||||
t_type *enum_type(t_node *EnumList)
|
||||
struct type *enum_type(struct node *EnumList)
|
||||
{
|
||||
register t_type *tp =
|
||||
register struct type *tp =
|
||||
standard_type(T_ENUMERATION, int_align, int_size);
|
||||
|
||||
EnterEnumList(EnumList, tp);
|
||||
|
@ -246,12 +246,12 @@ t_type *enum_type(t_node *EnumList)
|
|||
return tp;
|
||||
}
|
||||
|
||||
t_type *qualified_type(t_node **pnd)
|
||||
struct type *qualified_type(struct node **pnd)
|
||||
{
|
||||
register t_def *df;
|
||||
register struct def *df;
|
||||
|
||||
if (ChkDesig(pnd, D_USED)) {
|
||||
register t_node *nd = *pnd;
|
||||
register struct node *nd = *pnd;
|
||||
if (nd->nd_class != Def) {
|
||||
node_error(nd, "type expected");
|
||||
FreeNode(nd);
|
||||
|
@ -291,7 +291,7 @@ int chk_bounds(arith l1, arith l2, int fund)
|
|||
return (unsigned arith) l2 >= (unsigned arith) l1;
|
||||
}
|
||||
|
||||
int in_range(arith i, register t_type *tp)
|
||||
int in_range(arith i, register struct type *tp)
|
||||
{
|
||||
|
||||
|
||||
|
@ -308,10 +308,10 @@ int in_range(arith i, register t_type *tp)
|
|||
/*NOTREACHED*/
|
||||
}
|
||||
|
||||
t_type *subr_type(t_node *lb, t_node *ub, t_type *base)
|
||||
struct type *subr_type(struct node *lb, struct node *ub, struct type *base)
|
||||
{
|
||||
register t_type *tp = BaseType(lb->nd_type);
|
||||
register t_type *res;
|
||||
register struct type *tp = BaseType(lb->nd_type);
|
||||
register struct type *res;
|
||||
|
||||
if (tp == intorcard_type) {
|
||||
/* Lower bound >= 0; in this case, the base type is CARDINAL,
|
||||
|
@ -398,9 +398,9 @@ t_type *subr_type(t_node *lb, t_node *ub, t_type *base)
|
|||
return res;
|
||||
}
|
||||
|
||||
t_type *proc_type(t_type *result_type, t_param *parameters, arith n_bytes_params)
|
||||
struct type *proc_type(struct type *result_type, struct paramlist *parameters, arith n_bytes_params)
|
||||
{
|
||||
register t_type *tp = construct_type(T_PROCEDURE, result_type);
|
||||
register struct type *tp = construct_type(T_PROCEDURE, result_type);
|
||||
|
||||
tp->prc_params = parameters;
|
||||
tp->prc_nbpar = n_bytes_params;
|
||||
|
@ -413,7 +413,7 @@ t_type *proc_type(t_type *result_type, t_param *parameters, arith n_bytes_params
|
|||
return tp;
|
||||
}
|
||||
|
||||
void genrck(register t_type *tp)
|
||||
void genrck(register struct type *tp)
|
||||
{
|
||||
/* generate a range check descriptor for type "tp" when
|
||||
neccessary. Return its label.
|
||||
|
@ -421,7 +421,7 @@ void genrck(register t_type *tp)
|
|||
arith lb, ub;
|
||||
register label ol;
|
||||
arith size = tp->tp_size;
|
||||
register t_type *btp = BaseType(tp);
|
||||
register struct type *btp = BaseType(tp);
|
||||
|
||||
if (size < word_size) size = word_size;
|
||||
getbounds(tp, &lb, &ub);
|
||||
|
@ -448,7 +448,7 @@ void genrck(register t_type *tp)
|
|||
}
|
||||
}
|
||||
|
||||
void getbounds(register t_type *tp, arith *plo, arith *phi)
|
||||
void getbounds(register struct type *tp, arith *plo, arith *phi)
|
||||
{
|
||||
assert(bounded(tp));
|
||||
|
||||
|
@ -462,7 +462,7 @@ void getbounds(register t_type *tp, arith *plo, arith *phi)
|
|||
}
|
||||
}
|
||||
|
||||
t_type *set_type(register t_type *tp)
|
||||
struct type *set_type(register struct type *tp)
|
||||
{
|
||||
|
||||
arith lb, ub, diff, alloc_size;
|
||||
|
@ -498,14 +498,14 @@ t_type *set_type(register t_type *tp)
|
|||
return tp;
|
||||
}
|
||||
|
||||
void ArrayElSize(register t_type *tp)
|
||||
void ArrayElSize(register struct type *tp)
|
||||
{
|
||||
/* Align element size to alignment requirement of element type.
|
||||
Also make sure that its size is either a dividor of the word_size,
|
||||
or a multiple of it.
|
||||
*/
|
||||
register arith algn;
|
||||
register t_type *elem_type = tp->arr_elem;
|
||||
register struct type *elem_type = tp->arr_elem;
|
||||
|
||||
if (elem_type->tp_fund == T_ARRAY) ArraySizes(elem_type);
|
||||
algn = align(elem_type->tp_size, elem_type->tp_align);
|
||||
|
@ -524,11 +524,11 @@ void ArrayElSize(register t_type *tp)
|
|||
}
|
||||
}
|
||||
|
||||
void ArraySizes(register t_type *tp)
|
||||
void ArraySizes(register struct type *tp)
|
||||
{
|
||||
/* Assign sizes to an array type, and check index type
|
||||
*/
|
||||
register t_type *index_type = IndexType(tp);
|
||||
register struct type *index_type = IndexType(tp);
|
||||
arith diff;
|
||||
|
||||
ArrayElSize(tp);
|
||||
|
@ -563,13 +563,13 @@ void ArraySizes(register t_type *tp)
|
|||
C_rom_cst(tp->arr_elsize);
|
||||
}
|
||||
|
||||
void FreeType(register t_type *tp)
|
||||
void FreeType(register struct type *tp)
|
||||
{
|
||||
/* Release type structures indicated by "tp".
|
||||
This procedure is only called for types, constructed with
|
||||
T_PROCEDURE.
|
||||
*/
|
||||
register t_param *pr, *pr1;
|
||||
register struct paramlist *pr, *pr1;
|
||||
|
||||
assert(tp->tp_fund == T_PROCEDURE);
|
||||
|
||||
|
@ -584,7 +584,7 @@ void FreeType(register t_type *tp)
|
|||
free_type(tp);
|
||||
}
|
||||
|
||||
void DeclareType(t_node *nd, register t_def *df, register t_type *tp)
|
||||
void DeclareType(struct node *nd, register struct def *df, register struct type *tp)
|
||||
{
|
||||
/* A type with type-description "tp" is declared and must
|
||||
be bound to definition "df".
|
||||
|
@ -592,7 +592,7 @@ void DeclareType(t_node *nd, register t_def *df, register t_type *tp)
|
|||
"df" is already bound. In that case, it is either an opaque
|
||||
type, or an error message was given when "df" was created.
|
||||
*/
|
||||
register t_type *df_tp = df->df_type;
|
||||
register struct type *df_tp = df->df_type;
|
||||
|
||||
if (df_tp && df_tp->tp_fund == T_HIDDEN) {
|
||||
if (! (tp->tp_fund & (T_POINTER|T_HIDDEN|T_EQUAL))) {
|
||||
|
@ -626,9 +626,9 @@ void DeclareType(t_node *nd, register t_def *df, register t_type *tp)
|
|||
SolveForwardTypeRefs(df);
|
||||
}
|
||||
|
||||
void SolveForwardTypeRefs(register t_def *df)
|
||||
void SolveForwardTypeRefs(register struct def *df)
|
||||
{
|
||||
register t_node *nd;
|
||||
register struct node *nd;
|
||||
|
||||
if (df->df_kind == D_FORWTYPE) {
|
||||
nd = df->df_forw_node;
|
||||
|
@ -648,10 +648,10 @@ void SolveForwardTypeRefs(register t_def *df)
|
|||
}
|
||||
|
||||
|
||||
void ForceForwardTypeDef(register t_def *df)
|
||||
void ForceForwardTypeDef(register struct def *df)
|
||||
{
|
||||
register t_def *df1 = df, *df2;
|
||||
register t_node *nd = df->df_forw_node;
|
||||
register struct def *df1 = df, *df2;
|
||||
register struct node *nd = df->df_forw_node;
|
||||
|
||||
while (df && df->df_kind == D_FORWTYPE) {
|
||||
RemoveFromIdList(df);
|
||||
|
@ -682,20 +682,20 @@ void ForceForwardTypeDef(register t_def *df)
|
|||
}
|
||||
}
|
||||
|
||||
t_type *RemoveEqual(register t_type *tpx)
|
||||
struct type *RemoveEqual(register struct type *tpx)
|
||||
{
|
||||
|
||||
if (tpx) while (tpx->tp_fund == T_EQUAL) tpx = tpx->tp_next;
|
||||
return tpx;
|
||||
}
|
||||
|
||||
int type_or_forward(t_type *tp)
|
||||
int type_or_forward(struct type *tp)
|
||||
{
|
||||
/* POINTER TO IDENTIFIER construction. The IDENTIFIER resides
|
||||
in "dot". This routine handles the different cases.
|
||||
*/
|
||||
register t_node *nd;
|
||||
register t_def *df, *df1;
|
||||
register struct node *nd;
|
||||
register struct def *df, *df1;
|
||||
|
||||
if ((df1 = lookup(dot.TOK_IDF, CurrentScope, D_IMPORTED, D_USED))) {
|
||||
/* Either a Module or a Type, but in both cases defined
|
||||
|
@ -773,10 +773,10 @@ int lcm(int m, int n)
|
|||
return m * (n / gcd(m, n));
|
||||
}
|
||||
|
||||
t_type *intorcard(register t_type *left, register t_type *right)
|
||||
struct type *intorcard(register struct type *left, register struct type *right)
|
||||
{
|
||||
if (left->tp_fund == T_INTORCARD) {
|
||||
t_type *tmp = left;
|
||||
struct type *tmp = left;
|
||||
left = right;
|
||||
right = tmp;
|
||||
}
|
||||
|
@ -789,7 +789,7 @@ t_type *intorcard(register t_type *left, register t_type *right)
|
|||
}
|
||||
|
||||
#ifdef DEBUG
|
||||
void DumpType(register t_type *tp)
|
||||
void DumpType(register struct type *tp)
|
||||
{
|
||||
if (!tp) return;
|
||||
|
||||
|
@ -825,7 +825,7 @@ void DumpType(register t_type *tp)
|
|||
break;
|
||||
case T_PROCEDURE:
|
||||
{
|
||||
register t_param *par = ParamList(tp);
|
||||
register struct paramlist *par = ParamList(tp);
|
||||
|
||||
print("PROCEDURE");
|
||||
if (par) {
|
||||
|
|
|
@ -13,8 +13,8 @@
|
|||
|
||||
|
||||
|
||||
typedef struct def t_def;
|
||||
typedef struct node t_node;
|
||||
struct def;
|
||||
struct node;
|
||||
|
||||
struct paramlist { /* structure for parameterlist of a PROCEDURE */
|
||||
struct paramlist *par_next;
|
||||
|
@ -23,7 +23,7 @@ struct paramlist { /* structure for parameterlist of a PROCEDURE */
|
|||
#define TypeOfParam(xpar) ((xpar)->par_def->df_type)
|
||||
};
|
||||
|
||||
typedef struct paramlist t_param;
|
||||
struct paramlist;
|
||||
|
||||
/* ALLOCDEF "paramlist" 20 */
|
||||
|
||||
|
@ -124,11 +124,11 @@ struct type {
|
|||
} tp_value;
|
||||
};
|
||||
|
||||
typedef struct type t_type;
|
||||
struct type;
|
||||
|
||||
/* ALLOCDEF "type" 50 */
|
||||
|
||||
extern t_type
|
||||
extern struct type
|
||||
*bool_type,
|
||||
*char_type,
|
||||
*int_type,
|
||||
|
@ -198,7 +198,7 @@ extern arith
|
|||
|
||||
|
||||
|
||||
#define NULLTYPE ((t_type *) 0)
|
||||
#define NULLTYPE ((struct type *) 0)
|
||||
|
||||
#define IsConformantArray(tpx) ((tpx)->tp_fund==T_ARRAY && (tpx)->tp_size==0)
|
||||
#define bounded(tpx) ((tpx)->tp_fund & T_INDEX)
|
||||
|
@ -250,37 +250,37 @@ int chk_bounds(arith l1, arith l2, int fund);
|
|||
arith align(arith pos, int al);
|
||||
/* Create a new standard type "fund" with specified
|
||||
alignment "algn" and "size" bytes. */
|
||||
t_type *standard_type(int fund, int algn, arith size);
|
||||
t_type *enum_type(t_node *EnumList);
|
||||
t_type *construct_type(int fund, register t_type *tp);
|
||||
t_type *qualified_type(t_node **pnd);
|
||||
struct type *standard_type(int fund, int algn, arith size);
|
||||
struct type *enum_type(struct node *EnumList);
|
||||
struct type *construct_type(int fund, register struct type *tp);
|
||||
struct type *qualified_type(struct node **pnd);
|
||||
/* Check that the value "i" fits in the subrange or enumeration
|
||||
type "tp". Return 1 if so, 0 otherwise
|
||||
*/
|
||||
int in_range(arith i, register t_type *tp);
|
||||
int in_range(arith i, register struct type *tp);
|
||||
/* Construct a subrange type from the constant expressions
|
||||
indicated by "lb" and "ub", but first perform some
|
||||
checks. "base" is either a user-specified base-type, or NULL.
|
||||
*/
|
||||
t_type *subr_type(t_node *lb, t_node *ub, t_type *base);
|
||||
t_type *proc_type(t_type *result_type, t_param *parameters, arith n_bytes_params);
|
||||
void genrck(register t_type *tp);
|
||||
struct type *subr_type(struct node *lb, struct node *ub, struct type *base);
|
||||
struct type *proc_type(struct type *result_type, struct paramlist *parameters, arith n_bytes_params);
|
||||
void genrck(register struct type *tp);
|
||||
/* Get the bounds of a bounded type. */
|
||||
void getbounds(register t_type *tp, arith *plo, arith *phi);
|
||||
void getbounds(register struct type *tp, arith *plo, arith *phi);
|
||||
/* Construct a set type with base type "tp", but first
|
||||
* perform some checks */
|
||||
t_type *set_type(register t_type *tp);
|
||||
void ArrayElSize(register t_type *tp);
|
||||
void ArraySizes(register t_type *tp);
|
||||
void FreeType(register t_type *tp);
|
||||
void DeclareType(t_node *nd, register t_def *df, register t_type *tp);
|
||||
void SolveForwardTypeRefs(register t_def *df);
|
||||
void ForceForwardTypeDef(register t_def *df);
|
||||
t_type *RemoveEqual(register t_type *tpx);
|
||||
int type_or_forward(t_type *tp);
|
||||
t_type *intorcard(register t_type *left, register t_type *right);
|
||||
struct type *set_type(register struct type *tp);
|
||||
void ArrayElSize(register struct type *tp);
|
||||
void ArraySizes(register struct type *tp);
|
||||
void FreeType(register struct type *tp);
|
||||
void DeclareType(struct node *nd, register struct def *df, register struct type *tp);
|
||||
void SolveForwardTypeRefs(register struct def *df);
|
||||
void ForceForwardTypeDef(register struct def *df);
|
||||
struct type *RemoveEqual(register struct type *tpx);
|
||||
int type_or_forward(struct type *tp);
|
||||
struct type *intorcard(register struct type *left, register struct type *right);
|
||||
#ifdef DEBUG
|
||||
void DumpType(register t_type *tp);
|
||||
void DumpType(register struct type *tp);
|
||||
#endif
|
||||
int fit(arith sz, int nbytes);
|
||||
/* Greatest common divisotr. */
|
||||
|
|
|
@ -35,7 +35,7 @@
|
|||
#include "chk_expr.h"
|
||||
|
||||
|
||||
static int TstTypeEquiv(t_type *tp1, t_type *tp2)
|
||||
static int TstTypeEquiv(struct type *tp1, struct type *tp2)
|
||||
{
|
||||
/* test if two types are equivalent.
|
||||
*/
|
||||
|
@ -45,7 +45,7 @@ static int TstTypeEquiv(t_type *tp1, t_type *tp2)
|
|||
(tp2 == error_type);
|
||||
}
|
||||
|
||||
static int TstParEquiv(register t_type *tp1, register t_type *tp2)
|
||||
static int TstParEquiv(register struct type *tp1, register struct type *tp2)
|
||||
{
|
||||
/* test if two parameter types are equivalent. This routine
|
||||
is used to check if two different procedure declarations
|
||||
|
@ -66,13 +66,13 @@ static int TstParEquiv(register t_type *tp1, register t_type *tp2)
|
|||
);
|
||||
}
|
||||
|
||||
int TstProcEquiv(t_type *tp1, t_type *tp2)
|
||||
int TstProcEquiv(struct type *tp1, struct type *tp2)
|
||||
{
|
||||
/* Test if two procedure types are equivalent. This routine
|
||||
may also be used for the testing of assignment compatibility
|
||||
between procedure variables and procedures.
|
||||
*/
|
||||
register t_param *p1, *p2;
|
||||
register struct paramlist *p1, *p2;
|
||||
|
||||
/* First check if the result types are equivalent
|
||||
*/
|
||||
|
@ -96,7 +96,7 @@ int TstProcEquiv(t_type *tp1, t_type *tp2)
|
|||
return p1 == p2;
|
||||
}
|
||||
|
||||
int TstCompat(register t_type *tp1, register t_type *tp2)
|
||||
int TstCompat(register struct type *tp1, register struct type *tp2)
|
||||
{
|
||||
/* test if two types are compatible. See section 6.3 of the
|
||||
Modula-2 Report for a definition of "compatible".
|
||||
|
@ -108,7 +108,7 @@ int TstCompat(register t_type *tp1, register t_type *tp2)
|
|||
tp2 = BaseType(tp2);
|
||||
if (tp2->tp_fund != T_INTORCARD &&
|
||||
(tp1->tp_fund == T_INTORCARD || tp1 == address_type)) {
|
||||
t_type *tmp = tp2;
|
||||
struct type *tmp = tp2;
|
||||
|
||||
tp2 = tp1;
|
||||
tp1 = tmp;
|
||||
|
@ -133,7 +133,7 @@ int TstCompat(register t_type *tp1, register t_type *tp2)
|
|||
;
|
||||
}
|
||||
|
||||
int TstAssCompat(register t_type *tp1, register t_type *tp2)
|
||||
int TstAssCompat(register struct type *tp1, register struct type *tp2)
|
||||
{
|
||||
/* Test if two types are assignment compatible.
|
||||
See Def 9.1.
|
||||
|
@ -170,7 +170,7 @@ int TstAssCompat(register t_type *tp1, register t_type *tp2)
|
|||
return 0;
|
||||
}
|
||||
|
||||
char *incompat(register t_type *tp1, register t_type *tp2)
|
||||
char *incompat(register struct type *tp1, register struct type *tp2)
|
||||
{
|
||||
|
||||
if (tp1->tp_fund == T_HIDDEN || tp2->tp_fund == T_HIDDEN) {
|
||||
|
@ -179,7 +179,7 @@ char *incompat(register t_type *tp1, register t_type *tp2)
|
|||
return "type incompatibility";
|
||||
}
|
||||
|
||||
int TstParCompat(int parno, register t_type *formaltype, int VARflag, t_node **nd, t_def *edf)
|
||||
int TstParCompat(int parno, register struct type *formaltype, int VARflag, struct node **nd, struct def *edf)
|
||||
{
|
||||
/* Check type compatibility for a parameter in a procedure call.
|
||||
Assignment compatibility may do if the parameter is
|
||||
|
@ -188,7 +188,7 @@ int TstParCompat(int parno, register t_type *formaltype, int VARflag, t_node **n
|
|||
may do too.
|
||||
Or: a WORD may do.
|
||||
*/
|
||||
register t_type *actualtype = (*nd)->nd_type;
|
||||
register struct type *actualtype = (*nd)->nd_type;
|
||||
char ebuf[256];
|
||||
|
||||
if (edf) {
|
||||
|
@ -255,7 +255,7 @@ int TstParCompat(int parno, register t_type *formaltype, int VARflag, t_node **n
|
|||
return 0;
|
||||
}
|
||||
|
||||
int CompatCheck(register t_node **nd, t_type *tp, char *message, int (*fc)())
|
||||
int CompatCheck(register struct node **nd, struct type *tp, char *message, int (*fc)())
|
||||
{
|
||||
if (! (*fc)(tp, (*nd)->nd_type)) {
|
||||
if (message) {
|
||||
|
@ -269,7 +269,7 @@ int CompatCheck(register t_node **nd, t_type *tp, char *message, int (*fc)())
|
|||
return 1;
|
||||
}
|
||||
|
||||
int ChkAssCompat(t_node **nd, t_type *tp, char *message)
|
||||
int ChkAssCompat(struct node **nd, struct type *tp, char *message)
|
||||
{
|
||||
/* Check assignment compatibility of node "nd" with type "tp".
|
||||
Give an error message when it fails
|
||||
|
@ -281,7 +281,7 @@ int ChkAssCompat(t_node **nd, t_type *tp, char *message)
|
|||
return CompatCheck(nd, tp, message, TstAssCompat);
|
||||
}
|
||||
|
||||
int ChkCompat(t_node **nd, t_type *tp, char *message)
|
||||
int ChkCompat(struct node **nd, struct type *tp, char *message)
|
||||
{
|
||||
/* Check compatibility of node "nd" with type "tp".
|
||||
Give an error message when it fails
|
||||
|
|
|
@ -8,18 +8,19 @@
|
|||
#ifndef TYPEQUIV_H_
|
||||
#define TYPEQUIV_H_
|
||||
|
||||
typedef struct type t_type;
|
||||
typedef struct node t_node;
|
||||
typedef struct def t_def;
|
||||
|
||||
int TstProcEquiv(t_type *tp1, t_type *tp2);
|
||||
int TstCompat(register t_type *tp1, register t_type *tp2);
|
||||
int TstAssCompat(register t_type *tp1, register t_type *tp2);
|
||||
int TstParCompat(int parno, register t_type *formaltype, int VARflag, t_node **nd, t_def *edf);
|
||||
struct node;
|
||||
struct def;
|
||||
struct type;
|
||||
|
||||
int ChkCompat(t_node **nd, t_type *tp, char *message);
|
||||
int ChkAssCompat(t_node **nd, t_type *tp, char *message);
|
||||
int TstProcEquiv(struct type *tp1, struct type *tp2);
|
||||
int TstCompat(register struct type *tp1, register struct type *tp2);
|
||||
int TstAssCompat(register struct type *tp1, register struct type *tp2);
|
||||
int TstParCompat(int parno, register struct type *formaltype, int VARflag, struct node **nd, struct def *edf);
|
||||
|
||||
char *incompat(register t_type *tp1, register t_type *tp2);
|
||||
int ChkCompat(struct node **nd, struct type *tp, char *message);
|
||||
int ChkAssCompat(struct node **nd, struct type *tp, char *message);
|
||||
|
||||
char *incompat(register struct type *tp1, register struct type *tp2);
|
||||
|
||||
#endif /* TYPEQUIV_H_ */
|
||||
|
|
|
@ -47,7 +47,7 @@
|
|||
#include "code.h"
|
||||
#include "warning.h"
|
||||
|
||||
int CaseCode(t_node *, label, int);
|
||||
int CaseCode(struct node *, label, int);
|
||||
|
||||
extern int proclevel;
|
||||
extern int gdb_flag;
|
||||
|
@ -55,10 +55,10 @@ extern int gdb_flag;
|
|||
label text_label;
|
||||
label data_label = 1;
|
||||
struct withdesig* WithDesigs;
|
||||
t_node* Modules;
|
||||
struct node* Modules;
|
||||
|
||||
static t_type* func_type;
|
||||
static t_node* priority;
|
||||
static struct type* func_type;
|
||||
static struct node* priority;
|
||||
static int oldlineno;
|
||||
|
||||
|
||||
|
@ -71,17 +71,17 @@ static int oldlineno;
|
|||
#define EXIT_FLAG 2
|
||||
|
||||
/* Forward declarations. */
|
||||
static void WalkDef(register t_def*);
|
||||
static void MkCalls(register t_def*);
|
||||
static void UseWarnings(register t_def*);
|
||||
static void RegisterMessage(register t_def*);
|
||||
static void WalkDefList(register t_def*, void (*proc)(t_def*));
|
||||
static void WalkDef(register struct def*);
|
||||
static void MkCalls(register struct def*);
|
||||
static void UseWarnings(register struct def*);
|
||||
static void RegisterMessage(register struct def*);
|
||||
static void WalkDefList(register struct def*, void (*proc)(struct def*));
|
||||
#ifdef DBSYMTAB
|
||||
static void stabdef(t_def*);
|
||||
static void stabdef(struct def*);
|
||||
#endif
|
||||
|
||||
|
||||
int LblWalkNode(label lbl, t_node *nd, int exit, int reach)
|
||||
int LblWalkNode(label lbl, struct node *nd, int exit, int reach)
|
||||
{
|
||||
/* Generate code for node "nd", after generating instruction
|
||||
label "lbl". "exit" is the exit label for the closest
|
||||
|
@ -127,7 +127,7 @@ void def_ilb(label l)
|
|||
oldlineno = 0;
|
||||
}
|
||||
|
||||
void DoLineno(register t_node* nd)
|
||||
void DoLineno(register struct node* nd)
|
||||
{
|
||||
if ((!options['L']
|
||||
#ifdef DBSYMTAB
|
||||
|
@ -173,10 +173,10 @@ void DoFilename(int needed)
|
|||
}
|
||||
}
|
||||
|
||||
void WalkModule(register t_def* module)
|
||||
void WalkModule(register struct def* module)
|
||||
{
|
||||
register t_scope* sc;
|
||||
t_scopelist* savevis = CurrVis;
|
||||
register struct scope* sc;
|
||||
struct scopelist* savevis = CurrVis;
|
||||
|
||||
CurrVis = module->mod_vis;
|
||||
priority = module->mod_priority;
|
||||
|
@ -216,7 +216,7 @@ void WalkModule(register t_def* module)
|
|||
Call initialization routines of imported modules.
|
||||
Also prevent recursive calls of this one.
|
||||
*/
|
||||
register t_node* nd = Modules;
|
||||
register struct node* nd = Modules;
|
||||
|
||||
if (state == IMPLEMENTATION)
|
||||
{
|
||||
|
@ -273,13 +273,13 @@ void WalkModule(register t_def* module)
|
|||
WalkDefList(sc->sc_def, UseWarnings);
|
||||
}
|
||||
|
||||
void WalkProcedure(register t_def* procedure)
|
||||
void WalkProcedure(register struct def* procedure)
|
||||
{
|
||||
|
||||
t_scopelist* savevis = CurrVis;
|
||||
register t_type* tp;
|
||||
register t_param* param;
|
||||
register t_scope* procscope = procedure->prc_vis->sc_scope;
|
||||
struct scopelist* savevis = CurrVis;
|
||||
register struct type* tp;
|
||||
register struct paramlist* param;
|
||||
register struct scope* procscope = procedure->prc_vis->sc_scope;
|
||||
label too_big = 0; /* returnsize larger than returnarea */
|
||||
arith StackAdjustment = 0; /* space for conformant arrays */
|
||||
arith retsav = 0; /* temporary space for return value */
|
||||
|
@ -562,7 +562,7 @@ void WalkProcedure(register t_def* procedure)
|
|||
}
|
||||
|
||||
/* Walk through a list of definitions */
|
||||
static void WalkDef(register t_def* df)
|
||||
static void WalkDef(register struct def* df)
|
||||
{
|
||||
|
||||
|
||||
|
@ -590,7 +590,7 @@ static void WalkDef(register t_def* df)
|
|||
}
|
||||
|
||||
/* Generate calls to initialization routines of modules */
|
||||
static void MkCalls(register t_def* df)
|
||||
static void MkCalls(register struct def* df)
|
||||
{
|
||||
|
||||
|
||||
|
@ -601,7 +601,7 @@ static void MkCalls(register t_def* df)
|
|||
}
|
||||
}
|
||||
|
||||
int WalkLink(register t_node* nd, label exit_label, int end_reached)
|
||||
int WalkLink(register struct node* nd, label exit_label, int end_reached)
|
||||
{
|
||||
|
||||
while (nd && nd->nd_class == Link)
|
||||
|
@ -613,19 +613,19 @@ int WalkLink(register t_node* nd, label exit_label, int end_reached)
|
|||
return WalkNode(nd, exit_label, end_reached);
|
||||
}
|
||||
|
||||
static void ForLoopVarExpr(register t_node* nd)
|
||||
static void ForLoopVarExpr(register struct node* nd)
|
||||
{
|
||||
register t_type* tp = nd->nd_type;
|
||||
register struct type* tp = nd->nd_type;
|
||||
|
||||
CodePExpr(nd);
|
||||
CodeCoercion(tp, BaseType(tp));
|
||||
}
|
||||
|
||||
int WalkStat(register t_node* nd, label exit_label, int end_reached)
|
||||
int WalkStat(register struct node* nd, label exit_label, int end_reached)
|
||||
{
|
||||
|
||||
register t_node* left = nd->nd_LEFT;
|
||||
register t_node* right = nd->nd_RIGHT;
|
||||
register struct node* left = nd->nd_LEFT;
|
||||
register struct node* right = nd->nd_RIGHT;
|
||||
|
||||
assert(nd->nd_class == Stat);
|
||||
|
||||
|
@ -647,7 +647,7 @@ int WalkStat(register t_node* nd, label exit_label, int end_reached)
|
|||
{
|
||||
case '(':
|
||||
{
|
||||
t_node* nd1 = nd;
|
||||
struct node* nd1 = nd;
|
||||
if (ChkCall(&nd1))
|
||||
{
|
||||
assert(nd == nd1);
|
||||
|
@ -741,8 +741,8 @@ int WalkStat(register t_node* nd, label exit_label, int end_reached)
|
|||
label l2 = ++text_label;
|
||||
int uns = 0;
|
||||
arith stepsize;
|
||||
t_type* bstp;
|
||||
t_node* loopid;
|
||||
struct type* bstp;
|
||||
struct node* loopid;
|
||||
|
||||
good_forvar = DoForInit(left);
|
||||
loopid = left->nd_LEFT;
|
||||
|
@ -840,9 +840,9 @@ int WalkStat(register t_node* nd, label exit_label, int end_reached)
|
|||
|
||||
case WITH:
|
||||
{
|
||||
t_scopelist link;
|
||||
struct scopelist link;
|
||||
struct withdesig wds;
|
||||
t_desig ds;
|
||||
struct desig ds;
|
||||
|
||||
if (!WalkDesignator(&(nd->nd_LEFT), &ds, D_USED))
|
||||
break;
|
||||
|
@ -918,7 +918,7 @@ int WalkStat(register t_node* nd, label exit_label, int end_reached)
|
|||
}
|
||||
|
||||
|
||||
int (*WalkTable[])(t_node*, label, int) = {
|
||||
int (*WalkTable[])(struct node*, label, int) = {
|
||||
NodeCrash,
|
||||
NodeCrash,
|
||||
NodeCrash,
|
||||
|
@ -934,12 +934,12 @@ int (*WalkTable[])(t_node*, label, int) = {
|
|||
WalkLink,
|
||||
};
|
||||
|
||||
extern t_desig null_desig;
|
||||
extern struct desig null_desig;
|
||||
|
||||
void ExpectBool(register t_node** pnd, label true_label, label false_label)
|
||||
void ExpectBool(register struct node** pnd, label true_label, label false_label)
|
||||
{
|
||||
|
||||
t_desig ds;
|
||||
struct desig ds;
|
||||
|
||||
ds = null_desig;
|
||||
if (ChkExpression(pnd))
|
||||
|
@ -953,7 +953,7 @@ void ExpectBool(register t_node** pnd, label true_label, label false_label)
|
|||
}
|
||||
}
|
||||
|
||||
int WalkDesignator(t_node** pnd, t_desig* ds, int flags)
|
||||
int WalkDesignator(struct node** pnd, struct desig* ds, int flags)
|
||||
{
|
||||
|
||||
if (!ChkVariable(pnd, flags))
|
||||
|
@ -964,12 +964,12 @@ int WalkDesignator(t_node** pnd, t_desig* ds, int flags)
|
|||
return 1;
|
||||
}
|
||||
|
||||
int DoForInit(t_node* nd)
|
||||
int DoForInit(struct node* nd)
|
||||
{
|
||||
register t_node* right = nd->nd_RIGHT;
|
||||
register t_def* df;
|
||||
t_type* base_tp;
|
||||
t_type *tpl, *tpr;
|
||||
register struct node* right = nd->nd_RIGHT;
|
||||
register struct def* df;
|
||||
struct type* base_tp;
|
||||
struct type *tpl, *tpr;
|
||||
int r;
|
||||
|
||||
r = ChkVariable(&(nd->nd_LEFT), D_USED | D_DEFINED);
|
||||
|
@ -994,7 +994,7 @@ int DoForInit(t_node* nd)
|
|||
|
||||
if (df->df_scope != CurrentScope)
|
||||
{
|
||||
register t_scopelist* sc = CurrVis;
|
||||
register struct scopelist* sc = CurrVis;
|
||||
|
||||
for (;;)
|
||||
{
|
||||
|
@ -1042,15 +1042,15 @@ int DoForInit(t_node* nd)
|
|||
}
|
||||
|
||||
|
||||
void DoAssign(register t_node* nd)
|
||||
void DoAssign(register struct node* nd)
|
||||
{
|
||||
/* May we do it in this order (expression first) ???
|
||||
The reference manual sais nothing about it, but the book does:
|
||||
it sais that the left hand side is evaluated first.
|
||||
DAMN THE BOOK!
|
||||
*/
|
||||
t_desig dsr;
|
||||
register t_type* tp;
|
||||
struct desig dsr;
|
||||
register struct type* tp;
|
||||
|
||||
if (!(ChkExpression(&(nd->nd_RIGHT)) & ChkVariable(&(nd->nd_LEFT), D_DEFINED)))
|
||||
return;
|
||||
|
@ -1078,9 +1078,9 @@ void DoAssign(register t_node* nd)
|
|||
CodeMove(&dsr, nd->nd_LEFT, tp);
|
||||
}
|
||||
|
||||
static void RegisterMessage(register t_def* df)
|
||||
static void RegisterMessage(register struct def* df)
|
||||
{
|
||||
register t_type* tp;
|
||||
register struct type* tp;
|
||||
|
||||
if (df->df_kind == D_VARIABLE)
|
||||
{
|
||||
|
@ -1107,7 +1107,7 @@ static void RegisterMessage(register t_def* df)
|
|||
}
|
||||
}
|
||||
|
||||
static void df_warning(t_node* nd, t_def* df, char* warning)
|
||||
static void df_warning(struct node* nd, struct def* df, char* warning)
|
||||
{
|
||||
if (!(df->df_kind & (D_VARIABLE | D_PROCEDURE | D_TYPE | D_CONST | D_PROCHEAD)))
|
||||
{
|
||||
|
@ -1123,9 +1123,9 @@ static void df_warning(t_node* nd, t_def* df, char* warning)
|
|||
}
|
||||
}
|
||||
|
||||
static void UseWarnings(register t_def* df)
|
||||
static void UseWarnings(register struct def* df)
|
||||
{
|
||||
t_node* nd = df->df_scope->sc_end;
|
||||
struct node* nd = df->df_scope->sc_end;
|
||||
|
||||
if (is_anon_idf(df->df_idf) || !(df->df_kind & (D_IMPORTED | D_VARIABLE | D_PROCEDURE | D_CONST | D_TYPE)) || (df->df_flags & (D_EXPORTED | D_QEXPORTED)))
|
||||
{
|
||||
|
@ -1134,7 +1134,7 @@ static void UseWarnings(register t_def* df)
|
|||
|
||||
if (df->df_kind & D_IMPORTED)
|
||||
{
|
||||
register t_def* df1 = df->imp_def;
|
||||
register struct def* df1 = df->imp_def;
|
||||
|
||||
df1->df_flags |= df->df_flags & (D_USED | D_DEFINED);
|
||||
if (df->df_kind == D_INUSE)
|
||||
|
@ -1170,7 +1170,7 @@ static void UseWarnings(register t_def* df)
|
|||
}
|
||||
}
|
||||
|
||||
static void WalkDefList(register t_def* df, void (*proc)(t_def*))
|
||||
static void WalkDefList(register struct def* df, void (*proc)(struct def*))
|
||||
{
|
||||
for (; df; df = df->df_nextinscope)
|
||||
{
|
||||
|
@ -1179,7 +1179,7 @@ static void WalkDefList(register t_def* df, void (*proc)(t_def*))
|
|||
}
|
||||
|
||||
#ifdef DBSYMTAB
|
||||
static void stabdef(t_def* df)
|
||||
static void stabdef(struct def* df)
|
||||
{
|
||||
switch (df->df_kind)
|
||||
{
|
||||
|
|
|
@ -11,13 +11,13 @@
|
|||
#include "em_label.h"
|
||||
|
||||
/* Forward type declarations. */
|
||||
typedef struct node t_node;
|
||||
typedef struct def t_def;
|
||||
typedef struct desig t_desig;
|
||||
struct node;
|
||||
struct def;
|
||||
struct desig;
|
||||
|
||||
/* Definition of WalkNode macro
|
||||
*/
|
||||
extern int (*WalkTable[])(t_node*, label, int);
|
||||
extern int (*WalkTable[])(struct node*, label, int);
|
||||
|
||||
#define WalkNode(xnd, xlab, rch) (*WalkTable[(unsigned int)((xnd)->nd_class)])((xnd), (xlab),(rch))
|
||||
|
||||
|
@ -33,10 +33,10 @@ extern label data_label;
|
|||
|
||||
|
||||
|
||||
int LblWalkNode(label lbl, t_node *nd, int exit, int reach);
|
||||
int LblWalkNode(label lbl, struct node *nd, int exit, int reach);
|
||||
void def_ilb(label l);
|
||||
/* Generate line information as necessary for "nd". */
|
||||
void DoLineno(register t_node* nd);
|
||||
void DoLineno(register struct node* nd);
|
||||
/* Generate filename information, when needed.
|
||||
This routine is called at the generation of a
|
||||
procedure entry, and after generating a call to
|
||||
|
@ -49,27 +49,27 @@ void DoFilename(int needed);
|
|||
Also generate code for its body.
|
||||
This code is collected in an initialization routine.
|
||||
*/
|
||||
void WalkModule(register t_def* module);
|
||||
void WalkModule(register struct def* module);
|
||||
/* Walk through the definition of a procedure and all its
|
||||
local definitions, checking and generating code.
|
||||
*/
|
||||
void WalkProcedure(register t_def* procedure);
|
||||
void WalkProcedure(register struct def* procedure);
|
||||
|
||||
/* Walk node "nd", which is a link.
|
||||
"exit_label" is set to a label number when inside a LOOP.
|
||||
"end_reached" maintains info about reachability (REACH_FLAG),
|
||||
and whether an EXIT statement was seen (EXIT_FLAG).
|
||||
*/
|
||||
int WalkLink(register t_node* nd, label exit_label, int end_reached);
|
||||
int WalkLink(register struct node* nd, label exit_label, int end_reached);
|
||||
/* Walk through a statement node "nd", generating code for it. */
|
||||
int WalkStat(register t_node* nd, label exit_label, int end_reached);
|
||||
int WalkStat(register struct node* nd, label exit_label, int end_reached);
|
||||
/* Generate code to evaluate a boolean expression "pnd" */
|
||||
void ExpectBool(register t_node** pnd, label true_label, label false_label);
|
||||
void ExpectBool(register struct node** pnd, label true_label, label false_label);
|
||||
/* Check designator and generate code for it */
|
||||
int WalkDesignator(t_node** pnd, t_desig* ds, int flags);
|
||||
int WalkDesignator(struct node** pnd, struct desig* ds, int flags);
|
||||
|
||||
void DoAssign(register t_node* nd);
|
||||
void DoAssign(register struct node* nd);
|
||||
|
||||
int DoForInit(t_node* nd);
|
||||
int DoForInit(struct node* nd);
|
||||
|
||||
#endif /* WALK_H_ */
|
||||
|
|
|
@ -486,7 +486,7 @@ void InitCst(void)
|
|||
max_int = full_mask[int_size] & ~(1L << (int_size * 8 - 1));
|
||||
min_int = - max_int;
|
||||
maxint_str = long2str(max_int, 10);
|
||||
maxint_str = Salloc(maxint_str, (unsigned int) strlen(maxint_str));
|
||||
maxint_str = Salloc(maxint_str, (unsigned int) strlen(maxint_str)+sizeof(char));
|
||||
wrd_bits = 8 * (int) word_size;
|
||||
if( !max_intset ) max_intset = wrd_bits - 1;
|
||||
}
|
||||
|
|
|
@ -9,3 +9,6 @@
|
|||
*/
|
||||
|
||||
#define fits_zeropage(x) (lowb(x) == (int)(x))
|
||||
|
||||
void branch(register int opc, expr_t exp);
|
||||
void code(expr_t exp, register int opc1, register int opc2);
|
||||
|
|
|
@ -8,66 +8,66 @@
|
|||
* Mostek 6500 keywords
|
||||
*/
|
||||
|
||||
0, EXTENSION, 0, ".l",
|
||||
0, EXTENSION, 8, ".h",
|
||||
0, A, 0, "a",
|
||||
0, X, 0, "x",
|
||||
0, Y, 0, "y",
|
||||
0, ADDOP, 0x60, "adc",
|
||||
0, ADDOP, 0x20, "and",
|
||||
0, ADDOP, 0xC0, "cmp",
|
||||
0, ADDOP, 0x40, "eor",
|
||||
0, ADDOP, 0xA0, "lda",
|
||||
0, ADDOP, 0x00, "ora",
|
||||
0, ADDOP, 0xE0, "sbc",
|
||||
0, ADDOP, 0x80, "sta",
|
||||
0, ROLOP, 0x00, "asl",
|
||||
0, ROLOP, 0x40, "lsr",
|
||||
0, ROLOP, 0x20, "rol",
|
||||
0, ROLOP, 0x60, "ror",
|
||||
0, BRAOP, 0x90, "bcc",
|
||||
0, BRAOP, 0xB0, "bcs",
|
||||
0, BRAOP, 0xF0, "beq",
|
||||
0, BRAOP, 0x30, "bmi",
|
||||
0, BRAOP, 0xD0, "bne",
|
||||
0, BRAOP, 0x10, "bpl",
|
||||
0, BRAOP, 0x50, "bvc",
|
||||
0, BRAOP, 0x70, "bvs",
|
||||
0, BITOP, 0x24, "bit",
|
||||
0, NOPOP, 0x00, "brk",
|
||||
0, NOPOP, 0x18, "clc",
|
||||
0, NOPOP, 0xD8, "cld",
|
||||
0, NOPOP, 0x58, "cli",
|
||||
0, NOPOP, 0xB8, "clv",
|
||||
0, NOPOP, 0xCA, "dex",
|
||||
0, NOPOP, 0x88, "dey",
|
||||
0, NOPOP, 0xE8, "inx",
|
||||
0, NOPOP, 0xC8, "iny",
|
||||
0, NOPOP, 0xEA, "nop",
|
||||
0, NOPOP, 0x48, "pha",
|
||||
0, NOPOP, 0x08, "php",
|
||||
0, NOPOP, 0x68, "pla",
|
||||
0, NOPOP, 0x28, "plp",
|
||||
0, NOPOP, 0x40, "rti",
|
||||
0, NOPOP, 0x60, "rts",
|
||||
0, NOPOP, 0x38, "sec",
|
||||
0, NOPOP, 0xF8, "sed",
|
||||
0, NOPOP, 0x78, "sei",
|
||||
0, NOPOP, 0xAA, "tax",
|
||||
0, NOPOP, 0xA8, "tay",
|
||||
0, NOPOP, 0x98, "tya",
|
||||
0, NOPOP, 0xBA, "tsx",
|
||||
0, NOPOP, 0x8A, "txa",
|
||||
0, NOPOP, 0x9A, "txs",
|
||||
0, CPXOP, 0xE0, "cpx",
|
||||
0, CPXOP, 0xC0, "cpy",
|
||||
0, INCOP, 0xC0, "dec",
|
||||
0, INCOP, 0xE0, "inc",
|
||||
0, JMPOP, 0x4C, "jmp",
|
||||
0, JSROP, 0x20, "jsr",
|
||||
0, LDXOP, 0xA0, "ldx",
|
||||
0, LDYOP, 0xA0, "ldy",
|
||||
0, STXOP, 0x80, "stx",
|
||||
0, STYOP, 0x80, "sty",
|
||||
0, PSEU, 0x1860, "add",
|
||||
0, PSEU, 0x38E0, "sub",
|
||||
{0, EXTENSION, 0, ".l"},
|
||||
{0, EXTENSION, 8, ".h"},
|
||||
{0, A, 0, "a"},
|
||||
{0, X, 0, "x"},
|
||||
{0, Y, 0, "y"},
|
||||
{0, ADDOP, 0x60, "adc"},
|
||||
{0, ADDOP, 0x20, "and"},
|
||||
{0, ADDOP, 0xC0, "cmp"},
|
||||
{0, ADDOP, 0x40, "eor"},
|
||||
{0, ADDOP, 0xA0, "lda"},
|
||||
{0, ADDOP, 0x00, "ora"},
|
||||
{0, ADDOP, 0xE0, "sbc"},
|
||||
{0, ADDOP, 0x80, "sta"},
|
||||
{0, ROLOP, 0x00, "asl"},
|
||||
{0, ROLOP, 0x40, "lsr"},
|
||||
{0, ROLOP, 0x20, "rol"},
|
||||
{0, ROLOP, 0x60, "ror"},
|
||||
{0, BRAOP, 0x90, "bcc"},
|
||||
{0, BRAOP, 0xB0, "bcs"},
|
||||
{0, BRAOP, 0xF0, "beq"},
|
||||
{0, BRAOP, 0x30, "bmi"},
|
||||
{0, BRAOP, 0xD0, "bne"},
|
||||
{0, BRAOP, 0x10, "bpl"},
|
||||
{0, BRAOP, 0x50, "bvc"},
|
||||
{0, BRAOP, 0x70, "bvs"},
|
||||
{0, BITOP, 0x24, "bit"},
|
||||
{0, NOPOP, 0x00, "brk"},
|
||||
{0, NOPOP, 0x18, "clc"},
|
||||
{0, NOPOP, 0xD8, "cld"},
|
||||
{0, NOPOP, 0x58, "cli"},
|
||||
{0, NOPOP, 0xB8, "clv"},
|
||||
{0, NOPOP, 0xCA, "dex"},
|
||||
{0, NOPOP, 0x88, "dey"},
|
||||
{0, NOPOP, 0xE8, "inx"},
|
||||
{0, NOPOP, 0xC8, "iny"},
|
||||
{0, NOPOP, 0xEA, "nop"},
|
||||
{0, NOPOP, 0x48, "pha"},
|
||||
{0, NOPOP, 0x08, "php"},
|
||||
{0, NOPOP, 0x68, "pla"},
|
||||
{0, NOPOP, 0x28, "plp"},
|
||||
{0, NOPOP, 0x40, "rti"},
|
||||
{0, NOPOP, 0x60, "rts"},
|
||||
{0, NOPOP, 0x38, "sec"},
|
||||
{0, NOPOP, 0xF8, "sed"},
|
||||
{0, NOPOP, 0x78, "sei"},
|
||||
{0, NOPOP, 0xAA, "tax"},
|
||||
{0, NOPOP, 0xA8, "tay"},
|
||||
{0, NOPOP, 0x98, "tya"},
|
||||
{0, NOPOP, 0xBA, "tsx"},
|
||||
{0, NOPOP, 0x8A, "txa"},
|
||||
{0, NOPOP, 0x9A, "txs"},
|
||||
{0, CPXOP, 0xE0, "cpx"},
|
||||
{0, CPXOP, 0xC0, "cpy"},
|
||||
{0, INCOP, 0xC0, "dec"},
|
||||
{0, INCOP, 0xE0, "inc"},
|
||||
{0, JMPOP, 0x4C, "jmp"},
|
||||
{0, JSROP, 0x20, "jsr"},
|
||||
{0, LDXOP, 0xA0, "ldx"},
|
||||
{0, LDYOP, 0xA0, "ldy"},
|
||||
{0, STXOP, 0x80, "stx"},
|
||||
{0, STYOP, 0x80, "sty"},
|
||||
{0, PSEU, 0x1860, "add"},
|
||||
{0, PSEU, 0x38E0, "sub"},
|
||||
|
|
|
@ -8,9 +8,7 @@
|
|||
* Mostek 6500 special routines.
|
||||
*/
|
||||
|
||||
branch(opc, exp)
|
||||
register int opc;
|
||||
expr_t exp;
|
||||
void branch(register int opc, expr_t exp)
|
||||
{
|
||||
register int dist;
|
||||
|
||||
|
@ -29,9 +27,7 @@ expr_t exp;
|
|||
}
|
||||
}
|
||||
|
||||
code(exp, opc1, opc2)
|
||||
expr_t exp;
|
||||
register int opc1, opc2;
|
||||
void code(expr_t exp, register int opc1, register int opc2)
|
||||
{
|
||||
if (small((exp.typ & S_TYP) == S_ABS && fits_zeropage(exp.val), 1)) {
|
||||
emit1(opc1); emit1(exp.val);
|
||||
|
|
|
@ -3,8 +3,8 @@
|
|||
* (c) copyright 1987 by the Vrije Universiteit, Amsterdam, The Netherlands.
|
||||
* See the copyright notice in the ACK home directory, in the file "Copyright".
|
||||
*/
|
||||
con_part(sz,w) register sz; word w; {
|
||||
|
||||
void con_part(register int sz, word w)
|
||||
{
|
||||
while (part_size % sz)
|
||||
part_size++;
|
||||
if (part_size == TEM_WSIZE)
|
||||
|
@ -21,17 +21,16 @@ con_part(sz,w) register sz; word w; {
|
|||
part_size += sz;
|
||||
}
|
||||
|
||||
con_mult(sz) word sz; {
|
||||
long atol();
|
||||
|
||||
void con_mult(word sz)
|
||||
{
|
||||
if (sz != 4)
|
||||
fatal("bad icon/ucon size");
|
||||
fprintf(codefile,".data4 %ld\n", atol(str));
|
||||
}
|
||||
|
||||
|
||||
con_float() {
|
||||
|
||||
void con_float(void)
|
||||
{
|
||||
static int been_here;
|
||||
if (argval != 4 && argval != 8)
|
||||
fatal("bad fcon size");
|
||||
|
@ -45,8 +44,8 @@ static int been_here;
|
|||
}
|
||||
}
|
||||
|
||||
prolog(nlocals) full nlocals; {
|
||||
|
||||
void prolog(full nlocals)
|
||||
{
|
||||
fprintf(codefile,"\tjsr Pro\n");
|
||||
if (nlocals == 0)
|
||||
return;
|
||||
|
@ -56,9 +55,9 @@ prolog(nlocals) full nlocals; {
|
|||
nlocals, nlocals);
|
||||
}
|
||||
|
||||
mes(type) word type; {
|
||||
void mes(word type)
|
||||
{
|
||||
int argt ;
|
||||
|
||||
switch ( (int)type ) {
|
||||
case ms_ext :
|
||||
for (;;) {
|
||||
|
|
|
@ -4,6 +4,9 @@
|
|||
*/
|
||||
/* $Id$ */
|
||||
|
||||
#include "tables.h"
|
||||
#include "types.h"
|
||||
|
||||
#define ex_ap(y) fprintf(codefile,".extern %s\n",y)
|
||||
#define in_ap(y) /* nothing */
|
||||
|
||||
|
@ -29,3 +32,11 @@
|
|||
#define fmt_id(ft, fs) sprintf(fs,"_%s",ft)
|
||||
|
||||
#define BSS_INIT 0
|
||||
|
||||
void con_float(void);
|
||||
void con_mult(word sz);
|
||||
void con_part(register int sz, word w);
|
||||
void mes(word type);
|
||||
void prolog(full nlocals);
|
||||
|
||||
|
||||
|
|
|
@ -7,3 +7,6 @@
|
|||
/*
|
||||
* Motorola 6800 C declarations
|
||||
*/
|
||||
|
||||
void branch(register int opc, expr_t exp);
|
||||
|
||||
|
|
|
@ -7,112 +7,112 @@
|
|||
/*
|
||||
* Motorola 6800 keywords
|
||||
*/
|
||||
0, X, 0, "x",
|
||||
0, BRANCH, 0x20, "bra",
|
||||
0, BRANCH, 0x22, "bhi",
|
||||
0, BRANCH, 0x23, "bls",
|
||||
0, BRANCH, 0x24, "bhs", /* bcc */
|
||||
0, BRANCH, 0x24, "bcc",
|
||||
0, BRANCH, 0x25, "blo", /* bcs */
|
||||
0, BRANCH, 0x25, "bcs",
|
||||
0, BRANCH, 0x26, "bne",
|
||||
0, BRANCH, 0x27, "beq",
|
||||
0, BRANCH, 0x28, "bvc",
|
||||
0, BRANCH, 0x29, "bvs",
|
||||
0, BRANCH, 0x2A, "bpl",
|
||||
0, BRANCH, 0x2B, "bmi",
|
||||
0, BRANCH, 0x2C, "bge",
|
||||
0, BRANCH, 0x2D, "blt",
|
||||
0, BRANCH, 0x2E, "bgt",
|
||||
0, BRANCH, 0x2F, "ble",
|
||||
0, BRANCH, 0x8D, "bsr",
|
||||
0, XOP, 0xA0, "suba",
|
||||
0, XOP, 0xA1, "cmpa",
|
||||
0, XOP, 0xA2, "sbca",
|
||||
0, XOP, 0xA4, "anda",
|
||||
0, XOP, 0xA5, "bita",
|
||||
0, XOP, 0xA6, "ldaa",
|
||||
0, XOP, 0xA8, "eora",
|
||||
0, XOP, 0xA9, "adca",
|
||||
0, XOP, 0xAA, "oraa",
|
||||
0, XOP, 0xAB, "adda",
|
||||
0, XOP, 0xE0, "subb",
|
||||
0, XOP, 0xE1, "cmpb",
|
||||
0, XOP, 0xE2, "sbcb",
|
||||
0, XOP, 0xE4, "andb",
|
||||
0, XOP, 0xE5, "bitb",
|
||||
0, XOP, 0xE6, "ldab",
|
||||
0, XOP, 0xE8, "eorb",
|
||||
0, XOP, 0xE9, "adcb",
|
||||
0, XOP, 0xEA, "orab",
|
||||
0, XOP, 0xEB, "addb",
|
||||
0, AOP, 0x60, "neg",
|
||||
0, NOARG, 0x40, "nega",
|
||||
0, NOARG, 0x50, "negb",
|
||||
0, AOP, 0x63, "com",
|
||||
0, NOARG, 0x43, "coma",
|
||||
0, NOARG, 0x53, "comb",
|
||||
0, AOP, 0x64, "lsr",
|
||||
0, NOARG, 0x44, "lsra",
|
||||
0, NOARG, 0x54, "lsrb",
|
||||
0, AOP, 0x66, "ror",
|
||||
0, NOARG, 0x46, "rora",
|
||||
0, NOARG, 0x56, "rorb",
|
||||
0, AOP, 0x67, "asr",
|
||||
0, NOARG, 0x47, "asra",
|
||||
0, NOARG, 0x57, "asrb",
|
||||
0, AOP, 0x68, "asl",
|
||||
0, NOARG, 0x48, "asla",
|
||||
0, NOARG, 0x58, "aslb",
|
||||
0, AOP, 0x68, "lsl",
|
||||
0, NOARG, 0x48, "lsla",
|
||||
0, NOARG, 0x58, "lslb",
|
||||
0, AOP, 0x69, "rol",
|
||||
0, NOARG, 0x49, "rola",
|
||||
0, NOARG, 0x59, "rolb",
|
||||
0, AOP, 0x6A, "dec",
|
||||
0, NOARG, 0x4A, "deca",
|
||||
0, NOARG, 0x5A, "decb",
|
||||
0, AOP, 0x6C, "inc",
|
||||
0, NOARG, 0x4C, "inca",
|
||||
0, NOARG, 0x5C, "incb",
|
||||
0, AOP, 0x6D, "tst",
|
||||
0, NOARG, 0x4D, "tsta",
|
||||
0, NOARG, 0x5D, "tstb",
|
||||
0, AOP, 0x6F, "clr",
|
||||
0, NOARG, 0x4F, "clra",
|
||||
0, NOARG, 0x5F, "clrb",
|
||||
0, XOP, 0x6E, "jmp",
|
||||
0, XOP, 0xAD, "jsr",
|
||||
0, XOP, 0xAC, "cpx",
|
||||
0, XOP, 0xAE, "ldx",
|
||||
0, XOP, 0xEE, "lds",
|
||||
0, XOP, 0xA7, "sta",
|
||||
0, XOP, 0xE7, "stb",
|
||||
0, XOP, 0xAF, "stx",
|
||||
0, XOP, 0xEF, "sts",
|
||||
0, NOARG, 0x19, "daa",
|
||||
0, NOARG, 0x01, "nop",
|
||||
0, NOARG, 0x3B, "rti",
|
||||
0, NOARG, 0x39, "rts",
|
||||
0, NOARG, 0x3F, "swi",
|
||||
0, NOARG, 0x0C, "clc",
|
||||
0, NOARG, 0x0D, "sec",
|
||||
0, NOARG, 0x0E, "cli",
|
||||
0, NOARG, 0x0F, "sei",
|
||||
0, NOARG, 0x0A, "clv",
|
||||
0, NOARG, 0x0B, "sev",
|
||||
0, NOARG, 0x3E, "wai",
|
||||
0, NOARG, 0x06, "tap",
|
||||
0, NOARG, 0x07, "tpa",
|
||||
0, NOARG, 0x1B, "aba",
|
||||
0, NOARG, 0x11, "cba",
|
||||
0, NOARG, 0x10, "sba",
|
||||
0, NOARG, 0x16, "tab",
|
||||
0, NOARG, 0x17, "tba",
|
||||
0, NOARG, 0x09, "dex",
|
||||
0, NOARG, 0x08, "inx",
|
||||
0, NOARG, 0x34, "des",
|
||||
0, NOARG, 0x31, "ins",
|
||||
0, NOARG, 0x35, "txs",
|
||||
0, NOARG, 0x30, "tsx",
|
||||
{0, X, 0, "x"},
|
||||
{0, BRANCH, 0x20, "bra"},
|
||||
{0, BRANCH, 0x22, "bhi"},
|
||||
{0, BRANCH, 0x23, "bls"},
|
||||
{0, BRANCH, 0x24, "bhs"}, /* bcc */
|
||||
{0, BRANCH, 0x24, "bcc"},
|
||||
{0, BRANCH, 0x25, "blo"}, /* bcs */
|
||||
{0, BRANCH, 0x25, "bcs"},
|
||||
{0, BRANCH, 0x26, "bne"},
|
||||
{0, BRANCH, 0x27, "beq"},
|
||||
{0, BRANCH, 0x28, "bvc"},
|
||||
{0, BRANCH, 0x29, "bvs"},
|
||||
{0, BRANCH, 0x2A, "bpl"},
|
||||
{0, BRANCH, 0x2B, "bmi"},
|
||||
{0, BRANCH, 0x2C, "bge"},
|
||||
{0, BRANCH, 0x2D, "blt"},
|
||||
{0, BRANCH, 0x2E, "bgt"},
|
||||
{0, BRANCH, 0x2F, "ble"},
|
||||
{0, BRANCH, 0x8D, "bsr"},
|
||||
{0, XOP, 0xA0, "suba"},
|
||||
{0, XOP, 0xA1, "cmpa"},
|
||||
{0, XOP, 0xA2, "sbca"},
|
||||
{0, XOP, 0xA4, "anda"},
|
||||
{0, XOP, 0xA5, "bita"},
|
||||
{0, XOP, 0xA6, "ldaa"},
|
||||
{0, XOP, 0xA8, "eora"},
|
||||
{0, XOP, 0xA9, "adca"},
|
||||
{0, XOP, 0xAA, "oraa"},
|
||||
{0, XOP, 0xAB, "adda"},
|
||||
{0, XOP, 0xE0, "subb"},
|
||||
{0, XOP, 0xE1, "cmpb"},
|
||||
{0, XOP, 0xE2, "sbcb"},
|
||||
{0, XOP, 0xE4, "andb"},
|
||||
{0, XOP, 0xE5, "bitb"},
|
||||
{0, XOP, 0xE6, "ldab"},
|
||||
{0, XOP, 0xE8, "eorb"},
|
||||
{0, XOP, 0xE9, "adcb"},
|
||||
{0, XOP, 0xEA, "orab"},
|
||||
{0, XOP, 0xEB, "addb"},
|
||||
{0, AOP, 0x60, "neg"},
|
||||
{0, NOARG, 0x40, "nega"},
|
||||
{0, NOARG, 0x50, "negb"},
|
||||
{0, AOP, 0x63, "com"},
|
||||
{0, NOARG, 0x43, "coma"},
|
||||
{0, NOARG, 0x53, "comb"},
|
||||
{0, AOP, 0x64, "lsr"},
|
||||
{0, NOARG, 0x44, "lsra"},
|
||||
{0, NOARG, 0x54, "lsrb"},
|
||||
{0, AOP, 0x66, "ror"},
|
||||
{0, NOARG, 0x46, "rora"},
|
||||
{0, NOARG, 0x56, "rorb"},
|
||||
{0, AOP, 0x67, "asr"},
|
||||
{0, NOARG, 0x47, "asra"},
|
||||
{0, NOARG, 0x57, "asrb"},
|
||||
{0, AOP, 0x68, "asl"},
|
||||
{0, NOARG, 0x48, "asla"},
|
||||
{0, NOARG, 0x58, "aslb"},
|
||||
{0, AOP, 0x68, "lsl"},
|
||||
{0, NOARG, 0x48, "lsla"},
|
||||
{0, NOARG, 0x58, "lslb"},
|
||||
{0, AOP, 0x69, "rol"},
|
||||
{0, NOARG, 0x49, "rola"},
|
||||
{0, NOARG, 0x59, "rolb"},
|
||||
{0, AOP, 0x6A, "dec"},
|
||||
{0, NOARG, 0x4A, "deca"},
|
||||
{0, NOARG, 0x5A, "decb"},
|
||||
{0, AOP, 0x6C, "inc"},
|
||||
{0, NOARG, 0x4C, "inca"},
|
||||
{0, NOARG, 0x5C, "incb"},
|
||||
{0, AOP, 0x6D, "tst"},
|
||||
{0, NOARG, 0x4D, "tsta"},
|
||||
{0, NOARG, 0x5D, "tstb"},
|
||||
{0, AOP, 0x6F, "clr"},
|
||||
{0, NOARG, 0x4F, "clra"},
|
||||
{0, NOARG, 0x5F, "clrb"},
|
||||
{0, XOP, 0x6E, "jmp"},
|
||||
{0, XOP, 0xAD, "jsr"},
|
||||
{0, XOP, 0xAC, "cpx"},
|
||||
{0, XOP, 0xAE, "ldx"},
|
||||
{0, XOP, 0xEE, "lds"},
|
||||
{0, XOP, 0xA7, "sta"},
|
||||
{0, XOP, 0xE7, "stb"},
|
||||
{0, XOP, 0xAF, "stx"},
|
||||
{0, XOP, 0xEF, "sts"},
|
||||
{0, NOARG, 0x19, "daa"},
|
||||
{0, NOARG, 0x01, "nop"},
|
||||
{0, NOARG, 0x3B, "rti"},
|
||||
{0, NOARG, 0x39, "rts"},
|
||||
{0, NOARG, 0x3F, "swi"},
|
||||
{0, NOARG, 0x0C, "clc"},
|
||||
{0, NOARG, 0x0D, "sec"},
|
||||
{0, NOARG, 0x0E, "cli"},
|
||||
{0, NOARG, 0x0F, "sei"},
|
||||
{0, NOARG, 0x0A, "clv"},
|
||||
{0, NOARG, 0x0B, "sev"},
|
||||
{0, NOARG, 0x3E, "wai"},
|
||||
{0, NOARG, 0x06, "tap"},
|
||||
{0, NOARG, 0x07, "tpa"},
|
||||
{0, NOARG, 0x1B, "aba"},
|
||||
{0, NOARG, 0x11, "cba"},
|
||||
{0, NOARG, 0x10, "sba"},
|
||||
{0, NOARG, 0x16, "tab"},
|
||||
{0, NOARG, 0x17, "tba"},
|
||||
{0, NOARG, 0x09, "dex"},
|
||||
{0, NOARG, 0x08, "inx"},
|
||||
{0, NOARG, 0x34, "des"},
|
||||
{0, NOARG, 0x31, "ins"},
|
||||
{0, NOARG, 0x35, "txs"},
|
||||
{0, NOARG, 0x30, "tsx"},
|
||||
|
|
|
@ -8,8 +8,9 @@
|
|||
* Motorola 6800 special routines
|
||||
*/
|
||||
|
||||
branch(opc,exp) register opc; expr_t exp; {
|
||||
register sm, dist;
|
||||
void branch(register int opc,expr_t exp)
|
||||
{
|
||||
register int sm, dist;
|
||||
int saving;
|
||||
|
||||
dist = exp.val - (DOTVAL + 2);
|
||||
|
|
|
@ -11,3 +11,5 @@
|
|||
extern int opt_cmos;
|
||||
|
||||
#define fitj(z) ((unsigned)z + 0x80 <= 0xFF)
|
||||
|
||||
void branch(register int opc,expr_t exp,expr_t cell);
|
||||
|
|
|
@ -10,118 +10,118 @@
|
|||
/*
|
||||
* The X register
|
||||
*/
|
||||
0, X, 0, "x",
|
||||
{0, X, 0, "x"},
|
||||
/*
|
||||
* Bit test and branch
|
||||
*/
|
||||
0, BBRANCH, 0x00, "brset",
|
||||
0, BBRANCH, 0x01, "brclr",
|
||||
{0, BBRANCH, 0x00, "brset"},
|
||||
{0, BBRANCH, 0x01, "brclr"},
|
||||
/*
|
||||
* Bit manipulation
|
||||
*/
|
||||
0, BIT, 0x10, "bset",
|
||||
0, BIT, 0x11, "bclr",
|
||||
{0, BIT, 0x10, "bset"},
|
||||
{0, BIT, 0x11, "bclr"},
|
||||
/*
|
||||
* Branches
|
||||
*/
|
||||
0, BRANCH, 0x20, "bra",
|
||||
0, BRANCH, 0x21, "brn",
|
||||
0, BRANCH, 0x22, "bhi",
|
||||
0, BRANCH, 0x23, "bls",
|
||||
0, BRANCH, 0x24, "bcc",
|
||||
0, BRANCH, 0x25, "bcs",
|
||||
0, BRANCH, 0x26, "bne",
|
||||
0, BRANCH, 0x27, "beq",
|
||||
0, BRANCH, 0x28, "bhcc",
|
||||
0, BRANCH, 0x29, "bhcs",
|
||||
0, BRANCH, 0x2a, "bpl",
|
||||
0, BRANCH, 0x2b, "bmi",
|
||||
0, BRANCH, 0x2c, "bmc",
|
||||
0, BRANCH, 0x2d, "bms",
|
||||
0, BRANCH, 0x2e, "bil",
|
||||
0, BRANCH, 0x2f, "bih",
|
||||
{0, BRANCH, 0x20, "bra"},
|
||||
{0, BRANCH, 0x21, "brn"},
|
||||
{0, BRANCH, 0x22, "bhi"},
|
||||
{0, BRANCH, 0x23, "bls"},
|
||||
{0, BRANCH, 0x24, "bcc"},
|
||||
{0, BRANCH, 0x25, "bcs"},
|
||||
{0, BRANCH, 0x26, "bne"},
|
||||
{0, BRANCH, 0x27, "beq"},
|
||||
{0, BRANCH, 0x28, "bhcc"},
|
||||
{0, BRANCH, 0x29, "bhcs"},
|
||||
{0, BRANCH, 0x2a, "bpl"},
|
||||
{0, BRANCH, 0x2b, "bmi"},
|
||||
{0, BRANCH, 0x2c, "bmc"},
|
||||
{0, BRANCH, 0x2d, "bms"},
|
||||
{0, BRANCH, 0x2e, "bil"},
|
||||
{0, BRANCH, 0x2f, "bih"},
|
||||
/*
|
||||
* Read modify write on anything but registers
|
||||
*/
|
||||
0, RMR, 0x30, "neg",
|
||||
0, RMR, 0x33, "com",
|
||||
0, RMR, 0x34, "lsr",
|
||||
0, RMR, 0x36, "ror",
|
||||
0, RMR, 0x36, "asr",
|
||||
0, RMR, 0x38, "lsl",
|
||||
0, RMR, 0x39, "rol",
|
||||
0, RMR, 0x3a, "dec",
|
||||
0, RMR, 0x3c, "inc",
|
||||
0, RMR, 0x3d, "tst",
|
||||
0, RMR, 0x3f, "clr",
|
||||
{0, RMR, 0x30, "neg"},
|
||||
{0, RMR, 0x33, "com"},
|
||||
{0, RMR, 0x34, "lsr"},
|
||||
{0, RMR, 0x36, "ror"},
|
||||
{0, RMR, 0x36, "asr"},
|
||||
{0, RMR, 0x38, "lsl"},
|
||||
{0, RMR, 0x39, "rol"},
|
||||
{0, RMR, 0x3a, "dec"},
|
||||
{0, RMR, 0x3c, "inc"},
|
||||
{0, RMR, 0x3d, "tst"},
|
||||
{0, RMR, 0x3f, "clr"},
|
||||
/*
|
||||
* Implied stuff
|
||||
*/
|
||||
0, NOARG, 0x80, "rti",
|
||||
0, NOARG, 0x81, "rts",
|
||||
0, NOARG, 0x83, "swi",
|
||||
0, NOARG, 0x97, "tax",
|
||||
0, NOARG, 0x98, "clc",
|
||||
0, NOARG, 0x99, "sec",
|
||||
0, NOARG, 0x9a, "cli",
|
||||
0, NOARG, 0x9b, "sei",
|
||||
0, NOARG, 0x9c, "rsp",
|
||||
0, NOARG, 0x9d, "nop",
|
||||
0, NOARG, 0x9f, "txa",
|
||||
{0, NOARG, 0x80, "rti"},
|
||||
{0, NOARG, 0x81, "rts"},
|
||||
{0, NOARG, 0x83, "swi"},
|
||||
{0, NOARG, 0x97, "tax"},
|
||||
{0, NOARG, 0x98, "clc"},
|
||||
{0, NOARG, 0x99, "sec"},
|
||||
{0, NOARG, 0x9a, "cli"},
|
||||
{0, NOARG, 0x9b, "sei"},
|
||||
{0, NOARG, 0x9c, "rsp"},
|
||||
{0, NOARG, 0x9d, "nop"},
|
||||
{0, NOARG, 0x9f, "txa"},
|
||||
/*
|
||||
* Register memory.
|
||||
* Warning. Some imediate opcodes excluded in parser actions.
|
||||
*/
|
||||
0, RM, 0xa0, "sub",
|
||||
0, RM, 0xa1, "cmp",
|
||||
0, RM, 0xa2, "sbc",
|
||||
0, RM, 0xa3, "cpx",
|
||||
0, RM, 0xa4, "and",
|
||||
0, RM, 0xa5, "bit",
|
||||
0, RM, 0xa6, "lda",
|
||||
0, RM, 0xa7, "sta",
|
||||
0, RM, 0xa8, "eor",
|
||||
0, RM, 0xa9, "adc",
|
||||
0, RM, 0xaa, "ora",
|
||||
0, RM, 0xab, "add",
|
||||
0, RM, 0xac, "jmp",
|
||||
0, BRANCH, 0xad, "bsr",
|
||||
0, RM, 0xad, "jsr",
|
||||
0, RM, 0xae, "ldx",
|
||||
0, RM, 0xaf, "stx",
|
||||
{0, RM, 0xa0, "sub"},
|
||||
{0, RM, 0xa1, "cmp"},
|
||||
{0, RM, 0xa2, "sbc"},
|
||||
{0, RM, 0xa3, "cpx"},
|
||||
{0, RM, 0xa4, "and"},
|
||||
{0, RM, 0xa5, "bit"},
|
||||
{0, RM, 0xa6, "lda"},
|
||||
{0, RM, 0xa7, "sta"},
|
||||
{0, RM, 0xa8, "eor"},
|
||||
{0, RM, 0xa9, "adc"},
|
||||
{0, RM, 0xaa, "ora"},
|
||||
{0, RM, 0xab, "add"},
|
||||
{0, RM, 0xac, "jmp"},
|
||||
{0, BRANCH, 0xad, "bsr"},
|
||||
{0, RM, 0xad, "jsr"},
|
||||
{0, RM, 0xae, "ldx"},
|
||||
{0, RM, 0xaf, "stx"},
|
||||
/*
|
||||
* Branch synonyms
|
||||
*/
|
||||
0, BRANCH, 0x24, "bhs", /* bcc */
|
||||
0, BRANCH, 0x25, "blo", /* bcs */
|
||||
{0, BRANCH, 0x24, "bhs"}, /* bcc */
|
||||
{0, BRANCH, 0x25, "blo"}, /* bcs */
|
||||
/*
|
||||
* Brain damaged concatenated opcodes for RMR on registers
|
||||
*/
|
||||
0, NOARG, 0x40, "nega",
|
||||
0, NOARG, 0x43, "coma",
|
||||
0, NOARG, 0x44, "lsra",
|
||||
0, NOARG, 0x46, "rora",
|
||||
0, NOARG, 0x47, "asra",
|
||||
0, NOARG, 0x48, "lsla",
|
||||
0, NOARG, 0x49, "rola",
|
||||
0, NOARG, 0x4a, "deca",
|
||||
0, NOARG, 0x4c, "inca",
|
||||
0, NOARG, 0x4d, "tsta",
|
||||
0, NOARG, 0x4f, "clra",
|
||||
0, NOARG, 0x50, "negx",
|
||||
0, NOARG, 0x53, "comx",
|
||||
0, NOARG, 0x54, "lsrx",
|
||||
0, NOARG, 0x56, "rorx",
|
||||
0, NOARG, 0x57, "asrx",
|
||||
0, NOARG, 0x58, "lslx",
|
||||
0, NOARG, 0x59, "rolx",
|
||||
0, NOARG, 0x5a, "decx",
|
||||
0, NOARG, 0x5c, "incx",
|
||||
0, NOARG, 0x5d, "tstx",
|
||||
0, NOARG, 0x5f, "clrx",
|
||||
{0, NOARG, 0x40, "nega"},
|
||||
{0, NOARG, 0x43, "coma"},
|
||||
{0, NOARG, 0x44, "lsra"},
|
||||
{0, NOARG, 0x46, "rora"},
|
||||
{0, NOARG, 0x47, "asra"},
|
||||
{0, NOARG, 0x48, "lsla"},
|
||||
{0, NOARG, 0x49, "rola"},
|
||||
{0, NOARG, 0x4a, "deca"},
|
||||
{0, NOARG, 0x4c, "inca"},
|
||||
{0, NOARG, 0x4d, "tsta"},
|
||||
{0, NOARG, 0x4f, "clra"},
|
||||
{0, NOARG, 0x50, "negx"},
|
||||
{0, NOARG, 0x53, "comx"},
|
||||
{0, NOARG, 0x54, "lsrx"},
|
||||
{0, NOARG, 0x56, "rorx"},
|
||||
{0, NOARG, 0x57, "asrx"},
|
||||
{0, NOARG, 0x58, "lslx"},
|
||||
{0, NOARG, 0x59, "rolx"},
|
||||
{0, NOARG, 0x5a, "decx"},
|
||||
{0, NOARG, 0x5c, "incx"},
|
||||
{0, NOARG, 0x5d, "tstx"},
|
||||
{0, NOARG, 0x5f, "clrx"},
|
||||
/*
|
||||
* CMOS support
|
||||
*/
|
||||
0, CMOS, 0, ".cmos",
|
||||
0, CMOS, 0x8e, "stop",
|
||||
0, CMOS, 0x8f, "wait",
|
||||
{0, CMOS, 0, ".cmos"},
|
||||
{0, CMOS, 0x8e, "stop"},
|
||||
{0, CMOS, 0x8f, "wait"},
|
||||
|
|
|
@ -31,7 +31,10 @@ operation
|
|||
{ emit1($1);}
|
||||
|
|
||||
BRANCH expr
|
||||
{ branch($1,$2);}
|
||||
{
|
||||
/* Empty expression */
|
||||
struct expr_t expr = {0,0};
|
||||
branch($1,$2,expr);}
|
||||
|
|
||||
BBRANCH bitexp ',' expr8 ',' expr
|
||||
{
|
||||
|
|
|
@ -9,8 +9,9 @@
|
|||
*/
|
||||
|
||||
/* VARARGS2 */
|
||||
branch(opc,exp,cell) register opc; expr_t cell; expr_t exp; {
|
||||
register sm, dist;
|
||||
void branch(register int opc,expr_t exp,expr_t cell)
|
||||
{
|
||||
register int sm, dist;
|
||||
int saving;
|
||||
|
||||
dist = exp.val - (DOTVAL + 2);
|
||||
|
|
|
@ -42,3 +42,10 @@ int regbit[] = { /* push-pull coding */
|
|||
#define B 9
|
||||
#define CC 10
|
||||
#define DP 11
|
||||
|
||||
|
||||
/* Motorola 6809 specific routines */
|
||||
void branch(register int opc, expr_t exp);
|
||||
int regno(register int r);
|
||||
void emit1or2(int n);
|
||||
void offset(register int reg, expr_t exp, register int ind);
|
||||
|
|
|
@ -8,163 +8,163 @@
|
|||
* Motorola 6809 keywords
|
||||
*/
|
||||
|
||||
0, REG, A, "a",
|
||||
0, REG, B, "b",
|
||||
0, REG, CC, "cc",
|
||||
0, REG, DP, "dp",
|
||||
0, REG, D, "d",
|
||||
0, REG, X, "x",
|
||||
0, REG, Y, "y",
|
||||
0, REG, U, "u",
|
||||
0, REG, S, "s",
|
||||
0, REG, PC, "pc",
|
||||
0, ALL, 0xFF, "all",
|
||||
0, SETDP, 0, "setdp",
|
||||
0, NOARG, 0x3A, "abx",
|
||||
0, NOARG, 0x19, "daa",
|
||||
0, NOARG, 0x3D, "mul",
|
||||
0, NOARG, 0x12, "nop",
|
||||
0, NOARG, 0x10, "page2",
|
||||
0, NOARG, 0x11, "page3",
|
||||
0, NOARG, 0x3B, "rti",
|
||||
0, NOARG, 0x4F, "clra",
|
||||
0, NOARG, 0x5F, "clrb",
|
||||
0, NOARG, 0x4A, "deca",
|
||||
0, NOARG, 0x5A, "decb",
|
||||
0, NOARG, 0x43, "coma",
|
||||
0, NOARG, 0x53, "comb",
|
||||
0, NOARG, 0x44, "lsra",
|
||||
0, NOARG, 0x54, "lsrb",
|
||||
0, NOARG, 0x40, "nega",
|
||||
0, NOARG, 0x50, "negb",
|
||||
0, NOARG, 0x46, "rora",
|
||||
0, NOARG, 0x56, "rorb",
|
||||
0, NOARG, 0x47, "asra",
|
||||
0, NOARG, 0x57, "asrb",
|
||||
0, NOARG, 0x49, "rola",
|
||||
0, NOARG, 0x59, "rolb",
|
||||
0, NOARG, 0x48, "asla",
|
||||
0, NOARG, 0x58, "aslb",
|
||||
0, NOARG, 0x48, "lsla",
|
||||
0, NOARG, 0x58, "lslb",
|
||||
0, NOARG, 0x4C, "inca",
|
||||
0, NOARG, 0x5C, "incb",
|
||||
0, NOARG, 0x4D, "tsta",
|
||||
0, NOARG, 0x5D, "tstb",
|
||||
0, NOARG, 0x39, "rts",
|
||||
0, NOARG, 0x1D, "sex",
|
||||
0, NOARG, 0x3F, "swi",
|
||||
0, NOARG, 0x103F, "swi2",
|
||||
0, NOARG, 0x113F, "swi3",
|
||||
0, NOARG, 0x13, "sync",
|
||||
0, BRANCH, 0x20, "bra",
|
||||
0, BRANCH, 0x21, "brn",
|
||||
0, BRANCH, 0x22, "bhi",
|
||||
0, BRANCH, 0x23, "bls",
|
||||
0, BRANCH, 0x24, "bhs",
|
||||
0, BRANCH, 0x24, "bcc",
|
||||
0, BRANCH, 0x25, "blo",
|
||||
0, BRANCH, 0x25, "bcs",
|
||||
0, BRANCH, 0x26, "bne",
|
||||
0, BRANCH, 0x27, "beq",
|
||||
0, BRANCH, 0x28, "bvc",
|
||||
0, BRANCH, 0x29, "bvs",
|
||||
0, BRANCH, 0x2A, "bpl",
|
||||
0, BRANCH, 0x2B, "bmi",
|
||||
0, BRANCH, 0x2C, "bge",
|
||||
0, BRANCH, 0x2D, "blt",
|
||||
0, BRANCH, 0x2E, "bgt",
|
||||
0, BRANCH, 0x2F, "ble",
|
||||
0, BRANCH, 0x8D, "bsr",
|
||||
0, STACK, 0x34, "pshs",
|
||||
0, STACK, 0x35, "puls",
|
||||
0, STACK, 0x36, "pshu",
|
||||
0, STACK, 0x37, "pulu",
|
||||
0, IMMED, 0x1A, "orcc",
|
||||
0, IMMED, 0x1C, "andcc",
|
||||
0, IMMED, 0x3C, "cwai",
|
||||
0, TWOREG, 0x1E, "exg",
|
||||
0, TWOREG, 0x1F, "tfr",
|
||||
0, XOP, 0xA0, "suba",
|
||||
0, XOP, 0xA1, "cmpa",
|
||||
0, XOP, 0xA2, "sbca",
|
||||
0, XOP, 0xA4, "anda",
|
||||
0, XOP, 0xA5, "bita",
|
||||
0, XOP, 0xA6, "lda",
|
||||
0, XOP, 0xA8, "eora",
|
||||
0, XOP, 0xA9, "adca",
|
||||
0, XOP, 0xAA, "ora",
|
||||
0, XOP, 0xAB, "adda",
|
||||
0, XOP, 0xE0, "subb",
|
||||
0, XOP, 0xE1, "cmpb",
|
||||
0, XOP, 0xE2, "sbcb",
|
||||
0, XOP, 0xE4, "andb",
|
||||
0, XOP, 0xE5, "bitb",
|
||||
0, XOP, 0xE6, "ldb",
|
||||
0, XOP, 0xE8, "eorb",
|
||||
0, XOP, 0xE9, "adcb",
|
||||
0, XOP, 0xEA, "orb",
|
||||
0, XOP, 0xEB, "addb",
|
||||
0, XOP, 0x30, "leax",
|
||||
0, XOP, 0x31, "leay",
|
||||
0, XOP, 0x32, "leas",
|
||||
0, XOP, 0x33, "leau",
|
||||
0, XOP, 0x60, "neg",
|
||||
0, XOP, 0x63, "com",
|
||||
0, XOP, 0x64, "lsr",
|
||||
0, XOP, 0x66, "ror",
|
||||
0, XOP, 0x67, "asr",
|
||||
0, XOP, 0x68, "asl",
|
||||
0, XOP, 0x68, "lsl",
|
||||
0, XOP, 0x69, "rol",
|
||||
0, XOP, 0x6A, "dec",
|
||||
0, XOP, 0x6C, "inc",
|
||||
0, XOP, 0x6D, "tst",
|
||||
0, XOP, 0x6F, "clr",
|
||||
0, XOP, 0x6E, "jmp",
|
||||
0, XOP, 0xA3, "subd",
|
||||
0, XOP, 0x10A3, "cmpd",
|
||||
0, XOP, 0x11A3, "cmpu",
|
||||
0, XOP, 0xAC, "cmpx",
|
||||
0, XOP, 0x10AC, "cmpy",
|
||||
0, XOP, 0x11AC, "cmps",
|
||||
0, XOP, 0xAE, "ldx",
|
||||
0, XOP, 0x10AE, "ldy",
|
||||
0, XOP, 0xE3, "addd",
|
||||
0, XOP, 0xEC, "ldd",
|
||||
0, XOP, 0xEE, "ldu",
|
||||
0, XOP, 0x10EE, "lds",
|
||||
0, XOP, 0xA7, "sta",
|
||||
0, XOP, 0xAD, "jsr",
|
||||
0, XOP, 0xAF, "stx",
|
||||
0, XOP, 0x10AF, "sty",
|
||||
0, XOP, 0xE7, "stb",
|
||||
0, XOP, 0xED, "std",
|
||||
0, XOP, 0xEF, "stu",
|
||||
0, XOP, 0x10EF, "sts",
|
||||
0, LBRNCH, 0x21, "lbrn",
|
||||
0, LBRNCH, 0x22, "lbhi",
|
||||
0, LBRNCH, 0x23, "lbls",
|
||||
0, LBRNCH, 0x24, "lbhs",
|
||||
0, LBRNCH, 0x24, "lbcc",
|
||||
0, LBRNCH, 0x25, "lblo",
|
||||
0, LBRNCH, 0x25, "lbcs",
|
||||
0, LBRNCH, 0x26, "lbne",
|
||||
0, LBRNCH, 0x27, "lbeq",
|
||||
0, LBRNCH, 0x28, "lbvc",
|
||||
0, LBRNCH, 0x29, "lbvs",
|
||||
0, LBRNCH, 0x2A, "lbpl",
|
||||
0, LBRNCH, 0x2B, "lbmi",
|
||||
0, LBRNCH, 0x2C, "lbge",
|
||||
0, LBRNCH, 0x2D, "lblt",
|
||||
0, LBRNCH, 0x2E, "lbgt",
|
||||
0, LBRNCH, 0x2F, "lble",
|
||||
0, SBRNCH, 0x16, "lbra",
|
||||
0, SBRNCH, 0x17, "lbsr",
|
||||
0, NOARG, 0x1CFE, "clc",
|
||||
0, NOARG, 0x1A01, "sec",
|
||||
0, NOARG, 0x1CEF, "cli",
|
||||
0, NOARG, 0x1A10, "sei",
|
||||
0, NOARG, 0x1CFD, "clv",
|
||||
0, NOARG, 0x1A02, "sev",
|
||||
0, NOARG, 0x3CFF, "wai",
|
||||
{0, REG, A, "a"},
|
||||
{0, REG, B, "b"},
|
||||
{0, REG, CC, "cc"},
|
||||
{0, REG, DP, "dp"},
|
||||
{0, REG, D, "d"},
|
||||
{0, REG, X, "x"},
|
||||
{0, REG, Y, "y"},
|
||||
{0, REG, U, "u"},
|
||||
{0, REG, S, "s"},
|
||||
{0, REG, PC, "pc"},
|
||||
{0, ALL, 0xFF, "all"},
|
||||
{0, SETDP, 0, "setdp"},
|
||||
{0, NOARG, 0x3A, "abx"},
|
||||
{0, NOARG, 0x19, "daa"},
|
||||
{0, NOARG, 0x3D, "mul"},
|
||||
{0, NOARG, 0x12, "nop"},
|
||||
{0, NOARG, 0x10, "page2"},
|
||||
{0, NOARG, 0x11, "page3"},
|
||||
{0, NOARG, 0x3B, "rti"},
|
||||
{0, NOARG, 0x4F, "clra"},
|
||||
{0, NOARG, 0x5F, "clrb"},
|
||||
{0, NOARG, 0x4A, "deca"},
|
||||
{0, NOARG, 0x5A, "decb"},
|
||||
{0, NOARG, 0x43, "coma"},
|
||||
{0, NOARG, 0x53, "comb"},
|
||||
{0, NOARG, 0x44, "lsra"},
|
||||
{0, NOARG, 0x54, "lsrb"},
|
||||
{0, NOARG, 0x40, "nega"},
|
||||
{0, NOARG, 0x50, "negb"},
|
||||
{0, NOARG, 0x46, "rora"},
|
||||
{0, NOARG, 0x56, "rorb"},
|
||||
{0, NOARG, 0x47, "asra"},
|
||||
{0, NOARG, 0x57, "asrb"},
|
||||
{0, NOARG, 0x49, "rola"},
|
||||
{0, NOARG, 0x59, "rolb"},
|
||||
{0, NOARG, 0x48, "asla"},
|
||||
{0, NOARG, 0x58, "aslb"},
|
||||
{0, NOARG, 0x48, "lsla"},
|
||||
{0, NOARG, 0x58, "lslb"},
|
||||
{0, NOARG, 0x4C, "inca"},
|
||||
{0, NOARG, 0x5C, "incb"},
|
||||
{0, NOARG, 0x4D, "tsta"},
|
||||
{0, NOARG, 0x5D, "tstb"},
|
||||
{0, NOARG, 0x39, "rts"},
|
||||
{0, NOARG, 0x1D, "sex"},
|
||||
{0, NOARG, 0x3F, "swi"},
|
||||
{0, NOARG, 0x103F, "swi2"},
|
||||
{0, NOARG, 0x113F, "swi3"},
|
||||
{0, NOARG, 0x13, "sync"},
|
||||
{0, BRANCH, 0x20, "bra"},
|
||||
{0, BRANCH, 0x21, "brn"},
|
||||
{0, BRANCH, 0x22, "bhi"},
|
||||
{0, BRANCH, 0x23, "bls"},
|
||||
{0, BRANCH, 0x24, "bhs"},
|
||||
{0, BRANCH, 0x24, "bcc"},
|
||||
{0, BRANCH, 0x25, "blo"},
|
||||
{0, BRANCH, 0x25, "bcs"},
|
||||
{0, BRANCH, 0x26, "bne"},
|
||||
{0, BRANCH, 0x27, "beq"},
|
||||
{0, BRANCH, 0x28, "bvc"},
|
||||
{0, BRANCH, 0x29, "bvs"},
|
||||
{0, BRANCH, 0x2A, "bpl"},
|
||||
{0, BRANCH, 0x2B, "bmi"},
|
||||
{0, BRANCH, 0x2C, "bge"},
|
||||
{0, BRANCH, 0x2D, "blt"},
|
||||
{0, BRANCH, 0x2E, "bgt"},
|
||||
{0, BRANCH, 0x2F, "ble"},
|
||||
{0, BRANCH, 0x8D, "bsr"},
|
||||
{0, STACK, 0x34, "pshs"},
|
||||
{0, STACK, 0x35, "puls"},
|
||||
{0, STACK, 0x36, "pshu"},
|
||||
{0, STACK, 0x37, "pulu"},
|
||||
{0, IMMED, 0x1A, "orcc"},
|
||||
{0, IMMED, 0x1C, "andcc"},
|
||||
{0, IMMED, 0x3C, "cwai"},
|
||||
{0, TWOREG, 0x1E, "exg"},
|
||||
{0, TWOREG, 0x1F, "tfr"},
|
||||
{0, XOP, 0xA0, "suba"},
|
||||
{0, XOP, 0xA1, "cmpa"},
|
||||
{0, XOP, 0xA2, "sbca"},
|
||||
{0, XOP, 0xA4, "anda"},
|
||||
{0, XOP, 0xA5, "bita"},
|
||||
{0, XOP, 0xA6, "lda"},
|
||||
{0, XOP, 0xA8, "eora"},
|
||||
{0, XOP, 0xA9, "adca"},
|
||||
{0, XOP, 0xAA, "ora"},
|
||||
{0, XOP, 0xAB, "adda"},
|
||||
{0, XOP, 0xE0, "subb"},
|
||||
{0, XOP, 0xE1, "cmpb"},
|
||||
{0, XOP, 0xE2, "sbcb"},
|
||||
{0, XOP, 0xE4, "andb"},
|
||||
{0, XOP, 0xE5, "bitb"},
|
||||
{0, XOP, 0xE6, "ldb"},
|
||||
{0, XOP, 0xE8, "eorb"},
|
||||
{0, XOP, 0xE9, "adcb"},
|
||||
{0, XOP, 0xEA, "orb"},
|
||||
{0, XOP, 0xEB, "addb"},
|
||||
{0, XOP, 0x30, "leax"},
|
||||
{0, XOP, 0x31, "leay"},
|
||||
{0, XOP, 0x32, "leas"},
|
||||
{0, XOP, 0x33, "leau"},
|
||||
{0, XOP, 0x60, "neg"},
|
||||
{0, XOP, 0x63, "com"},
|
||||
{0, XOP, 0x64, "lsr"},
|
||||
{0, XOP, 0x66, "ror"},
|
||||
{0, XOP, 0x67, "asr"},
|
||||
{0, XOP, 0x68, "asl"},
|
||||
{0, XOP, 0x68, "lsl"},
|
||||
{0, XOP, 0x69, "rol"},
|
||||
{0, XOP, 0x6A, "dec"},
|
||||
{0, XOP, 0x6C, "inc"},
|
||||
{0, XOP, 0x6D, "tst"},
|
||||
{0, XOP, 0x6F, "clr"},
|
||||
{0, XOP, 0x6E, "jmp"},
|
||||
{0, XOP, 0xA3, "subd"},
|
||||
{0, XOP, 0x10A3, "cmpd"},
|
||||
{0, XOP, 0x11A3, "cmpu"},
|
||||
{0, XOP, 0xAC, "cmpx"},
|
||||
{0, XOP, 0x10AC, "cmpy"},
|
||||
{0, XOP, 0x11AC, "cmps"},
|
||||
{0, XOP, 0xAE, "ldx"},
|
||||
{0, XOP, 0x10AE, "ldy"},
|
||||
{0, XOP, 0xE3, "addd"},
|
||||
{0, XOP, 0xEC, "ldd"},
|
||||
{0, XOP, 0xEE, "ldu"},
|
||||
{0, XOP, 0x10EE, "lds"},
|
||||
{0, XOP, 0xA7, "sta"},
|
||||
{0, XOP, 0xAD, "jsr"},
|
||||
{0, XOP, 0xAF, "stx"},
|
||||
{0, XOP, 0x10AF, "sty"},
|
||||
{0, XOP, 0xE7, "stb"},
|
||||
{0, XOP, 0xED, "std"},
|
||||
{0, XOP, 0xEF, "stu"},
|
||||
{0, XOP, 0x10EF, "sts"},
|
||||
{0, LBRNCH, 0x21, "lbrn"},
|
||||
{0, LBRNCH, 0x22, "lbhi"},
|
||||
{0, LBRNCH, 0x23, "lbls"},
|
||||
{0, LBRNCH, 0x24, "lbhs"},
|
||||
{0, LBRNCH, 0x24, "lbcc"},
|
||||
{0, LBRNCH, 0x25, "lblo"},
|
||||
{0, LBRNCH, 0x25, "lbcs"},
|
||||
{0, LBRNCH, 0x26, "lbne"},
|
||||
{0, LBRNCH, 0x27, "lbeq"},
|
||||
{0, LBRNCH, 0x28, "lbvc"},
|
||||
{0, LBRNCH, 0x29, "lbvs"},
|
||||
{0, LBRNCH, 0x2A, "lbpl"},
|
||||
{0, LBRNCH, 0x2B, "lbmi"},
|
||||
{0, LBRNCH, 0x2C, "lbge"},
|
||||
{0, LBRNCH, 0x2D, "lblt"},
|
||||
{0, LBRNCH, 0x2E, "lbgt"},
|
||||
{0, LBRNCH, 0x2F, "lble"},
|
||||
{0, SBRNCH, 0x16, "lbra"},
|
||||
{0, SBRNCH, 0x17, "lbsr"},
|
||||
{0, NOARG, 0x1CFE, "clc"},
|
||||
{0, NOARG, 0x1A01, "sec"},
|
||||
{0, NOARG, 0x1CEF, "cli"},
|
||||
{0, NOARG, 0x1A10, "sei"},
|
||||
{0, NOARG, 0x1CFD, "clv"},
|
||||
{0, NOARG, 0x1A02, "sev"},
|
||||
{0, NOARG, 0x3CFF, "wai"},
|
||||
|
|
|
@ -167,7 +167,7 @@ reglist : ALL
|
|||
{ if (($$ = regbit[$1]) < 0) serror("register error");}
|
||||
|
|
||||
reglist ',' REG
|
||||
{ register i;
|
||||
{ register int i;
|
||||
if ((i = regbit[$3]) < 0 || ($1 & i) != 0)
|
||||
serror("register error");
|
||||
$$ = $1 | i;
|
||||
|
|
|
@ -8,9 +8,7 @@
|
|||
* Motorola 6809 special routines
|
||||
*/
|
||||
|
||||
branch(opc, exp)
|
||||
register int opc;
|
||||
expr_t exp;
|
||||
void branch(register int opc, expr_t exp)
|
||||
{
|
||||
register int sm, dist;
|
||||
int saving;
|
||||
|
@ -47,7 +45,8 @@ expr_t exp;
|
|||
emit1(lowb(dist));
|
||||
}
|
||||
|
||||
regno(r) register r; {
|
||||
int regno(register int r)
|
||||
{
|
||||
switch (r) {
|
||||
case X: return 0;
|
||||
case Y: return 0x20;
|
||||
|
@ -57,15 +56,14 @@ regno(r) register r; {
|
|||
return -1;
|
||||
}
|
||||
|
||||
emit1or2(n) {
|
||||
void emit1or2(int n)
|
||||
{
|
||||
if (n & ~0xFF)
|
||||
emit1(n >> 8);
|
||||
emit1(n);
|
||||
}
|
||||
|
||||
offset(reg, exp, ind)
|
||||
register int reg, ind;
|
||||
expr_t exp;
|
||||
void offset(register int reg, expr_t exp, register int ind)
|
||||
{
|
||||
if (reg == PC) {
|
||||
int sm, dist;
|
||||
|
|
|
@ -1,3 +1,16 @@
|
|||
/* $Header; mach1.c, v1.1 06-Mar-89 AJM */
|
||||
extern word_t opcode;
|
||||
extern int success; /* LDR/STR address failure flag */
|
||||
|
||||
|
||||
/* ARM32 Specific routines */
|
||||
void branch(word_t brtyp, word_t link, valu_t val);
|
||||
void data(long opc, long ins, valu_t val, short typ);
|
||||
int calcimm(word_t *opc, valu_t *val,short typ);
|
||||
word_t calcoffset(valu_t val);
|
||||
void strldr(long opc, long ins, valu_t val);
|
||||
void calcadr(word_t ins, word_t reg, valu_t val, short typ);
|
||||
word_t calcshft(valu_t val, short typ, word_t styp);
|
||||
void rotateleft2(long *x);
|
||||
void putaddr(long opc, long ins, long val, int count);
|
||||
int oursmall(int fitsmall, int gain);
|
||||
|
|
|
@ -1,121 +1,121 @@
|
|||
/* $Id: mach3.c, v2.0 23-Feb-89 AJM */
|
||||
|
||||
0, COND, 0x00000000, ".EQ",
|
||||
0, COND, 0x10000000, ".NE",
|
||||
0, COND, 0x20000000, ".CS",
|
||||
0, COND, 0x20000000, ".HS",
|
||||
0, COND, 0x30000000, ".CC",
|
||||
0, COND, 0x30000000, ".LO",
|
||||
0, COND, 0x40000000, ".MI",
|
||||
0, COND, 0x50000000, ".PL",
|
||||
0, COND, 0x60000000, ".VS",
|
||||
0, COND, 0x70000000, ".VC",
|
||||
0, COND, 0x80000000, ".HI",
|
||||
0, COND, 0x90000000, ".LS",
|
||||
0, COND, 0xA0000000, ".GE",
|
||||
0, COND, 0xB0000000, ".LT",
|
||||
0, COND, 0xC0000000, ".GT",
|
||||
0, COND, 0xD0000000, ".LE",
|
||||
0, COND, 0xE0000000, ".AL",
|
||||
0, COND, 0xF0000000, ".NV",
|
||||
{0, COND, 0x00000000, ".EQ"},
|
||||
{0, COND, 0x10000000, ".NE"},
|
||||
{0, COND, 0x20000000, ".CS"},
|
||||
{0, COND, 0x20000000, ".HS"},
|
||||
{0, COND, 0x30000000, ".CC"},
|
||||
{0, COND, 0x30000000, ".LO"},
|
||||
{0, COND, 0x40000000, ".MI"},
|
||||
{0, COND, 0x50000000, ".PL"},
|
||||
{0, COND, 0x60000000, ".VS"},
|
||||
{0, COND, 0x70000000, ".VC"},
|
||||
{0, COND, 0x80000000, ".HI"},
|
||||
{0, COND, 0x90000000, ".LS"},
|
||||
{0, COND, 0xA0000000, ".GE"},
|
||||
{0, COND, 0xB0000000, ".LT"},
|
||||
{0, COND, 0xC0000000, ".GT"},
|
||||
{0, COND, 0xD0000000, ".LE"},
|
||||
{0, COND, 0xE0000000, ".AL"},
|
||||
{0, COND, 0xF0000000, ".NV"},
|
||||
|
||||
0, LINK, 0x01000000, ".L",
|
||||
{0, LINK, 0x01000000, ".L"},
|
||||
|
||||
0, BRANCH, 0x0A000000, "BEQ",
|
||||
0, BRANCH, 0x1A000000, "BNE",
|
||||
0, BRANCH, 0x2A000000, "BCS",
|
||||
0, BRANCH, 0x2A000000, "BHS",
|
||||
0, BRANCH, 0x3A000000, "BCC",
|
||||
0, BRANCH, 0x3A000000, "BLO",
|
||||
0, BRANCH, 0x4A000000, "BMI",
|
||||
0, BRANCH, 0x5A000000, "BPL",
|
||||
0, BRANCH, 0x6A000000, "BVS",
|
||||
0, BRANCH, 0x7A000000, "BVC",
|
||||
0, BRANCH, 0x8A000000, "BHI",
|
||||
0, BRANCH, 0x9A000000, "BLS",
|
||||
0, BRANCH, 0xAA000000, "BGE",
|
||||
0, BRANCH, 0xBA000000, "BLT",
|
||||
0, BRANCH, 0xCA000000, "BGT",
|
||||
0, BRANCH, 0xDA000000, "BLE",
|
||||
0, BRANCH, 0xEA000000, "BAL",
|
||||
0, BRANCH, 0xFA000000, "BNV",
|
||||
{0, BRANCH, 0x0A000000, "BEQ"},
|
||||
{0, BRANCH, 0x1A000000, "BNE"},
|
||||
{0, BRANCH, 0x2A000000, "BCS"},
|
||||
{0, BRANCH, 0x2A000000, "BHS"},
|
||||
{0, BRANCH, 0x3A000000, "BCC"},
|
||||
{0, BRANCH, 0x3A000000, "BLO"},
|
||||
{0, BRANCH, 0x4A000000, "BMI"},
|
||||
{0, BRANCH, 0x5A000000, "BPL"},
|
||||
{0, BRANCH, 0x6A000000, "BVS"},
|
||||
{0, BRANCH, 0x7A000000, "BVC"},
|
||||
{0, BRANCH, 0x8A000000, "BHI"},
|
||||
{0, BRANCH, 0x9A000000, "BLS"},
|
||||
{0, BRANCH, 0xAA000000, "BGE"},
|
||||
{0, BRANCH, 0xBA000000, "BLT"},
|
||||
{0, BRANCH, 0xCA000000, "BGT"},
|
||||
{0, BRANCH, 0xDA000000, "BLE"},
|
||||
{0, BRANCH, 0xEA000000, "BAL"},
|
||||
{0, BRANCH, 0xFA000000, "BNV"},
|
||||
|
||||
0, DATA1, ADC, "ADC",
|
||||
0, DATA1, ADD, "ADD",
|
||||
0, DATA1, AND, "AND",
|
||||
0, DATA1, BIC, "BIC",
|
||||
0, DATA1, EOR, "EOR",
|
||||
0, DATA1, ORR, "ORR",
|
||||
0, DATA1, RSB, "RSB",
|
||||
0, DATA1, RSC, "RSC",
|
||||
0, DATA1, SBC, "SBC",
|
||||
0, DATA1, SUB, "SUB",
|
||||
0, DATA2, MOV, "MOV",
|
||||
0, DATA2, MVN, "MVN",
|
||||
0, DATA3, CMN, "CMN",
|
||||
0, DATA3, CMP, "CMP",
|
||||
0, DATA3, TEQ, "TEQ",
|
||||
0, DATA3, TST, "TST",
|
||||
{0, DATA1, ADC, "ADC"},
|
||||
{0, DATA1, ADD, "ADD"},
|
||||
{0, DATA1, AND, "AND"},
|
||||
{0, DATA1, BIC, "BIC"},
|
||||
{0, DATA1, EOR, "EOR"},
|
||||
{0, DATA1, ORR, "ORR"},
|
||||
{0, DATA1, RSB, "RSB"},
|
||||
{0, DATA1, RSC, "RSC"},
|
||||
{0, DATA1, SBC, "SBC"},
|
||||
{0, DATA1, SUB, "SUB"},
|
||||
{0, DATA2, MOV, "MOV"},
|
||||
{0, DATA2, MVN, "MVN"},
|
||||
{0, DATA3, CMN, "CMN"},
|
||||
{0, DATA3, CMP, "CMP"},
|
||||
{0, DATA3, TEQ, "TEQ"},
|
||||
{0, DATA3, TST, "TST"},
|
||||
|
||||
0, SET, 0x00100000, ".S",
|
||||
{0, SET, 0x00100000, ".S"},
|
||||
|
||||
0, PEE, 0x0010F000, ".P",
|
||||
{0, PEE, 0x0010F000, ".P"},
|
||||
|
||||
0, REG, 0, "R0",
|
||||
0, REG, 1, "R1",
|
||||
0, REG, 2, "R2",
|
||||
0, REG, 3, "R3",
|
||||
0, REG, 4, "R4",
|
||||
0, REG, 5, "R5",
|
||||
0, REG, 6, "R6",
|
||||
0, REG, 7, "R7",
|
||||
0, REG, 8, "R8",
|
||||
0, REG, 9, "R9",
|
||||
0, REG, 10, "R10",
|
||||
0, REG, 11, "R11",
|
||||
0, REG, 12, "R12",
|
||||
0, REG, 13, "R13",
|
||||
0, REG, 14, "R14",
|
||||
0, REG, 15, "R15",
|
||||
0, REG, 15, "PC",
|
||||
{0, REG, 0, "R0"},
|
||||
{0, REG, 1, "R1"},
|
||||
{0, REG, 2, "R2"},
|
||||
{0, REG, 3, "R3"},
|
||||
{0, REG, 4, "R4"},
|
||||
{0, REG, 5, "R5"},
|
||||
{0, REG, 6, "R6"},
|
||||
{0, REG, 7, "R7"},
|
||||
{0, REG, 8, "R8"},
|
||||
{0, REG, 9, "R9"},
|
||||
{0, REG, 10, "R10"},
|
||||
{0, REG, 11, "R11"},
|
||||
{0, REG, 12, "R12"},
|
||||
{0, REG, 13, "R13"},
|
||||
{0, REG, 14, "R14"},
|
||||
{0, REG, 15, "R15"},
|
||||
{0, REG, 15, "PC"},
|
||||
|
||||
0, SHIFT, 0x00000000, "LSL",
|
||||
0, SHIFT, 0x00000000, "ASL",
|
||||
0, SHIFT, 0x00000020, "LSR",
|
||||
0, SHIFT, 0x00000040, "ASR",
|
||||
0, SHIFT, 0x00000060, "ROR",
|
||||
{0, SHIFT, 0x00000000, "LSL"},
|
||||
{0, SHIFT, 0x00000000, "ASL"},
|
||||
{0, SHIFT, 0x00000020, "LSR"},
|
||||
{0, SHIFT, 0x00000040, "ASR"},
|
||||
{0, SHIFT, 0x00000060, "ROR"},
|
||||
|
||||
0, RRX, 0x00000060, "RRX",
|
||||
{0, RRX, 0x00000060, "RRX"},
|
||||
|
||||
0, SDT, 0x04100000, "LDR",
|
||||
0, SDT, 0x04000000, "STR",
|
||||
{0, SDT, 0x04100000, "LDR"},
|
||||
{0, SDT, 0x04000000, "STR"},
|
||||
|
||||
0, BYTE, 0x00400000, ".B",
|
||||
{0, BYTE, 0x00400000, ".B"},
|
||||
|
||||
0, TRANS, 0x00200000, ".T",
|
||||
{0, TRANS, 0x00200000, ".T"},
|
||||
|
||||
0, BDT, 0x09100000, "LDMDB",
|
||||
0, BDT, 0x08100000, "LDMDA",
|
||||
0, BDT, 0x09900000, "LDMIB",
|
||||
0, BDT, 0x08900000, "LDMIA",
|
||||
0, BDT, 0x08900000, "LDMFD",
|
||||
0, BDT, 0x08100000, "LDMFA",
|
||||
0, BDT, 0x09900000, "LDMED",
|
||||
0, BDT, 0x09100000, "LDMEA",
|
||||
0, BDT, 0x09000000, "STMDB",
|
||||
0, BDT, 0x08000000, "STMDA",
|
||||
0, BDT, 0x09800000, "STMIB",
|
||||
0, BDT, 0x08800000, "STMIA",
|
||||
0, BDT, 0x09000000, "STMFD",
|
||||
0, BDT, 0x09800000, "STMFA",
|
||||
0, BDT, 0x08000000, "STMED",
|
||||
0, BDT, 0x08800000, "STMEA",
|
||||
{0, BDT, 0x09100000, "LDMDB"},
|
||||
{0, BDT, 0x08100000, "LDMDA"},
|
||||
{0, BDT, 0x09900000, "LDMIB"},
|
||||
{0, BDT, 0x08900000, "LDMIA"},
|
||||
{0, BDT, 0x08900000, "LDMFD"},
|
||||
{0, BDT, 0x08100000, "LDMFA"},
|
||||
{0, BDT, 0x09900000, "LDMED"},
|
||||
{0, BDT, 0x09100000, "LDMEA"},
|
||||
{0, BDT, 0x09000000, "STMDB"},
|
||||
{0, BDT, 0x08000000, "STMDA"},
|
||||
{0, BDT, 0x09800000, "STMIB"},
|
||||
{0, BDT, 0x08800000, "STMIA"},
|
||||
{0, BDT, 0x09000000, "STMFD"},
|
||||
{0, BDT, 0x09800000, "STMFA"},
|
||||
{0, BDT, 0x08000000, "STMED"},
|
||||
{0, BDT, 0x08800000, "STMEA"},
|
||||
|
||||
0, SWI, 0x0F000000, "SWI",
|
||||
{0, SWI, 0x0F000000, "SWI"},
|
||||
|
||||
0, ADR, 0x00000000, "ADR",
|
||||
{0, ADR, 0x00000000, "ADR"},
|
||||
|
||||
0, MUL, 0x00000090, "MUL",
|
||||
0, MLA, 0x00200090, "MLA",
|
||||
{0, MUL, 0x00000090, "MUL"},
|
||||
{0, MLA, 0x00200090, "MLA"},
|
||||
|
||||
|
||||
|
|
|
@ -1,9 +1,6 @@
|
|||
/* $Id: mach5.c, v3.3 25-Apr-89 AJM */
|
||||
|
||||
branch(brtyp, link, val)
|
||||
word_t brtyp;
|
||||
word_t link;
|
||||
valu_t val;
|
||||
void branch(word_t brtyp, word_t link, valu_t val)
|
||||
{
|
||||
valu_t offset;
|
||||
|
||||
|
@ -16,10 +13,7 @@ valu_t val;
|
|||
return;
|
||||
}
|
||||
|
||||
data(opc, ins, val, typ)
|
||||
long opc, ins;
|
||||
valu_t val;
|
||||
short typ;
|
||||
void data(long opc, long ins, valu_t val, short typ)
|
||||
{
|
||||
valu_t tmpval;
|
||||
int adrflag = 0;
|
||||
|
@ -92,10 +86,7 @@ short typ;
|
|||
12-bit field. Unfortunately this means that some numbers may not fit at
|
||||
all. */
|
||||
|
||||
calcimm(opc,val,typ)
|
||||
word_t *opc;
|
||||
valu_t *val;
|
||||
short typ;
|
||||
int calcimm(word_t *opc, valu_t *val,short typ)
|
||||
{
|
||||
int i = 0;
|
||||
|
||||
|
@ -176,9 +167,7 @@ short typ;
|
|||
|
||||
/* Calculate an offset in an address */
|
||||
|
||||
word_t
|
||||
calcoffset(val)
|
||||
valu_t val;
|
||||
word_t calcoffset(valu_t val)
|
||||
{
|
||||
if((val & 0xFFFFF000) == 0)
|
||||
return(val|0x00800000);
|
||||
|
@ -192,9 +181,7 @@ valu_t val;
|
|||
|
||||
/* This routine deals with STR and LDR instructions */
|
||||
|
||||
strldr(opc, ins, val)
|
||||
long opc, ins;
|
||||
valu_t val;
|
||||
void strldr(long opc, long ins, valu_t val)
|
||||
{
|
||||
|
||||
long reg, reg2; /* The registers we are using */
|
||||
|
@ -310,10 +297,7 @@ valu_t val;
|
|||
optimisation problem with mobile addresses ! */
|
||||
|
||||
|
||||
calcadr(ins, reg, val, typ)
|
||||
word_t ins, reg;
|
||||
valu_t val;
|
||||
short typ;
|
||||
void calcadr(word_t ins, word_t reg, valu_t val, short typ)
|
||||
{
|
||||
valu_t tmpval = val;
|
||||
word_t opc = 0xff; /* Dummy opc used as a flag for data() */
|
||||
|
@ -336,11 +320,7 @@ short typ;
|
|||
}
|
||||
|
||||
|
||||
word_t
|
||||
calcshft(val, typ, styp)
|
||||
valu_t val;
|
||||
short typ;
|
||||
word_t styp;
|
||||
word_t calcshft(valu_t val, short typ, word_t styp)
|
||||
{
|
||||
if (typ == S_UND)
|
||||
return(0);
|
||||
|
@ -354,8 +334,7 @@ word_t styp;
|
|||
return((val & 0x1F)<<7);
|
||||
}
|
||||
|
||||
rotateleft2(x)
|
||||
long *x;
|
||||
void rotateleft2(long *x)
|
||||
{
|
||||
unsigned long bits;
|
||||
|
||||
|
@ -380,9 +359,7 @@ long *x;
|
|||
less instruction, because that will upset other addresses.
|
||||
*/
|
||||
|
||||
putaddr(opc, ins, val, count)
|
||||
long opc, ins, val;
|
||||
int count;
|
||||
void putaddr(long opc, long ins, long val, int count)
|
||||
{
|
||||
long tmpval = val;
|
||||
long reg = ins & 0x0000F000;
|
||||
|
@ -448,9 +425,9 @@ int count;
|
|||
#define PBITTABSZ 128
|
||||
static char *pbittab[PBITTABSZ];
|
||||
|
||||
oursmall(fitsmall, gain)
|
||||
int oursmall(int fitsmall, int gain)
|
||||
{
|
||||
register bit;
|
||||
register int bit;
|
||||
register char *p;
|
||||
|
||||
if (DOTSCT == NULL)
|
||||
|
@ -505,6 +482,9 @@ oursmall(fitsmall, gain)
|
|||
serror("This one is fatal!");
|
||||
}
|
||||
return(*p & bit);
|
||||
default:
|
||||
assert(0);
|
||||
|
||||
}
|
||||
/*NOTREACHED*/
|
||||
}
|
||||
|
|
|
@ -100,3 +100,28 @@ char dr_m[8][8] = {
|
|||
-1, -1, -1, -1, -1, -1, -1, -1
|
||||
};
|
||||
#endif
|
||||
|
||||
/* 80386 specific routines */
|
||||
void ea_1_16(int param);
|
||||
void ea_1(int param);
|
||||
void ea_2(int param);
|
||||
int checkscale(valu_t val);
|
||||
void reverse(void);
|
||||
void badsyntax(void);
|
||||
void regsize(int sz);
|
||||
void indexed(void);
|
||||
void ebranch(register int opc,expr_t exp);
|
||||
void branch(register int opc,expr_t exp);
|
||||
void pushop(register int opc);
|
||||
void opsize_exp(expr_t exp, int nobyte);
|
||||
void adsize_exp(expr_t exp, int relpc);
|
||||
void addop(register int opc);
|
||||
void rolop(register int opc);
|
||||
void incop(register int opc);
|
||||
void callop(register int opc);
|
||||
void xchg(register int opc);
|
||||
void test(register int opc);
|
||||
void mov(register int opc);
|
||||
void extshft(int opc, int reg);
|
||||
void bittestop(int opc);
|
||||
void imul(int reg);
|
||||
|
|
|
@ -10,411 +10,411 @@
|
|||
* No system registers for now ...
|
||||
*/
|
||||
|
||||
0, USE16, 0, ".use16",
|
||||
0, USE32, 0, ".use32",
|
||||
0, R32, 0, "ax",
|
||||
0, R32, 1, "cx",
|
||||
0, R32, 2, "dx",
|
||||
0, R32, 3, "bx",
|
||||
0, R32, 4, "sp",
|
||||
0, R32, 5, "bp",
|
||||
0, R32, 6, "si",
|
||||
0, R32, 7, "di",
|
||||
0, R32, 0, "eax",
|
||||
0, R32, 1, "ecx",
|
||||
0, R32, 2, "edx",
|
||||
0, R32, 3, "ebx",
|
||||
0, R32, 4, "esp",
|
||||
0, R32, 5, "ebp",
|
||||
0, R32, 6, "esi",
|
||||
0, R32, 7, "edi",
|
||||
0, R8, 0, "al",
|
||||
0, R8, 1, "cl",
|
||||
0, R8, 2, "dl",
|
||||
0, R8, 3, "bl",
|
||||
0, R8, 4, "ah",
|
||||
0, R8, 5, "ch",
|
||||
0, R8, 6, "dh",
|
||||
0, R8, 7, "bh",
|
||||
0, RSEG, 0, "es",
|
||||
0, RSEG, 1, "cs",
|
||||
0, RSEG, 2, "ss",
|
||||
0, RSEG, 3, "ds",
|
||||
0, RSEG, 4, "fs",
|
||||
0, RSEG, 5, "gs",
|
||||
0, RSYSCR, 0, "cr0",
|
||||
0, RSYSCR, 2, "cr2",
|
||||
0, RSYSCR, 3, "cr3",
|
||||
0, RSYSDR, 0, "dr0",
|
||||
0, RSYSDR, 1, "dr1",
|
||||
0, RSYSDR, 2, "dr2",
|
||||
0, RSYSDR, 3, "dr3",
|
||||
0, RSYSDR, 6, "dr6",
|
||||
0, RSYSDR, 7, "dr7",
|
||||
0, RSYSTR, 3, "tr3", /* i486 */
|
||||
0, RSYSTR, 4, "tr4", /* i486 */
|
||||
0, RSYSTR, 5, "tr5", /* i486 */
|
||||
0, RSYSTR, 6, "tr6",
|
||||
0, RSYSTR, 7, "tr7",
|
||||
0, ADDOP, 000, "addb",
|
||||
0, ADDOP, 001, "add",
|
||||
0, ADDOP, 010, "orb",
|
||||
0, ADDOP, 011, "or",
|
||||
0, ADDOP, 020, "adcb",
|
||||
0, ADDOP, 021, "adc",
|
||||
0, ADDOP, 030, "sbbb",
|
||||
0, ADDOP, 031, "sbb",
|
||||
0, ADDOP, 040, "andb",
|
||||
0, ADDOP, 041, "and",
|
||||
0, ADDOP, 050, "subb",
|
||||
0, ADDOP, 051, "sub",
|
||||
0, ADDOP, 060, "xorb",
|
||||
0, ADDOP, 061, "xor",
|
||||
0, ADDOP, 070, "cmpb",
|
||||
0, ADDOP, 071, "cmp",
|
||||
0, BITTEST, 04, "bt",
|
||||
0, BITTEST, 05, "bts",
|
||||
0, BITTEST, 06, "btr",
|
||||
0, BITTEST, 07, "btc",
|
||||
0, CALFOP, 030+(0232<<8), "callf",
|
||||
0, CALFOP, 050+(0352<<8), "jmpf",
|
||||
0, CALLOP, 020+(0350<<8), "call",
|
||||
0, CALLOP, 040+(0351<<8), "jmp",
|
||||
0, ENTER, 0310, "enter",
|
||||
0, EXTEND, 0267, "movzx",
|
||||
0, EXTEND, 0266, "movzxb",
|
||||
0, EXTEND, 0277, "movsx",
|
||||
0, EXTEND, 0276, "movsxb",
|
||||
0, EXTOP, 0002, "lar",
|
||||
0, EXTOP, 0003, "lsl",
|
||||
0, EXTOP, 0274, "bsf",
|
||||
0, EXTOP, 0275, "bsr",
|
||||
0, EXTOP1, 0000, "sldt",
|
||||
0, EXTOP1, 0001, "sgdt",
|
||||
0, EXTOP1, 0010, "str",
|
||||
0, EXTOP1, 0011, "sidt",
|
||||
0, EXTOP1, 0020, "lldt",
|
||||
0, EXTOP1, 0021, "lgdt",
|
||||
0, EXTOP1, 0030, "ltr",
|
||||
0, EXTOP1, 0031, "lidt",
|
||||
0, EXTOP1, 0040, "verr",
|
||||
0, EXTOP1, 0041, "smsw",
|
||||
0, EXTOP1, 0050, "verw",
|
||||
0, EXTOP1, 0061, "lmsw",
|
||||
0, IMUL, 00, "imul",
|
||||
0, IMULB, 050, "imulb",
|
||||
0, INCOP, 000, "incb",
|
||||
0, INCOP, 001, "inc",
|
||||
0, INCOP, 010, "decb",
|
||||
0, INCOP, 011, "dec",
|
||||
0, INT, 0, "int",
|
||||
0, IOOP, 0344, "inb",
|
||||
0, IOOP, 0345, "in",
|
||||
0, IOOP, 0346, "outb",
|
||||
0, IOOP, 0347, "out",
|
||||
0, JOP, 0340, "loopne",
|
||||
0, JOP, 0340, "loopnz",
|
||||
0, JOP, 0341, "loope",
|
||||
0, JOP, 0341, "loopz",
|
||||
0, JOP, 0342, "loop",
|
||||
0, JOP, 0343, "jcxz",
|
||||
0, JOP, 0343, "jecxz",
|
||||
0, JOP2, 0000, "jo",
|
||||
0, JOP2, 0001, "jno",
|
||||
0, JOP2, 0002, "jb",
|
||||
0, JOP2, 0002, "jc",
|
||||
0, JOP2, 0002, "jnae",
|
||||
0, JOP2, 0003, "jae",
|
||||
0, JOP2, 0003, "jnb",
|
||||
0, JOP2, 0003, "jnc",
|
||||
0, JOP2, 0004, "je",
|
||||
0, JOP2, 0004, "jz",
|
||||
0, JOP2, 0005, "jne",
|
||||
0, JOP2, 0005, "jnz",
|
||||
0, JOP2, 0006, "jbe",
|
||||
0, JOP2, 0006, "jna",
|
||||
0, JOP2, 0007, "ja",
|
||||
0, JOP2, 0007, "jnbe",
|
||||
0, JOP2, 0010, "js",
|
||||
0, JOP2, 0011, "jns",
|
||||
0, JOP2, 0012, "jp",
|
||||
0, JOP2, 0012, "jpe",
|
||||
0, JOP2, 0013, "jnp",
|
||||
0, JOP2, 0013, "jpo",
|
||||
0, JOP2, 0014, "jl",
|
||||
0, JOP2, 0014, "jnge",
|
||||
0, JOP2, 0015, "jge",
|
||||
0, JOP2, 0015, "jnl",
|
||||
0, JOP2, 0016, "jle",
|
||||
0, JOP2, 0016, "jng",
|
||||
0, JOP2, 0017, "jg",
|
||||
0, JOP2, 0017, "jnle",
|
||||
0, LEAOP, 0142, "bound",
|
||||
0, LEAOP, 0215, "lea",
|
||||
0, LEAOP, 0304, "les",
|
||||
0, LEAOP, 0305, "lds",
|
||||
0, LEAOP2, 0262, "lss",
|
||||
0, LEAOP2, 0264, "lfs",
|
||||
0, LEAOP2, 0265, "lgs",
|
||||
0, LSHFT, 0244, "shld",
|
||||
0, LSHFT, 0254, "shrd",
|
||||
0, MOV, 0, "movb",
|
||||
0, MOV, 1, "mov",
|
||||
0, NOOP_1, 0140, "pusha",
|
||||
0, NOOP_1, 0140, "pushad",
|
||||
0, NOOP_1, 0141, "popa",
|
||||
0, NOOP_1, 0141, "popad",
|
||||
0, NOOP_1, 0156, "outsb",
|
||||
0, NOOP_1, 0157, "outs",
|
||||
0, NOOP_1, 0220, "nop",
|
||||
0, NOOP_1, 0230, "cbw",
|
||||
0, NOOP_1, 0230, "cwde", /* same opcode as cbw! */
|
||||
0, NOOP_1, 0231, "cdq", /* same opcode as cwd! */
|
||||
0, NOOP_1, 0231, "cwd",
|
||||
0, NOOP_1, 0233, "wait",
|
||||
0, NOOP_1, 0234, "pushf",
|
||||
0, NOOP_1, 0235, "popf",
|
||||
0, NOOP_1, 0236, "sahf",
|
||||
0, NOOP_1, 0237, "lahf",
|
||||
0, NOOP_1, 0244, "movsb",
|
||||
0, NOOP_1, 0245, "movs",
|
||||
0, NOOP_1, 0246, "cmpsb",
|
||||
0, NOOP_1, 0154, "insb",
|
||||
0, NOOP_1, 0247, "cmps",
|
||||
0, NOOP_1, 0155, "ins",
|
||||
0, NOOP_1, 0252, "stosb",
|
||||
0, NOOP_1, 0253, "stos",
|
||||
0, NOOP_1, 0254, "lodsb",
|
||||
0, NOOP_1, 0255, "lods",
|
||||
0, NOOP_1, 0256, "scasb",
|
||||
0, NOOP_1, 0257, "scas",
|
||||
0, NOOP_1, 0311, "leave",
|
||||
0, NOOP_1, 0316, "into",
|
||||
0, NOOP_1, 0317, "iret",
|
||||
0, NOOP_1, 0317, "iretd",
|
||||
0, NOOP_1, 0327, "xlat",
|
||||
0, NOOP_1, 0364, "hlt",
|
||||
0, NOOP_1, 0365, "cmc",
|
||||
0, NOOP_1, 0370, "clc",
|
||||
0, NOOP_1, 0371, "stc",
|
||||
0, NOOP_1, 0372, "cli",
|
||||
0, NOOP_1, 0373, "sti",
|
||||
0, NOOP_1, 0374, "cld",
|
||||
0, NOOP_1, 0375, "std",
|
||||
0, NOOP_1, 047, "daa",
|
||||
0, NOOP_1, 057, "das",
|
||||
0, NOOP_1, 067, "aaa",
|
||||
0, NOOP_1, 077, "aas",
|
||||
0, NOOP_2, 017+(06<<8), "clts",
|
||||
0, NOOP_2, 0324+(012<<8), "aam",
|
||||
0, NOOP_2, 0325+(012<<8), "aad",
|
||||
0, NOTOP, 020, "notb",
|
||||
0, NOTOP, 021, "not",
|
||||
0, NOTOP, 030, "negb",
|
||||
0, NOTOP, 031, "neg",
|
||||
0, NOTOP, 040, "mulb",
|
||||
0, NOTOP, 041, "mul",
|
||||
0, NOTOP, 060, "divb",
|
||||
0, NOTOP, 061, "div",
|
||||
0, NOTOP, 070, "idivb",
|
||||
0, NOTOP, 071, "idiv",
|
||||
0, PREFIX, 0144, "fseg",
|
||||
0, PREFIX, 0145, "gseg",
|
||||
0, OTOGGLE, 0146, "o16", /* operand size toggle */
|
||||
0, OTOGGLE, 0346, "o32", /* operand size toggle */
|
||||
0, ATOGGLE, 0147, "a16", /* address size toggle */
|
||||
0, ATOGGLE, 0347, "a32", /* address size toggle */
|
||||
0, PREFIX, 0360, "lock",
|
||||
0, PREFIX, 0362, "repne",
|
||||
0, PREFIX, 0362, "repnz",
|
||||
0, PREFIX, 0363, "rep",
|
||||
0, PREFIX, 0363, "repe",
|
||||
0, PREFIX, 0363, "repz",
|
||||
0, PREFIX, 046, "eseg",
|
||||
0, PREFIX, 056, "cseg",
|
||||
0, PREFIX, 066, "sseg",
|
||||
0, PREFIX, 076, "dseg",
|
||||
0, PUSHOP, 0, "push",
|
||||
0, PUSHOP, 1, "pop",
|
||||
0, RET, 0303, "ret",
|
||||
0, RET, 0313, "retf",
|
||||
0, ROLOP, 000, "rolb",
|
||||
0, ROLOP, 001, "rol",
|
||||
0, ROLOP, 010, "rorb",
|
||||
0, ROLOP, 011, "ror",
|
||||
0, ROLOP, 020, "rclb",
|
||||
0, ROLOP, 021, "rcl",
|
||||
0, ROLOP, 030, "rcrb",
|
||||
0, ROLOP, 031, "rcr",
|
||||
0, ROLOP, 040, "salb",
|
||||
0, ROLOP, 040, "shlb",
|
||||
0, ROLOP, 041, "sal",
|
||||
0, ROLOP, 041, "shl",
|
||||
0, ROLOP, 050, "shrb",
|
||||
0, ROLOP, 051, "shr",
|
||||
0, ROLOP, 070, "sarb",
|
||||
0, ROLOP, 071, "sar",
|
||||
0, SETCC, 0000, "seto",
|
||||
0, SETCC, 0001, "setno",
|
||||
0, SETCC, 0002, "setb",
|
||||
0, SETCC, 0002, "setnae",
|
||||
0, SETCC, 0003, "setae",
|
||||
0, SETCC, 0003, "setnb",
|
||||
0, SETCC, 0004, "sete",
|
||||
0, SETCC, 0004, "setz",
|
||||
0, SETCC, 0005, "setne",
|
||||
0, SETCC, 0005, "setnz",
|
||||
0, SETCC, 0006, "setbe",
|
||||
0, SETCC, 0006, "setna",
|
||||
0, SETCC, 0007, "seta",
|
||||
0, SETCC, 0007, "setnbe",
|
||||
0, SETCC, 0010, "sets",
|
||||
0, SETCC, 0011, "setns",
|
||||
0, SETCC, 0012, "setp",
|
||||
0, SETCC, 0012, "setpe",
|
||||
0, SETCC, 0013, "setnp",
|
||||
0, SETCC, 0013, "setpo",
|
||||
0, SETCC, 0014, "setl",
|
||||
0, SETCC, 0014, "setnge",
|
||||
0, SETCC, 0015, "setge",
|
||||
0, SETCC, 0015, "setnl",
|
||||
0, SETCC, 0016, "setle",
|
||||
0, SETCC, 0016, "setng",
|
||||
0, SETCC, 0017, "setg",
|
||||
0, SETCC, 0017, "setnle",
|
||||
0, TEST, 0, "testb",
|
||||
0, TEST, 1, "test",
|
||||
0, XCHG, 0, "xchgb",
|
||||
0, XCHG, 1, "xchg",
|
||||
0, ARPLOP, 0143, "arpl",
|
||||
{0, USE16, 0, ".use16"},
|
||||
{0, USE32, 0, ".use32"},
|
||||
{0, R32, 0, "ax"},
|
||||
{0, R32, 1, "cx"},
|
||||
{0, R32, 2, "dx"},
|
||||
{0, R32, 3, "bx"},
|
||||
{0, R32, 4, "sp"},
|
||||
{0, R32, 5, "bp"},
|
||||
{0, R32, 6, "si"},
|
||||
{0, R32, 7, "di"},
|
||||
{0, R32, 0, "eax"},
|
||||
{0, R32, 1, "ecx"},
|
||||
{0, R32, 2, "edx"},
|
||||
{0, R32, 3, "ebx"},
|
||||
{0, R32, 4, "esp"},
|
||||
{0, R32, 5, "ebp"},
|
||||
{0, R32, 6, "esi"},
|
||||
{0, R32, 7, "edi"},
|
||||
{0, R8, 0, "al"},
|
||||
{0, R8, 1, "cl"},
|
||||
{0, R8, 2, "dl"},
|
||||
{0, R8, 3, "bl"},
|
||||
{0, R8, 4, "ah"},
|
||||
{0, R8, 5, "ch"},
|
||||
{0, R8, 6, "dh"},
|
||||
{0, R8, 7, "bh"},
|
||||
{0, RSEG, 0, "es"},
|
||||
{0, RSEG, 1, "cs"},
|
||||
{0, RSEG, 2, "ss"},
|
||||
{0, RSEG, 3, "ds"},
|
||||
{0, RSEG, 4, "fs"},
|
||||
{0, RSEG, 5, "gs"},
|
||||
{0, RSYSCR, 0, "cr0"},
|
||||
{0, RSYSCR, 2, "cr2"},
|
||||
{0, RSYSCR, 3, "cr3"},
|
||||
{0, RSYSDR, 0, "dr0"},
|
||||
{0, RSYSDR, 1, "dr1"},
|
||||
{0, RSYSDR, 2, "dr2"},
|
||||
{0, RSYSDR, 3, "dr3"},
|
||||
{0, RSYSDR, 6, "dr6"},
|
||||
{0, RSYSDR, 7, "dr7"},
|
||||
{0, RSYSTR, 3, "tr3"}, /* i486 */
|
||||
{0, RSYSTR, 4, "tr4"}, /* i486 */
|
||||
{0, RSYSTR, 5, "tr5"}, /* i486 */
|
||||
{0, RSYSTR, 6, "tr6"},
|
||||
{0, RSYSTR, 7, "tr7"},
|
||||
{0, ADDOP, 000, "addb"},
|
||||
{0, ADDOP, 001, "add"},
|
||||
{0, ADDOP, 010, "orb"},
|
||||
{0, ADDOP, 011, "or"},
|
||||
{0, ADDOP, 020, "adcb"},
|
||||
{0, ADDOP, 021, "adc"},
|
||||
{0, ADDOP, 030, "sbbb"},
|
||||
{0, ADDOP, 031, "sbb"},
|
||||
{0, ADDOP, 040, "andb"},
|
||||
{0, ADDOP, 041, "and"},
|
||||
{0, ADDOP, 050, "subb"},
|
||||
{0, ADDOP, 051, "sub"},
|
||||
{0, ADDOP, 060, "xorb"},
|
||||
{0, ADDOP, 061, "xor"},
|
||||
{0, ADDOP, 070, "cmpb"},
|
||||
{0, ADDOP, 071, "cmp"},
|
||||
{0, BITTEST, 04, "bt"},
|
||||
{0, BITTEST, 05, "bts"},
|
||||
{0, BITTEST, 06, "btr"},
|
||||
{0, BITTEST, 07, "btc"},
|
||||
{0, CALFOP, 030+(0232<<8), "callf"},
|
||||
{0, CALFOP, 050+(0352<<8), "jmpf"},
|
||||
{0, CALLOP, 020+(0350<<8), "call"},
|
||||
{0, CALLOP, 040+(0351<<8), "jmp"},
|
||||
{0, ENTER, 0310, "enter"},
|
||||
{0, EXTEND, 0267, "movzx"},
|
||||
{0, EXTEND, 0266, "movzxb"},
|
||||
{0, EXTEND, 0277, "movsx"},
|
||||
{0, EXTEND, 0276, "movsxb"},
|
||||
{0, EXTOP, 0002, "lar"},
|
||||
{0, EXTOP, 0003, "lsl"},
|
||||
{0, EXTOP, 0274, "bsf"},
|
||||
{0, EXTOP, 0275, "bsr"},
|
||||
{0, EXTOP1, 0000, "sldt"},
|
||||
{0, EXTOP1, 0001, "sgdt"},
|
||||
{0, EXTOP1, 0010, "str"},
|
||||
{0, EXTOP1, 0011, "sidt"},
|
||||
{0, EXTOP1, 0020, "lldt"},
|
||||
{0, EXTOP1, 0021, "lgdt"},
|
||||
{0, EXTOP1, 0030, "ltr"},
|
||||
{0, EXTOP1, 0031, "lidt"},
|
||||
{0, EXTOP1, 0040, "verr"},
|
||||
{0, EXTOP1, 0041, "smsw"},
|
||||
{0, EXTOP1, 0050, "verw"},
|
||||
{0, EXTOP1, 0061, "lmsw"},
|
||||
{0, IMUL, 00, "imul"},
|
||||
{0, IMULB, 050, "imulb"},
|
||||
{0, INCOP, 000, "incb"},
|
||||
{0, INCOP, 001, "inc"},
|
||||
{0, INCOP, 010, "decb"},
|
||||
{0, INCOP, 011, "dec"},
|
||||
{0, INT, 0, "int"},
|
||||
{0, IOOP, 0344, "inb"},
|
||||
{0, IOOP, 0345, "in"},
|
||||
{0, IOOP, 0346, "outb"},
|
||||
{0, IOOP, 0347, "out"},
|
||||
{0, JOP, 0340, "loopne"},
|
||||
{0, JOP, 0340, "loopnz"},
|
||||
{0, JOP, 0341, "loope"},
|
||||
{0, JOP, 0341, "loopz"},
|
||||
{0, JOP, 0342, "loop"},
|
||||
{0, JOP, 0343, "jcxz"},
|
||||
{0, JOP, 0343, "jecxz"},
|
||||
{0, JOP2, 0000, "jo"},
|
||||
{0, JOP2, 0001, "jno"},
|
||||
{0, JOP2, 0002, "jb"},
|
||||
{0, JOP2, 0002, "jc"},
|
||||
{0, JOP2, 0002, "jnae"},
|
||||
{0, JOP2, 0003, "jae"},
|
||||
{0, JOP2, 0003, "jnb"},
|
||||
{0, JOP2, 0003, "jnc"},
|
||||
{0, JOP2, 0004, "je"},
|
||||
{0, JOP2, 0004, "jz"},
|
||||
{0, JOP2, 0005, "jne"},
|
||||
{0, JOP2, 0005, "jnz"},
|
||||
{0, JOP2, 0006, "jbe"},
|
||||
{0, JOP2, 0006, "jna"},
|
||||
{0, JOP2, 0007, "ja"},
|
||||
{0, JOP2, 0007, "jnbe"},
|
||||
{0, JOP2, 0010, "js"},
|
||||
{0, JOP2, 0011, "jns"},
|
||||
{0, JOP2, 0012, "jp"},
|
||||
{0, JOP2, 0012, "jpe"},
|
||||
{0, JOP2, 0013, "jnp"},
|
||||
{0, JOP2, 0013, "jpo"},
|
||||
{0, JOP2, 0014, "jl"},
|
||||
{0, JOP2, 0014, "jnge"},
|
||||
{0, JOP2, 0015, "jge"},
|
||||
{0, JOP2, 0015, "jnl"},
|
||||
{0, JOP2, 0016, "jle"},
|
||||
{0, JOP2, 0016, "jng"},
|
||||
{0, JOP2, 0017, "jg"},
|
||||
{0, JOP2, 0017, "jnle"},
|
||||
{0, LEAOP, 0142, "bound"},
|
||||
{0, LEAOP, 0215, "lea"},
|
||||
{0, LEAOP, 0304, "les"},
|
||||
{0, LEAOP, 0305, "lds"},
|
||||
{0, LEAOP2, 0262, "lss"},
|
||||
{0, LEAOP2, 0264, "lfs"},
|
||||
{0, LEAOP2, 0265, "lgs"},
|
||||
{0, LSHFT, 0244, "shld"},
|
||||
{0, LSHFT, 0254, "shrd"},
|
||||
{0, MOV, 0, "movb"},
|
||||
{0, MOV, 1, "mov"},
|
||||
{0, NOOP_1, 0140, "pusha"},
|
||||
{0, NOOP_1, 0140, "pushad"},
|
||||
{0, NOOP_1, 0141, "popa"},
|
||||
{0, NOOP_1, 0141, "popad"},
|
||||
{0, NOOP_1, 0156, "outsb"},
|
||||
{0, NOOP_1, 0157, "outs"},
|
||||
{0, NOOP_1, 0220, "nop"},
|
||||
{0, NOOP_1, 0230, "cbw"},
|
||||
{0, NOOP_1, 0230, "cwde"}, /* same opcode as cbw! */
|
||||
{0, NOOP_1, 0231, "cdq"}, /* same opcode as cwd! */
|
||||
{0, NOOP_1, 0231, "cwd"},
|
||||
{0, NOOP_1, 0233, "wait"},
|
||||
{0, NOOP_1, 0234, "pushf"},
|
||||
{0, NOOP_1, 0235, "popf"},
|
||||
{0, NOOP_1, 0236, "sahf"},
|
||||
{0, NOOP_1, 0237, "lahf"},
|
||||
{0, NOOP_1, 0244, "movsb"},
|
||||
{0, NOOP_1, 0245, "movs"},
|
||||
{0, NOOP_1, 0246, "cmpsb"},
|
||||
{0, NOOP_1, 0154, "insb"},
|
||||
{0, NOOP_1, 0247, "cmps"},
|
||||
{0, NOOP_1, 0155, "ins"},
|
||||
{0, NOOP_1, 0252, "stosb"},
|
||||
{0, NOOP_1, 0253, "stos"},
|
||||
{0, NOOP_1, 0254, "lodsb"},
|
||||
{0, NOOP_1, 0255, "lods"},
|
||||
{0, NOOP_1, 0256, "scasb"},
|
||||
{0, NOOP_1, 0257, "scas"},
|
||||
{0, NOOP_1, 0311, "leave"},
|
||||
{0, NOOP_1, 0316, "into"},
|
||||
{0, NOOP_1, 0317, "iret"},
|
||||
{0, NOOP_1, 0317, "iretd"},
|
||||
{0, NOOP_1, 0327, "xlat"},
|
||||
{0, NOOP_1, 0364, "hlt"},
|
||||
{0, NOOP_1, 0365, "cmc"},
|
||||
{0, NOOP_1, 0370, "clc"},
|
||||
{0, NOOP_1, 0371, "stc"},
|
||||
{0, NOOP_1, 0372, "cli"},
|
||||
{0, NOOP_1, 0373, "sti"},
|
||||
{0, NOOP_1, 0374, "cld"},
|
||||
{0, NOOP_1, 0375, "std"},
|
||||
{0, NOOP_1, 047, "daa"},
|
||||
{0, NOOP_1, 057, "das"},
|
||||
{0, NOOP_1, 067, "aaa"},
|
||||
{0, NOOP_1, 077, "aas"},
|
||||
{0, NOOP_2, 017+(06<<8), "clts"},
|
||||
{0, NOOP_2, 0324+(012<<8), "aam"},
|
||||
{0, NOOP_2, 0325+(012<<8), "aad"},
|
||||
{0, NOTOP, 020, "notb"},
|
||||
{0, NOTOP, 021, "not"},
|
||||
{0, NOTOP, 030, "negb"},
|
||||
{0, NOTOP, 031, "neg"},
|
||||
{0, NOTOP, 040, "mulb"},
|
||||
{0, NOTOP, 041, "mul"},
|
||||
{0, NOTOP, 060, "divb"},
|
||||
{0, NOTOP, 061, "div"},
|
||||
{0, NOTOP, 070, "idivb"},
|
||||
{0, NOTOP, 071, "idiv"},
|
||||
{0, PREFIX, 0144, "fseg"},
|
||||
{0, PREFIX, 0145, "gseg"},
|
||||
{0, OTOGGLE, 0146, "o16"}, /* operand size toggle */
|
||||
{0, OTOGGLE, 0346, "o32"}, /* operand size toggle */
|
||||
{0, ATOGGLE, 0147, "a16"}, /* address size toggle */
|
||||
{0, ATOGGLE, 0347, "a32"}, /* address size toggle */
|
||||
{0, PREFIX, 0360, "lock"},
|
||||
{0, PREFIX, 0362, "repne"},
|
||||
{0, PREFIX, 0362, "repnz"},
|
||||
{0, PREFIX, 0363, "rep"},
|
||||
{0, PREFIX, 0363, "repe"},
|
||||
{0, PREFIX, 0363, "repz"},
|
||||
{0, PREFIX, 046, "eseg"},
|
||||
{0, PREFIX, 056, "cseg"},
|
||||
{0, PREFIX, 066, "sseg"},
|
||||
{0, PREFIX, 076, "dseg"},
|
||||
{0, PUSHOP, 0, "push"},
|
||||
{0, PUSHOP, 1, "pop"},
|
||||
{0, RET, 0303, "ret"},
|
||||
{0, RET, 0313, "retf"},
|
||||
{0, ROLOP, 000, "rolb"},
|
||||
{0, ROLOP, 001, "rol"},
|
||||
{0, ROLOP, 010, "rorb"},
|
||||
{0, ROLOP, 011, "ror"},
|
||||
{0, ROLOP, 020, "rclb"},
|
||||
{0, ROLOP, 021, "rcl"},
|
||||
{0, ROLOP, 030, "rcrb"},
|
||||
{0, ROLOP, 031, "rcr"},
|
||||
{0, ROLOP, 040, "salb"},
|
||||
{0, ROLOP, 040, "shlb"},
|
||||
{0, ROLOP, 041, "sal"},
|
||||
{0, ROLOP, 041, "shl"},
|
||||
{0, ROLOP, 050, "shrb"},
|
||||
{0, ROLOP, 051, "shr"},
|
||||
{0, ROLOP, 070, "sarb"},
|
||||
{0, ROLOP, 071, "sar"},
|
||||
{0, SETCC, 0000, "seto"},
|
||||
{0, SETCC, 0001, "setno"},
|
||||
{0, SETCC, 0002, "setb"},
|
||||
{0, SETCC, 0002, "setnae"},
|
||||
{0, SETCC, 0003, "setae"},
|
||||
{0, SETCC, 0003, "setnb"},
|
||||
{0, SETCC, 0004, "sete"},
|
||||
{0, SETCC, 0004, "setz"},
|
||||
{0, SETCC, 0005, "setne"},
|
||||
{0, SETCC, 0005, "setnz"},
|
||||
{0, SETCC, 0006, "setbe"},
|
||||
{0, SETCC, 0006, "setna"},
|
||||
{0, SETCC, 0007, "seta"},
|
||||
{0, SETCC, 0007, "setnbe"},
|
||||
{0, SETCC, 0010, "sets"},
|
||||
{0, SETCC, 0011, "setns"},
|
||||
{0, SETCC, 0012, "setp"},
|
||||
{0, SETCC, 0012, "setpe"},
|
||||
{0, SETCC, 0013, "setnp"},
|
||||
{0, SETCC, 0013, "setpo"},
|
||||
{0, SETCC, 0014, "setl"},
|
||||
{0, SETCC, 0014, "setnge"},
|
||||
{0, SETCC, 0015, "setge"},
|
||||
{0, SETCC, 0015, "setnl"},
|
||||
{0, SETCC, 0016, "setle"},
|
||||
{0, SETCC, 0016, "setng"},
|
||||
{0, SETCC, 0017, "setg"},
|
||||
{0, SETCC, 0017, "setnle"},
|
||||
{0, TEST, 0, "testb"},
|
||||
{0, TEST, 1, "test"},
|
||||
{0, XCHG, 0, "xchgb"},
|
||||
{0, XCHG, 1, "xchg"},
|
||||
{0, ARPLOP, 0143, "arpl"},
|
||||
|
||||
/* Intel 80[23]87 coprocessor keywords */
|
||||
|
||||
0, ST, 0, "st",
|
||||
{0, ST, 0, "st"},
|
||||
|
||||
0, FNOOP, FESC+1+(0xF0<<8), "f2xm1",
|
||||
0, FNOOP, FESC+1+(0xE1<<8), "fabs",
|
||||
0, FNOOP, FESC+1+(0xE0<<8), "fchs",
|
||||
0, FNOOP, FESC+3+(0xE2<<8), "fclex",
|
||||
0, FNOOP, FESC+6+(0xD9<<8), "fcompp",
|
||||
0, FNOOP, FESC+2+(0xE9<<8), "fucompp",
|
||||
0, FNOOP, FESC+1+(0xF6<<8), "fdecstp",
|
||||
0, FNOOP, FESC+3+(0xE1<<8), "fdisi",
|
||||
0, FNOOP, FESC+3+(0xE0<<8), "feni",
|
||||
0, FNOOP, FESC+1+(0xF7<<8), "fincstp",
|
||||
0, FNOOP, FESC+3+(0xE3<<8), "finit",
|
||||
0, FNOOP, FESC+1+(0xE8<<8), "fld1",
|
||||
0, FNOOP, FESC+1+(0xEA<<8), "fldl2e",
|
||||
0, FNOOP, FESC+1+(0xE9<<8), "fldl2t",
|
||||
0, FNOOP, FESC+1+(0xEC<<8), "fldlg2",
|
||||
0, FNOOP, FESC+1+(0xED<<8), "fldln2",
|
||||
0, FNOOP, FESC+1+(0xEB<<8), "fldpi",
|
||||
0, FNOOP, FESC+1+(0xEE<<8), "fldz",
|
||||
0, FNOOP, FESC+1+(0xD0<<8), "fnop",
|
||||
0, FNOOP, FESC+1+(0xF3<<8), "fpatan",
|
||||
0, FNOOP, FESC+1+(0xFF<<8), "fcos",
|
||||
0, FNOOP, FESC+1+(0xFE<<8), "fsin",
|
||||
0, FNOOP, FESC+1+(0xFB<<8), "fsincos",
|
||||
0, FNOOP, FESC+1+(0xF8<<8), "fprem",
|
||||
0, FNOOP, FESC+1+(0xF5<<8), "fprem1",
|
||||
0, FNOOP, FESC+1+(0xF2<<8), "fptan",
|
||||
0, FNOOP, FESC+1+(0xFC<<8), "frndint",
|
||||
0, FNOOP, FESC+1+(0xFD<<8), "fscale",
|
||||
0, FNOOP, FESC+1+(0xFA<<8), "fsqrt",
|
||||
0, FNOOP, FESC+1+(0xE4<<8), "ftst",
|
||||
0, FNOOP, FESC+1+(0xE5<<8), "fxam",
|
||||
0, FNOOP, FESC+1+(0xF4<<8), "fxtract",
|
||||
0, FNOOP, FESC+1+(0xF1<<8), "fyl2x",
|
||||
0, FNOOP, FESC+1+(0xF9<<8), "fyl2xp1",
|
||||
{0, FNOOP, FESC+1+(0xF0<<8), "f2xm1"},
|
||||
{0, FNOOP, FESC+1+(0xE1<<8), "fabs"},
|
||||
{0, FNOOP, FESC+1+(0xE0<<8), "fchs"},
|
||||
{0, FNOOP, FESC+3+(0xE2<<8), "fclex"},
|
||||
{0, FNOOP, FESC+6+(0xD9<<8), "fcompp"},
|
||||
{0, FNOOP, FESC+2+(0xE9<<8), "fucompp"},
|
||||
{0, FNOOP, FESC+1+(0xF6<<8), "fdecstp"},
|
||||
{0, FNOOP, FESC+3+(0xE1<<8), "fdisi"},
|
||||
{0, FNOOP, FESC+3+(0xE0<<8), "feni"},
|
||||
{0, FNOOP, FESC+1+(0xF7<<8), "fincstp"},
|
||||
{0, FNOOP, FESC+3+(0xE3<<8), "finit"},
|
||||
{0, FNOOP, FESC+1+(0xE8<<8), "fld1"},
|
||||
{0, FNOOP, FESC+1+(0xEA<<8), "fldl2e"},
|
||||
{0, FNOOP, FESC+1+(0xE9<<8), "fldl2t"},
|
||||
{0, FNOOP, FESC+1+(0xEC<<8), "fldlg2"},
|
||||
{0, FNOOP, FESC+1+(0xED<<8), "fldln2"},
|
||||
{0, FNOOP, FESC+1+(0xEB<<8), "fldpi"},
|
||||
{0, FNOOP, FESC+1+(0xEE<<8), "fldz"},
|
||||
{0, FNOOP, FESC+1+(0xD0<<8), "fnop"},
|
||||
{0, FNOOP, FESC+1+(0xF3<<8), "fpatan"},
|
||||
{0, FNOOP, FESC+1+(0xFF<<8), "fcos"},
|
||||
{0, FNOOP, FESC+1+(0xFE<<8), "fsin"},
|
||||
{0, FNOOP, FESC+1+(0xFB<<8), "fsincos"},
|
||||
{0, FNOOP, FESC+1+(0xF8<<8), "fprem"},
|
||||
{0, FNOOP, FESC+1+(0xF5<<8), "fprem1"},
|
||||
{0, FNOOP, FESC+1+(0xF2<<8), "fptan"},
|
||||
{0, FNOOP, FESC+1+(0xFC<<8), "frndint"},
|
||||
{0, FNOOP, FESC+1+(0xFD<<8), "fscale"},
|
||||
{0, FNOOP, FESC+1+(0xFA<<8), "fsqrt"},
|
||||
{0, FNOOP, FESC+1+(0xE4<<8), "ftst"},
|
||||
{0, FNOOP, FESC+1+(0xE5<<8), "fxam"},
|
||||
{0, FNOOP, FESC+1+(0xF4<<8), "fxtract"},
|
||||
{0, FNOOP, FESC+1+(0xF1<<8), "fyl2x"},
|
||||
{0, FNOOP, FESC+1+(0xF9<<8), "fyl2xp1"},
|
||||
|
||||
0, FMEM, FESC+6+(0<<11), "fiadds",
|
||||
0, FMEM, FESC+2+(0<<11), "fiaddl",
|
||||
0, FMEM, FESC+0+(0<<11), "fadds",
|
||||
0, FMEM, FESC+4+(0<<11), "faddd",
|
||||
0, FMEM, FESC+7+(4<<11), "fbld",
|
||||
0, FMEM, FESC+7+(6<<11), "fbstp",
|
||||
0, FMEM, FESC+6+(2<<11), "ficoms",
|
||||
0, FMEM, FESC+2+(2<<11), "ficoml",
|
||||
0, FMEM, FESC+0+(2<<11), "fcoms",
|
||||
0, FMEM, FESC+4+(2<<11), "fcomd",
|
||||
0, FMEM, FESC+6+(3<<11), "ficomps",
|
||||
0, FMEM, FESC+2+(3<<11), "ficompl",
|
||||
0, FMEM, FESC+0+(3<<11), "fcomps",
|
||||
0, FMEM, FESC+4+(3<<11), "fcompd",
|
||||
0, FMEM, FESC+6+(6<<11), "fidivs",
|
||||
0, FMEM, FESC+2+(6<<11), "fidivl",
|
||||
0, FMEM, FESC+0+(6<<11), "fdivs",
|
||||
0, FMEM, FESC+4+(6<<11), "fdivd",
|
||||
0, FMEM, FESC+6+(7<<11), "fidivrs",
|
||||
0, FMEM, FESC+2+(7<<11), "fidivrl",
|
||||
0, FMEM, FESC+0+(7<<11), "fdivrs",
|
||||
0, FMEM, FESC+4+(7<<11), "fdivrd",
|
||||
0, FMEM, FESC+7+(5<<11), "fildq",
|
||||
0, FMEM, FESC+7+(0<<11), "filds",
|
||||
0, FMEM, FESC+3+(0<<11), "fildl",
|
||||
0, FMEM, FESC+1+(0<<11), "flds",
|
||||
0, FMEM, FESC+5+(0<<11), "fldd",
|
||||
0, FMEM, FESC+3+(5<<11), "fldx",
|
||||
0, FMEM, FESC+1+(5<<11), "fldcw",
|
||||
0, FMEM, FESC+1+(4<<11), "fldenv",
|
||||
0, FMEM, FESC+6+(1<<11), "fimuls",
|
||||
0, FMEM, FESC+2+(1<<11), "fimull",
|
||||
0, FMEM, FESC+0+(1<<11), "fmuls",
|
||||
0, FMEM, FESC+4+(1<<11), "fmuld",
|
||||
0, FMEM, FESC+5+(4<<11), "frstor",
|
||||
0, FMEM, FESC+5+(6<<11), "fsave",
|
||||
0, FMEM, FESC+7+(2<<11), "fists",
|
||||
0, FMEM, FESC+3+(2<<11), "fistl",
|
||||
0, FMEM, FESC+1+(2<<11), "fsts",
|
||||
0, FMEM, FESC+5+(2<<11), "fstd",
|
||||
0, FMEM, FESC+7+(7<<11), "fistpq",
|
||||
0, FMEM, FESC+7+(3<<11), "fistps",
|
||||
0, FMEM, FESC+3+(3<<11), "fistpl",
|
||||
0, FMEM, FESC+1+(3<<11), "fstps",
|
||||
0, FMEM, FESC+5+(3<<11), "fstpd",
|
||||
0, FMEM, FESC+3+(7<<11), "fstpx",
|
||||
0, FMEM, FESC+1+(7<<11), "fstcw",
|
||||
0, FMEM, FESC+1+(6<<11), "fstenv",
|
||||
0, FMEM_AX, FESC+5+(7<<11), "fstsw",
|
||||
0, FMEM, FESC+6+(4<<11), "fisubs",
|
||||
0, FMEM, FESC+2+(4<<11), "fisubl",
|
||||
0, FMEM, FESC+0+(4<<11), "fsubs",
|
||||
0, FMEM, FESC+4+(4<<11), "fsubd",
|
||||
0, FMEM, FESC+6+(5<<11), "fisubrs",
|
||||
0, FMEM, FESC+2+(5<<11), "fisubrl",
|
||||
0, FMEM, FESC+0+(5<<11), "fsubrs",
|
||||
0, FMEM, FESC+4+(5<<11), "fsubrd",
|
||||
{0, FMEM, FESC+6+(0<<11), "fiadds"},
|
||||
{0, FMEM, FESC+2+(0<<11), "fiaddl"},
|
||||
{0, FMEM, FESC+0+(0<<11), "fadds"},
|
||||
{0, FMEM, FESC+4+(0<<11), "faddd"},
|
||||
{0, FMEM, FESC+7+(4<<11), "fbld"},
|
||||
{0, FMEM, FESC+7+(6<<11), "fbstp"},
|
||||
{0, FMEM, FESC+6+(2<<11), "ficoms"},
|
||||
{0, FMEM, FESC+2+(2<<11), "ficoml"},
|
||||
{0, FMEM, FESC+0+(2<<11), "fcoms"},
|
||||
{0, FMEM, FESC+4+(2<<11), "fcomd"},
|
||||
{0, FMEM, FESC+6+(3<<11), "ficomps"},
|
||||
{0, FMEM, FESC+2+(3<<11), "ficompl"},
|
||||
{0, FMEM, FESC+0+(3<<11), "fcomps"},
|
||||
{0, FMEM, FESC+4+(3<<11), "fcompd"},
|
||||
{0, FMEM, FESC+6+(6<<11), "fidivs"},
|
||||
{0, FMEM, FESC+2+(6<<11), "fidivl"},
|
||||
{0, FMEM, FESC+0+(6<<11), "fdivs"},
|
||||
{0, FMEM, FESC+4+(6<<11), "fdivd"},
|
||||
{0, FMEM, FESC+6+(7<<11), "fidivrs"},
|
||||
{0, FMEM, FESC+2+(7<<11), "fidivrl"},
|
||||
{0, FMEM, FESC+0+(7<<11), "fdivrs"},
|
||||
{0, FMEM, FESC+4+(7<<11), "fdivrd"},
|
||||
{0, FMEM, FESC+7+(5<<11), "fildq"},
|
||||
{0, FMEM, FESC+7+(0<<11), "filds"},
|
||||
{0, FMEM, FESC+3+(0<<11), "fildl"},
|
||||
{0, FMEM, FESC+1+(0<<11), "flds"},
|
||||
{0, FMEM, FESC+5+(0<<11), "fldd"},
|
||||
{0, FMEM, FESC+3+(5<<11), "fldx"},
|
||||
{0, FMEM, FESC+1+(5<<11), "fldcw"},
|
||||
{0, FMEM, FESC+1+(4<<11), "fldenv"},
|
||||
{0, FMEM, FESC+6+(1<<11), "fimuls"},
|
||||
{0, FMEM, FESC+2+(1<<11), "fimull"},
|
||||
{0, FMEM, FESC+0+(1<<11), "fmuls"},
|
||||
{0, FMEM, FESC+4+(1<<11), "fmuld"},
|
||||
{0, FMEM, FESC+5+(4<<11), "frstor"},
|
||||
{0, FMEM, FESC+5+(6<<11), "fsave"},
|
||||
{0, FMEM, FESC+7+(2<<11), "fists"},
|
||||
{0, FMEM, FESC+3+(2<<11), "fistl"},
|
||||
{0, FMEM, FESC+1+(2<<11), "fsts"},
|
||||
{0, FMEM, FESC+5+(2<<11), "fstd"},
|
||||
{0, FMEM, FESC+7+(7<<11), "fistpq"},
|
||||
{0, FMEM, FESC+7+(3<<11), "fistps"},
|
||||
{0, FMEM, FESC+3+(3<<11), "fistpl"},
|
||||
{0, FMEM, FESC+1+(3<<11), "fstps"},
|
||||
{0, FMEM, FESC+5+(3<<11), "fstpd"},
|
||||
{0, FMEM, FESC+3+(7<<11), "fstpx"},
|
||||
{0, FMEM, FESC+1+(7<<11), "fstcw"},
|
||||
{0, FMEM, FESC+1+(6<<11), "fstenv"},
|
||||
{0, FMEM_AX, FESC+5+(7<<11), "fstsw"},
|
||||
{0, FMEM, FESC+6+(4<<11), "fisubs"},
|
||||
{0, FMEM, FESC+2+(4<<11), "fisubl"},
|
||||
{0, FMEM, FESC+0+(4<<11), "fsubs"},
|
||||
{0, FMEM, FESC+4+(4<<11), "fsubd"},
|
||||
{0, FMEM, FESC+6+(5<<11), "fisubrs"},
|
||||
{0, FMEM, FESC+2+(5<<11), "fisubrl"},
|
||||
{0, FMEM, FESC+0+(5<<11), "fsubrs"},
|
||||
{0, FMEM, FESC+4+(5<<11), "fsubrd"},
|
||||
|
||||
0, FST_I, FESC+1+(0xC0<<8), "fld",
|
||||
0, FST_I, FESC+5+(0xD0<<8), "fst",
|
||||
0, FST_I, FESC+5+(0xD8<<8), "fstp",
|
||||
0, FST_I, FESC+1+(0xC8<<8), "fxch",
|
||||
0, FST_I, FESC+0+(0xD0<<8), "fcom",
|
||||
0, FST_I, FESC+5+(0xE0<<8), "fucom",
|
||||
0, FST_I, FESC+0+(0xD8<<8), "fcomp",
|
||||
0, FST_I, FESC+5+(0xE8<<8), "fucomp",
|
||||
0, FST_I, FESC+5+(0xC0<<8), "ffree",
|
||||
{0, FST_I, FESC+1+(0xC0<<8), "fld"},
|
||||
{0, FST_I, FESC+5+(0xD0<<8), "fst"},
|
||||
{0, FST_I, FESC+5+(0xD8<<8), "fstp"},
|
||||
{0, FST_I, FESC+1+(0xC8<<8), "fxch"},
|
||||
{0, FST_I, FESC+0+(0xD0<<8), "fcom"},
|
||||
{0, FST_I, FESC+5+(0xE0<<8), "fucom"},
|
||||
{0, FST_I, FESC+0+(0xD8<<8), "fcomp"},
|
||||
{0, FST_I, FESC+5+(0xE8<<8), "fucomp"},
|
||||
{0, FST_I, FESC+5+(0xC0<<8), "ffree"},
|
||||
|
||||
0, FST_ST, FESC+0+(0xC0<<8), "fadd",
|
||||
0, FST_ST, FESC+2+(0xC0<<8), "faddp",
|
||||
0, FST_ST2, FESC+0+(0xF0<<8), "fdiv",
|
||||
0, FST_ST2, FESC+2+(0xF0<<8), "fdivp",
|
||||
0, FST_ST2, FESC+0+(0xF8<<8), "fdivr",
|
||||
0, FST_ST2, FESC+2+(0xF8<<8), "fdivrp",
|
||||
0, FST_ST, FESC+0+(0xC8<<8), "fmul",
|
||||
0, FST_ST, FESC+2+(0xC8<<8), "fmulp",
|
||||
0, FST_ST2, FESC+0+(0xE0<<8), "fsub",
|
||||
0, FST_ST2, FESC+2+(0xE0<<8), "fsubp",
|
||||
0, FST_ST2, FESC+0+(0xE8<<8), "fsubr",
|
||||
0, FST_ST2, FESC+2+(0xE8<<8), "fsubrp",
|
||||
{0, FST_ST, FESC+0+(0xC0<<8), "fadd"},
|
||||
{0, FST_ST, FESC+2+(0xC0<<8), "faddp"},
|
||||
{0, FST_ST2, FESC+0+(0xF0<<8), "fdiv"},
|
||||
{0, FST_ST2, FESC+2+(0xF0<<8), "fdivp"},
|
||||
{0, FST_ST2, FESC+0+(0xF8<<8), "fdivr"},
|
||||
{0, FST_ST2, FESC+2+(0xF8<<8), "fdivrp"},
|
||||
{0, FST_ST, FESC+0+(0xC8<<8), "fmul"},
|
||||
{0, FST_ST, FESC+2+(0xC8<<8), "fmulp"},
|
||||
{0, FST_ST2, FESC+0+(0xE0<<8), "fsub"},
|
||||
{0, FST_ST2, FESC+2+(0xE0<<8), "fsubp"},
|
||||
{0, FST_ST2, FESC+0+(0xE8<<8), "fsubr"},
|
||||
{0, FST_ST2, FESC+2+(0xE8<<8), "fsubrp"},
|
||||
|
||||
/* Intel 486 instructions */
|
||||
0, EXTOPBW, 0xC0, "xaddb",
|
||||
0, EXTOPBW, 0xC1, "xadd",
|
||||
0, EXTOPBW, 0xB0, "cmpxchgb",
|
||||
0, EXTOPBW, 0xB1, "cmpxchg",
|
||||
0, BSWAP, 0xC8, "bswap",
|
||||
0, NOOP_2, 017+(010<<8), "invd",
|
||||
0, EXTOP1, 071, "invlpg",
|
||||
0, NOOP_2, 017+(011<<8), "wbinvd",
|
||||
{0, EXTOPBW, 0xC0, "xaddb"},
|
||||
{0, EXTOPBW, 0xC1, "xadd"},
|
||||
{0, EXTOPBW, 0xB0, "cmpxchgb"},
|
||||
{0, EXTOPBW, 0xB1, "cmpxchg"},
|
||||
{0, BSWAP, 0xC8, "bswap"},
|
||||
{0, NOOP_2, 017+(010<<8), "invd"},
|
||||
{0, EXTOP1, 071, "invlpg"},
|
||||
{0, NOOP_2, 017+(011<<8), "wbinvd"},
|
||||
|
||||
|
|
|
@ -8,7 +8,7 @@
|
|||
* INTEL 80386 special routines
|
||||
*/
|
||||
|
||||
ea_1_16(param)
|
||||
void ea_1_16(int param)
|
||||
{
|
||||
reg_1 &= 0377;
|
||||
if ((reg_1 & 070) || (param & ~070)) {
|
||||
|
@ -38,8 +38,7 @@ ea_1_16(param)
|
|||
}
|
||||
}
|
||||
|
||||
void
|
||||
ea_1(param) {
|
||||
void ea_1(int param) {
|
||||
if (! address_long) {
|
||||
ea_1_16(param);
|
||||
return;
|
||||
|
@ -71,16 +70,14 @@ ea_1(param) {
|
|||
}
|
||||
}
|
||||
|
||||
ea_2(param) {
|
||||
void ea_2(int param) {
|
||||
|
||||
op_1 = op_2;
|
||||
RELOMOVE(rel_1, rel_2);
|
||||
ea_1(param);
|
||||
}
|
||||
|
||||
int
|
||||
checkscale(val)
|
||||
valu_t val;
|
||||
int checkscale(valu_t val)
|
||||
{
|
||||
int v = val;
|
||||
|
||||
|
@ -105,7 +102,7 @@ checkscale(val)
|
|||
/*NOTREACHED*/
|
||||
}
|
||||
|
||||
reverse() {
|
||||
void reverse(void) {
|
||||
struct operand op;
|
||||
#ifdef RELOCATION
|
||||
int r = rel_1;
|
||||
|
@ -115,13 +112,13 @@ reverse() {
|
|||
op = op_1; op_1 = op_2; op_2 = op;
|
||||
}
|
||||
|
||||
badsyntax() {
|
||||
void badsyntax(void)
|
||||
{
|
||||
|
||||
serror("bad operands");
|
||||
}
|
||||
|
||||
regsize(sz)
|
||||
int sz;
|
||||
void regsize(int sz)
|
||||
{
|
||||
register int bit;
|
||||
|
||||
|
@ -135,8 +132,7 @@ regsize(sz)
|
|||
}
|
||||
}
|
||||
|
||||
void
|
||||
indexed() {
|
||||
void indexed(void) {
|
||||
if (address_long) {
|
||||
mod_2 = 0;
|
||||
if (sib_2 == -1)
|
||||
|
@ -175,9 +171,7 @@ indexed() {
|
|||
}
|
||||
}
|
||||
|
||||
ebranch(opc,exp)
|
||||
register int opc;
|
||||
expr_t exp;
|
||||
void ebranch(register int opc,expr_t exp)
|
||||
{
|
||||
/* Conditional branching; Full displacements are available
|
||||
on the 80386, so the welknown trick with the reverse branch
|
||||
|
@ -220,9 +214,7 @@ ebranch(opc,exp)
|
|||
}
|
||||
}
|
||||
|
||||
branch(opc,exp)
|
||||
register int opc;
|
||||
expr_t exp;
|
||||
void branch(register int opc,expr_t exp)
|
||||
{
|
||||
/* LOOP, JCXZ, etc. branch instructions.
|
||||
Here, the offset just must fit in a byte.
|
||||
|
@ -237,8 +229,7 @@ branch(opc,exp)
|
|||
emit1((int)dist);
|
||||
}
|
||||
|
||||
pushop(opc)
|
||||
register int opc;
|
||||
void pushop(register int opc)
|
||||
{
|
||||
|
||||
regsize(1);
|
||||
|
@ -274,8 +265,7 @@ pushop(opc)
|
|||
}
|
||||
}
|
||||
|
||||
opsize_exp(exp, nobyte)
|
||||
expr_t exp;
|
||||
void opsize_exp(expr_t exp, int nobyte)
|
||||
{
|
||||
if (! nobyte) {
|
||||
#ifdef RELOCATION
|
||||
|
@ -297,8 +287,7 @@ opsize_exp(exp, nobyte)
|
|||
}
|
||||
}
|
||||
|
||||
adsize_exp(exp, relpc)
|
||||
expr_t exp;
|
||||
void adsize_exp(expr_t exp, int relpc)
|
||||
{
|
||||
if (address_long) {
|
||||
#ifdef RELOCATION
|
||||
|
@ -314,8 +303,7 @@ adsize_exp(exp, relpc)
|
|||
}
|
||||
}
|
||||
|
||||
addop(opc)
|
||||
register int opc;
|
||||
void addop(register int opc)
|
||||
{
|
||||
|
||||
regsize(opc);
|
||||
|
@ -348,8 +336,7 @@ addop(opc)
|
|||
badsyntax();
|
||||
}
|
||||
|
||||
rolop(opc)
|
||||
register int opc;
|
||||
void rolop(register int opc)
|
||||
{
|
||||
register int oreg;
|
||||
|
||||
|
@ -378,8 +365,7 @@ rolop(opc)
|
|||
badsyntax();
|
||||
}
|
||||
|
||||
incop(opc)
|
||||
register int opc;
|
||||
void incop(register int opc)
|
||||
{
|
||||
|
||||
regsize(opc);
|
||||
|
@ -392,8 +378,7 @@ incop(opc)
|
|||
}
|
||||
}
|
||||
|
||||
callop(opc)
|
||||
register int opc;
|
||||
void callop(register int opc)
|
||||
{
|
||||
|
||||
regsize(1);
|
||||
|
@ -412,8 +397,7 @@ callop(opc)
|
|||
}
|
||||
}
|
||||
|
||||
xchg(opc)
|
||||
register int opc;
|
||||
void xchg(register int opc)
|
||||
{
|
||||
|
||||
regsize(opc);
|
||||
|
@ -428,8 +412,7 @@ xchg(opc)
|
|||
badsyntax();
|
||||
}
|
||||
|
||||
test(opc)
|
||||
register int opc;
|
||||
void test(register int opc)
|
||||
{
|
||||
|
||||
regsize(opc);
|
||||
|
@ -453,8 +436,7 @@ test(opc)
|
|||
badsyntax();
|
||||
}
|
||||
|
||||
mov(opc)
|
||||
register int opc;
|
||||
void mov(register int opc)
|
||||
{
|
||||
|
||||
regsize(opc);
|
||||
|
@ -495,8 +477,7 @@ mov(opc)
|
|||
badsyntax();
|
||||
}
|
||||
|
||||
extshft(opc, reg)
|
||||
int opc;
|
||||
void extshft(int opc, int reg)
|
||||
{
|
||||
int oreg2 = reg_2;
|
||||
|
||||
|
@ -521,8 +502,7 @@ extshft(opc, reg)
|
|||
else badsyntax();
|
||||
}
|
||||
|
||||
bittestop(opc)
|
||||
int opc;
|
||||
void bittestop(int opc)
|
||||
{
|
||||
regsize(1);
|
||||
emit1(0xF);
|
||||
|
@ -542,8 +522,7 @@ bittestop(opc)
|
|||
else badsyntax();
|
||||
}
|
||||
|
||||
imul(reg)
|
||||
int reg;
|
||||
void imul(int reg)
|
||||
{
|
||||
/* This instruction is more elaborate on the 80386. Its most
|
||||
general form is:
|
||||
|
|
|
@ -8,101 +8,101 @@
|
|||
* Specials
|
||||
*/
|
||||
|
||||
0, KILL, 0, "kill",
|
||||
{0, KILL, 0, "kill"},
|
||||
|
||||
/*
|
||||
* Intel 8080 keywords
|
||||
*/
|
||||
0, REG, B, "b",
|
||||
0, REG, C, "c",
|
||||
0, REG, D, "d",
|
||||
0, REG, E, "e",
|
||||
0, REG, H, "h",
|
||||
0, REG, L, "l",
|
||||
0, REG, M, "m",
|
||||
0, REG, A, "a",
|
||||
0, REG, SP, "sp",
|
||||
0, REG, PSW, "psw",
|
||||
0, D16OP, 0315, "call",
|
||||
0, D16OP, 0334, "cc",
|
||||
0, D16OP, 0324, "cnc",
|
||||
0, D16OP, 0314, "cz",
|
||||
0, D16OP, 0304, "cnz",
|
||||
0, D16OP, 0364, "cp",
|
||||
0, D16OP, 0374, "cm",
|
||||
0, D16OP, 0354, "cpe",
|
||||
0, D16OP, 0344, "cpo",
|
||||
0, NOOPOP, 0311, "ret",
|
||||
0, NOOPOP, 0330, "rc",
|
||||
0, NOOPOP, 0320, "rnc",
|
||||
0, NOOPOP, 0310, "rz",
|
||||
0, NOOPOP, 0300, "rnz",
|
||||
0, NOOPOP, 0360, "rp",
|
||||
0, NOOPOP, 0370, "rm",
|
||||
0, NOOPOP, 0350, "rpe",
|
||||
0, NOOPOP, 0340, "rpo",
|
||||
0, RST, 0307, "rst",
|
||||
0, D8OP, 0333, "in",
|
||||
0, D8OP, 0323, "out",
|
||||
0, LXI, 0001, "lxi",
|
||||
0, R16OP, 0305, "push",
|
||||
0, R16OP, 0301, "pop",
|
||||
0, D16OP, 0062, "sta",
|
||||
0, D16OP, 0072, "lda",
|
||||
0, NOOPOP, 0353, "xchg",
|
||||
0, NOOPOP, 0343, "xthl",
|
||||
0, NOOPOP, 0371, "sphl",
|
||||
0, NOOPOP, 0351, "pchl",
|
||||
0, R16OP, 0011, "dad",
|
||||
0, STLDAX, 0002, "stax",
|
||||
0, STLDAX, 0012, "ldax",
|
||||
0, R16OP, 0003, "inx",
|
||||
0, MOV, 0100, "mov",
|
||||
0, NOOPOP, 0166, "hlt",
|
||||
0, MVI, 0006, "mvi",
|
||||
0, DSTOP, 0004, "inr",
|
||||
0, DSTOP, 0005, "dcr",
|
||||
0, SRCOP, 0200, "add",
|
||||
0, SRCOP, 0210, "adc",
|
||||
0, SRCOP, 0220, "sub",
|
||||
0, SRCOP, 0230, "sbb",
|
||||
0, SRCOP, 0240, "ana",
|
||||
0, SRCOP, 0250, "xra",
|
||||
0, SRCOP, 0260, "ora",
|
||||
0, SRCOP, 0270, "cmp",
|
||||
0, D8OP, 0306, "adi",
|
||||
0, D8OP, 0316, "aci",
|
||||
0, D8OP, 0326, "sui",
|
||||
0, D8OP, 0336, "sbi",
|
||||
0, D8OP, 0346, "ani",
|
||||
0, D8OP, 0356, "xri",
|
||||
0, D8OP, 0366, "ori",
|
||||
0, D8OP, 0376, "cpi",
|
||||
0, NOOPOP, 0007, "rlc",
|
||||
0, NOOPOP, 0017, "rrc",
|
||||
0, NOOPOP, 0027, "ral",
|
||||
0, NOOPOP, 0037, "rar",
|
||||
0, D16OP, 0303, "jmp",
|
||||
0, D16OP, 0332, "jc",
|
||||
0, D16OP, 0322, "jnc",
|
||||
0, D16OP, 0312, "jz",
|
||||
0, D16OP, 0302, "jnz",
|
||||
0, D16OP, 0362, "jp",
|
||||
0, D16OP, 0372, "jm",
|
||||
0, D16OP, 0352, "jpe",
|
||||
0, D16OP, 0342, "jpo",
|
||||
0, R16OP, 0013, "dcx",
|
||||
0, NOOPOP, 0057, "cma",
|
||||
0, NOOPOP, 0067, "stc",
|
||||
0, NOOPOP, 0077, "cmc",
|
||||
0, NOOPOP, 0047, "daa",
|
||||
0, D16OP, 0042, "shld",
|
||||
0, D16OP, 0052, "lhld",
|
||||
0, NOOPOP, 0373, "ei",
|
||||
0, NOOPOP, 0363, "di",
|
||||
0, NOOPOP, 0000, "nop",
|
||||
0, NOOPOP, 0040, "rim", /* 8085 */
|
||||
0, NOOPOP, 0060, "sim", /* 8085 */
|
||||
{0, REG, B, "b"},
|
||||
{0, REG, C, "c"},
|
||||
{0, REG, D, "d"},
|
||||
{0, REG, E, "e"},
|
||||
{0, REG, H, "h"},
|
||||
{0, REG, L, "l"},
|
||||
{0, REG, M, "m"},
|
||||
{0, REG, A, "a"},
|
||||
{0, REG, SP, "sp"},
|
||||
{0, REG, PSW, "psw"},
|
||||
{0, D16OP, 0315, "call"},
|
||||
{0, D16OP, 0334, "cc"},
|
||||
{0, D16OP, 0324, "cnc"},
|
||||
{0, D16OP, 0314, "cz"},
|
||||
{0, D16OP, 0304, "cnz"},
|
||||
{0, D16OP, 0364, "cp"},
|
||||
{0, D16OP, 0374, "cm"},
|
||||
{0, D16OP, 0354, "cpe"},
|
||||
{0, D16OP, 0344, "cpo"},
|
||||
{0, NOOPOP, 0311, "ret"},
|
||||
{0, NOOPOP, 0330, "rc"},
|
||||
{0, NOOPOP, 0320, "rnc"},
|
||||
{0, NOOPOP, 0310, "rz"},
|
||||
{0, NOOPOP, 0300, "rnz"},
|
||||
{0, NOOPOP, 0360, "rp"},
|
||||
{0, NOOPOP, 0370, "rm"},
|
||||
{0, NOOPOP, 0350, "rpe"},
|
||||
{0, NOOPOP, 0340, "rpo"},
|
||||
{0, RST, 0307, "rst"},
|
||||
{0, D8OP, 0333, "in"},
|
||||
{0, D8OP, 0323, "out"},
|
||||
{0, LXI, 0001, "lxi"},
|
||||
{0, R16OP, 0305, "push"},
|
||||
{0, R16OP, 0301, "pop"},
|
||||
{0, D16OP, 0062, "sta"},
|
||||
{0, D16OP, 0072, "lda"},
|
||||
{0, NOOPOP, 0353, "xchg"},
|
||||
{0, NOOPOP, 0343, "xthl"},
|
||||
{0, NOOPOP, 0371, "sphl"},
|
||||
{0, NOOPOP, 0351, "pchl"},
|
||||
{0, R16OP, 0011, "dad"},
|
||||
{0, STLDAX, 0002, "stax"},
|
||||
{0, STLDAX, 0012, "ldax"},
|
||||
{0, R16OP, 0003, "inx"},
|
||||
{0, MOV, 0100, "mov"},
|
||||
{0, NOOPOP, 0166, "hlt"},
|
||||
{0, MVI, 0006, "mvi"},
|
||||
{0, DSTOP, 0004, "inr"},
|
||||
{0, DSTOP, 0005, "dcr"},
|
||||
{0, SRCOP, 0200, "add"},
|
||||
{0, SRCOP, 0210, "adc"},
|
||||
{0, SRCOP, 0220, "sub"},
|
||||
{0, SRCOP, 0230, "sbb"},
|
||||
{0, SRCOP, 0240, "ana"},
|
||||
{0, SRCOP, 0250, "xra"},
|
||||
{0, SRCOP, 0260, "ora"},
|
||||
{0, SRCOP, 0270, "cmp"},
|
||||
{0, D8OP, 0306, "adi"},
|
||||
{0, D8OP, 0316, "aci"},
|
||||
{0, D8OP, 0326, "sui"},
|
||||
{0, D8OP, 0336, "sbi"},
|
||||
{0, D8OP, 0346, "ani"},
|
||||
{0, D8OP, 0356, "xri"},
|
||||
{0, D8OP, 0366, "ori"},
|
||||
{0, D8OP, 0376, "cpi"},
|
||||
{0, NOOPOP, 0007, "rlc"},
|
||||
{0, NOOPOP, 0017, "rrc"},
|
||||
{0, NOOPOP, 0027, "ral"},
|
||||
{0, NOOPOP, 0037, "rar"},
|
||||
{0, D16OP, 0303, "jmp"},
|
||||
{0, D16OP, 0332, "jc"},
|
||||
{0, D16OP, 0322, "jnc"},
|
||||
{0, D16OP, 0312, "jz"},
|
||||
{0, D16OP, 0302, "jnz"},
|
||||
{0, D16OP, 0362, "jp"},
|
||||
{0, D16OP, 0372, "jm"},
|
||||
{0, D16OP, 0352, "jpe"},
|
||||
{0, D16OP, 0342, "jpo"},
|
||||
{0, R16OP, 0013, "dcx"},
|
||||
{0, NOOPOP, 0057, "cma"},
|
||||
{0, NOOPOP, 0067, "stc"},
|
||||
{0, NOOPOP, 0077, "cmc"},
|
||||
{0, NOOPOP, 0047, "daa"},
|
||||
{0, D16OP, 0042, "shld"},
|
||||
{0, D16OP, 0052, "lhld"},
|
||||
{0, NOOPOP, 0373, "ei"},
|
||||
{0, NOOPOP, 0363, "di"},
|
||||
{0, NOOPOP, 0000, "nop"},
|
||||
{0, NOOPOP, 0040, "rim"}, /* 8085 */
|
||||
{0, NOOPOP, 0060, "sim"}, /* 8085 */
|
||||
/*
|
||||
* The Intel 8085 has a set of instructions for high level language
|
||||
* support that were not originally documented.
|
||||
|
@ -114,14 +114,14 @@
|
|||
* check via A. RSTV is useful for runtimes where signed overflow is a
|
||||
* fault.
|
||||
*/
|
||||
0, NOOPOP, 0010, "dsub", /* 8085 undoc HL = HL - BC */
|
||||
0, NOOPOP, 0020, "arhl", /* 8085 undoc HL arith right shift */
|
||||
0, NOOPOP, 0030, "rld", /* 8085 undoc rotate DE left thru carry */
|
||||
{0, NOOPOP, 0010, "dsub"}, /* 8085 undoc HL = HL - BC */
|
||||
{0, NOOPOP, 0020, "arhl"}, /* 8085 undoc HL arith right shift */
|
||||
{0, NOOPOP, 0030, "rld"}, /* 8085 undoc rotate DE left thru carry */
|
||||
/* in effect ADC DE,DE */
|
||||
0, D8OP, 0050, "ldhi", /* DE = HL + imm8 */
|
||||
0, D8OP, 0070, "ldsi", /* DE = SP + imm8 */
|
||||
0, NOOPOP, 0313, "rstv", /* RST8 if V set */
|
||||
0, NOOPOP, 0331, "shlx", /* (DE) = HL */
|
||||
0, NOOPOP, 0355, "lhlx", /* HL = (DE) */
|
||||
0, D16OP, 0335, "jnk", /* Jump K clear */
|
||||
0, D16OP, 0375, "jk", /* Jump K set */
|
||||
{0, D8OP, 0050, "ldhi"}, /* DE = HL + imm8 */
|
||||
{0, D8OP, 0070, "ldsi"}, /* DE = SP + imm8 */
|
||||
{0, NOOPOP, 0313, "rstv"}, /* RST8 if V set */
|
||||
{0, NOOPOP, 0331, "shlx"}, /* (DE) = HL */
|
||||
{0, NOOPOP, 0355, "lhlx"}, /* HL = (DE) */
|
||||
{0, D16OP, 0335, "jnk"}, /* Jump K clear */
|
||||
{0, D16OP, 0375, "jk"}, /* Jump K set */
|
||||
|
|
|
@ -2475,5 +2475,6 @@ with hlreg
|
|||
gen shld {label,".reghp"}
|
||||
|
||||
pat trp
|
||||
kills ALL
|
||||
gen Call {label,".trp"}
|
||||
with areg
|
||||
kills ALL
|
||||
gen Call {label,".trp"}
|
||||
|
|
|
@ -42,3 +42,21 @@ char dr_m[8][8] = {
|
|||
-1, -1, -1, -1, -1, -1, -1, -1
|
||||
};
|
||||
#endif
|
||||
|
||||
/* 8086 specific routines */
|
||||
void ea_1(int param);
|
||||
void ea_2(int param);
|
||||
void reverse(void);
|
||||
void badsyntax(void);
|
||||
void regsize(register int sz);
|
||||
void indexed(void);
|
||||
void branch(register int opc,expr_t exp);
|
||||
void pushop(register int opc);
|
||||
void addop(register int opc);
|
||||
void rolop(register int opc);
|
||||
void incop(register int opc);
|
||||
void callop(register int opc);
|
||||
void xchg(register int opc);
|
||||
void test(register int opc);
|
||||
void mov(register int opc);
|
||||
void imul(int opc);
|
||||
|
|
|
@ -8,330 +8,330 @@
|
|||
* INTEL 8086 keywords
|
||||
*/
|
||||
|
||||
0, R16, 0, "ax",
|
||||
0, R16, 1, "cx",
|
||||
0, R16, 2, "dx",
|
||||
0, R16, 3, "bx",
|
||||
0, R16, 4, "sp",
|
||||
0, R16, 5, "bp",
|
||||
0, R16, 6, "si",
|
||||
0, R16, 7, "di",
|
||||
0, R8, 0, "al",
|
||||
0, R8, 1, "cl",
|
||||
0, R8, 2, "dl",
|
||||
0, R8, 3, "bl",
|
||||
0, R8, 4, "ah",
|
||||
0, R8, 5, "ch",
|
||||
0, R8, 6, "dh",
|
||||
0, R8, 7, "bh",
|
||||
0, RSEG, 0, "es",
|
||||
0, RSEG, 1, "cs",
|
||||
0, RSEG, 2, "ss",
|
||||
0, RSEG, 3, "ds",
|
||||
0, PREFIX, 046, "eseg",
|
||||
0, PREFIX, 056, "cseg",
|
||||
0, PREFIX, 066, "sseg",
|
||||
0, PREFIX, 076, "dseg",
|
||||
0, PREFIX, 0360, "lock",
|
||||
0, PREFIX, 0363, "rep",
|
||||
0, PREFIX, 0362, "repne",
|
||||
0, PREFIX, 0362, "repnz",
|
||||
0, PREFIX, 0363, "repe",
|
||||
0, PREFIX, 0363, "repz",
|
||||
0, NOOP_1, 047, "daa",
|
||||
0, NOOP_1, 057, "das",
|
||||
0, NOOP_1, 067, "aaa",
|
||||
0, NOOP_1, 077, "aas",
|
||||
0, NOOP_1, 0220, "nop",
|
||||
0, NOOP_1, 0230, "cbw",
|
||||
0, NOOP_1, 0231, "cwd",
|
||||
0, NOOP_1, 0233, "wait",
|
||||
0, NOOP_1, 0234, "pushf",
|
||||
0, NOOP_1, 0235, "popf",
|
||||
0, NOOP_1, 0236, "sahf",
|
||||
0, NOOP_1, 0237, "lahf",
|
||||
0, NOOP_1, 0244, "movsb",
|
||||
0, NOOP_1, 0245, "movs",
|
||||
0, NOOP_1, 0245, "movsw",
|
||||
0, NOOP_1, 0246, "cmpsb",
|
||||
0, NOOP_1, 0247, "cmps",
|
||||
0, NOOP_1, 0247, "cmpsw",
|
||||
0, NOOP_1, 0252, "stosb",
|
||||
0, NOOP_1, 0253, "stos",
|
||||
0, NOOP_1, 0253, "stosw",
|
||||
0, NOOP_1, 0254, "lodsb",
|
||||
0, NOOP_1, 0255, "lods",
|
||||
0, NOOP_1, 0255, "lodsw",
|
||||
0, NOOP_1, 0256, "scasb",
|
||||
0, NOOP_1, 0257, "scas",
|
||||
0, NOOP_1, 0257, "scasw",
|
||||
0, NOOP_1, 0316, "into",
|
||||
0, NOOP_1, 0317, "iret",
|
||||
0, NOOP_1, 0327, "xlat",
|
||||
0, NOOP_1, 0364, "hlt",
|
||||
0, NOOP_1, 0365, "cmc",
|
||||
0, NOOP_1, 0370, "clc",
|
||||
0, NOOP_1, 0371, "stc",
|
||||
0, NOOP_1, 0372, "cli",
|
||||
0, NOOP_1, 0373, "sti",
|
||||
0, NOOP_1, 0374, "cld",
|
||||
0, NOOP_1, 0375, "std",
|
||||
0, NOOP_2, 0324+012<<8, "aam",
|
||||
0, NOOP_2, 0325+012<<8, "aad",
|
||||
0, JOP, 0340, "loopne",
|
||||
0, JOP, 0340, "loopnz",
|
||||
0, JOP, 0341, "loope",
|
||||
0, JOP, 0341, "loopz",
|
||||
0, JOP, 0342, "loop",
|
||||
0, JOP, 0343, "jcxz",
|
||||
0, JOP, 0160, "jo",
|
||||
0, JOP, 0161, "jno",
|
||||
0, JOP, 0162, "jb",
|
||||
0, JOP, 0162, "jc",
|
||||
0, JOP, 0162, "jnae",
|
||||
0, JOP, 0163, "jae",
|
||||
0, JOP, 0163, "jnb",
|
||||
0, JOP, 0163, "jnc",
|
||||
0, JOP, 0164, "je",
|
||||
0, JOP, 0164, "jz",
|
||||
0, JOP, 0165, "jne",
|
||||
0, JOP, 0165, "jnz",
|
||||
0, JOP, 0166, "jbe",
|
||||
0, JOP, 0166, "jna",
|
||||
0, JOP, 0167, "ja",
|
||||
0, JOP, 0167, "jnbe",
|
||||
0, JOP, 0170, "js",
|
||||
0, JOP, 0171, "jns",
|
||||
0, JOP, 0172, "jp",
|
||||
0, JOP, 0172, "jpe",
|
||||
0, JOP, 0173, "jnp",
|
||||
0, JOP, 0173, "jpo",
|
||||
0, JOP, 0174, "jl",
|
||||
0, JOP, 0174, "jnge",
|
||||
0, JOP, 0175, "jge",
|
||||
0, JOP, 0175, "jnl",
|
||||
0, JOP, 0176, "jle",
|
||||
0, JOP, 0176, "jng",
|
||||
0, JOP, 0177, "jg",
|
||||
0, JOP, 0177, "jnle",
|
||||
0, PUSHOP, 0, "push",
|
||||
0, PUSHOP, 1, "pop",
|
||||
0, IOOP, 0344, "inb",
|
||||
0, IOOP, 0345, "in",
|
||||
0, IOOP, 0345, "inw",
|
||||
0, IOOP, 0346, "outb",
|
||||
0, IOOP, 0347, "out",
|
||||
0, IOOP, 0347, "outw",
|
||||
0, ADDOP, 000, "addb",
|
||||
0, ADDOP, 001, "add",
|
||||
0, ADDOP, 010, "orb",
|
||||
0, ADDOP, 011, "or",
|
||||
0, ADDOP, 020, "adcb",
|
||||
0, ADDOP, 021, "adc",
|
||||
0, ADDOP, 030, "sbbb",
|
||||
0, ADDOP, 031, "sbb",
|
||||
0, ADDOP, 040, "andb",
|
||||
0, ADDOP, 041, "and",
|
||||
0, ADDOP, 050, "subb",
|
||||
0, ADDOP, 051, "sub",
|
||||
0, ADDOP, 060, "xorb",
|
||||
0, ADDOP, 061, "xor",
|
||||
0, ADDOP, 070, "cmpb",
|
||||
0, ADDOP, 071, "cmp",
|
||||
0, ROLOP, 000, "rolb",
|
||||
0, ROLOP, 001, "rol",
|
||||
0, ROLOP, 010, "rorb",
|
||||
0, ROLOP, 011, "ror",
|
||||
0, ROLOP, 020, "rclb",
|
||||
0, ROLOP, 021, "rcl",
|
||||
0, ROLOP, 030, "rcrb",
|
||||
0, ROLOP, 031, "rcr",
|
||||
0, ROLOP, 040, "salb",
|
||||
0, ROLOP, 040, "shlb",
|
||||
0, ROLOP, 041, "sal",
|
||||
0, ROLOP, 041, "shl",
|
||||
0, ROLOP, 050, "shrb",
|
||||
0, ROLOP, 051, "shr",
|
||||
0, ROLOP, 070, "sarb",
|
||||
0, ROLOP, 071, "sar",
|
||||
0, INCOP, 000, "incb",
|
||||
0, INCOP, 001, "inc",
|
||||
0, INCOP, 010, "decb",
|
||||
0, INCOP, 011, "dec",
|
||||
0, NOTOP, 020, "notb",
|
||||
0, NOTOP, 021, "not",
|
||||
0, NOTOP, 030, "negb",
|
||||
0, NOTOP, 031, "neg",
|
||||
0, NOTOP, 040, "mulb",
|
||||
0, NOTOP, 041, "mul",
|
||||
0, NOTOP, 050, "imulb",
|
||||
0, IMUL, 051, "imul", /* for 80286 */
|
||||
0, NOTOP, 060, "divb",
|
||||
0, NOTOP, 061, "div",
|
||||
0, NOTOP, 070, "idivb",
|
||||
0, NOTOP, 071, "idiv",
|
||||
0, CALLOP, 020+(0350<<8), "call",
|
||||
0, CALLOP, 040+(0351<<8), "jmp",
|
||||
0, CALFOP, 030+(0232<<8), "callf",
|
||||
0, CALFOP, 050+(0352<<8), "jmpf",
|
||||
0, LEAOP, 0215, "lea",
|
||||
0, LEAOP, 0304, "les",
|
||||
0, LEAOP, 0305, "lds",
|
||||
0, ESC, 0, "esc",
|
||||
0, INT, 0, "int",
|
||||
0, RET, 0303, "ret",
|
||||
0, RET, 0313, "retf",
|
||||
0, XCHG, 0, "xchgb",
|
||||
0, XCHG, 1, "xchg",
|
||||
0, TEST, 0, "testb",
|
||||
0, TEST, 1, "test",
|
||||
0, MOV, 0, "movb",
|
||||
0, MOV, 1, "mov",
|
||||
0, MOV, 1, "movw",
|
||||
{0, R16, 0, "ax"},
|
||||
{0, R16, 1, "cx"},
|
||||
{0, R16, 2, "dx"},
|
||||
{0, R16, 3, "bx"},
|
||||
{0, R16, 4, "sp"},
|
||||
{0, R16, 5, "bp"},
|
||||
{0, R16, 6, "si"},
|
||||
{0, R16, 7, "di"},
|
||||
{0, R8, 0, "al"},
|
||||
{0, R8, 1, "cl"},
|
||||
{0, R8, 2, "dl"},
|
||||
{0, R8, 3, "bl"},
|
||||
{0, R8, 4, "ah"},
|
||||
{0, R8, 5, "ch"},
|
||||
{0, R8, 6, "dh"},
|
||||
{0, R8, 7, "bh"},
|
||||
{0, RSEG, 0, "es"},
|
||||
{0, RSEG, 1, "cs"},
|
||||
{0, RSEG, 2, "ss"},
|
||||
{0, RSEG, 3, "ds"},
|
||||
{0, PREFIX, 046, "eseg"},
|
||||
{0, PREFIX, 056, "cseg"},
|
||||
{0, PREFIX, 066, "sseg"},
|
||||
{0, PREFIX, 076, "dseg"},
|
||||
{0, PREFIX, 0360, "lock"},
|
||||
{0, PREFIX, 0363, "rep"},
|
||||
{0, PREFIX, 0362, "repne"},
|
||||
{0, PREFIX, 0362, "repnz"},
|
||||
{0, PREFIX, 0363, "repe"},
|
||||
{0, PREFIX, 0363, "repz"},
|
||||
{0, NOOP_1, 047, "daa"},
|
||||
{0, NOOP_1, 057, "das"},
|
||||
{0, NOOP_1, 067, "aaa"},
|
||||
{0, NOOP_1, 077, "aas"},
|
||||
{0, NOOP_1, 0220, "nop"},
|
||||
{0, NOOP_1, 0230, "cbw"},
|
||||
{0, NOOP_1, 0231, "cwd"},
|
||||
{0, NOOP_1, 0233, "wait"},
|
||||
{0, NOOP_1, 0234, "pushf"},
|
||||
{0, NOOP_1, 0235, "popf"},
|
||||
{0, NOOP_1, 0236, "sahf"},
|
||||
{0, NOOP_1, 0237, "lahf"},
|
||||
{0, NOOP_1, 0244, "movsb"},
|
||||
{0, NOOP_1, 0245, "movs"},
|
||||
{0, NOOP_1, 0245, "movsw"},
|
||||
{0, NOOP_1, 0246, "cmpsb"},
|
||||
{0, NOOP_1, 0247, "cmps"},
|
||||
{0, NOOP_1, 0247, "cmpsw"},
|
||||
{0, NOOP_1, 0252, "stosb"},
|
||||
{0, NOOP_1, 0253, "stos"},
|
||||
{0, NOOP_1, 0253, "stosw"},
|
||||
{0, NOOP_1, 0254, "lodsb"},
|
||||
{0, NOOP_1, 0255, "lods"},
|
||||
{0, NOOP_1, 0255, "lodsw"},
|
||||
{0, NOOP_1, 0256, "scasb"},
|
||||
{0, NOOP_1, 0257, "scas"},
|
||||
{0, NOOP_1, 0257, "scasw"},
|
||||
{0, NOOP_1, 0316, "into"},
|
||||
{0, NOOP_1, 0317, "iret"},
|
||||
{0, NOOP_1, 0327, "xlat"},
|
||||
{0, NOOP_1, 0364, "hlt"},
|
||||
{0, NOOP_1, 0365, "cmc"},
|
||||
{0, NOOP_1, 0370, "clc"},
|
||||
{0, NOOP_1, 0371, "stc"},
|
||||
{0, NOOP_1, 0372, "cli"},
|
||||
{0, NOOP_1, 0373, "sti"},
|
||||
{0, NOOP_1, 0374, "cld"},
|
||||
{0, NOOP_1, 0375, "std"},
|
||||
{0, NOOP_2, 0324+012<<8, "aam"},
|
||||
{0, NOOP_2, 0325+012<<8, "aad"},
|
||||
{0, JOP, 0340, "loopne"},
|
||||
{0, JOP, 0340, "loopnz"},
|
||||
{0, JOP, 0341, "loope"},
|
||||
{0, JOP, 0341, "loopz"},
|
||||
{0, JOP, 0342, "loop"},
|
||||
{0, JOP, 0343, "jcxz"},
|
||||
{0, JOP, 0160, "jo"},
|
||||
{0, JOP, 0161, "jno"},
|
||||
{0, JOP, 0162, "jb"},
|
||||
{0, JOP, 0162, "jc"},
|
||||
{0, JOP, 0162, "jnae"},
|
||||
{0, JOP, 0163, "jae"},
|
||||
{0, JOP, 0163, "jnb"},
|
||||
{0, JOP, 0163, "jnc"},
|
||||
{0, JOP, 0164, "je"},
|
||||
{0, JOP, 0164, "jz"},
|
||||
{0, JOP, 0165, "jne"},
|
||||
{0, JOP, 0165, "jnz"},
|
||||
{0, JOP, 0166, "jbe"},
|
||||
{0, JOP, 0166, "jna"},
|
||||
{0, JOP, 0167, "ja"},
|
||||
{0, JOP, 0167, "jnbe"},
|
||||
{0, JOP, 0170, "js"},
|
||||
{0, JOP, 0171, "jns"},
|
||||
{0, JOP, 0172, "jp"},
|
||||
{0, JOP, 0172, "jpe"},
|
||||
{0, JOP, 0173, "jnp"},
|
||||
{0, JOP, 0173, "jpo"},
|
||||
{0, JOP, 0174, "jl"},
|
||||
{0, JOP, 0174, "jnge"},
|
||||
{0, JOP, 0175, "jge"},
|
||||
{0, JOP, 0175, "jnl"},
|
||||
{0, JOP, 0176, "jle"},
|
||||
{0, JOP, 0176, "jng"},
|
||||
{0, JOP, 0177, "jg"},
|
||||
{0, JOP, 0177, "jnle"},
|
||||
{0, PUSHOP, 0, "push"},
|
||||
{0, PUSHOP, 1, "pop"},
|
||||
{0, IOOP, 0344, "inb"},
|
||||
{0, IOOP, 0345, "in"},
|
||||
{0, IOOP, 0345, "inw"},
|
||||
{0, IOOP, 0346, "outb"},
|
||||
{0, IOOP, 0347, "out"},
|
||||
{0, IOOP, 0347, "outw"},
|
||||
{0, ADDOP, 000, "addb"},
|
||||
{0, ADDOP, 001, "add"},
|
||||
{0, ADDOP, 010, "orb"},
|
||||
{0, ADDOP, 011, "or"},
|
||||
{0, ADDOP, 020, "adcb"},
|
||||
{0, ADDOP, 021, "adc"},
|
||||
{0, ADDOP, 030, "sbbb"},
|
||||
{0, ADDOP, 031, "sbb"},
|
||||
{0, ADDOP, 040, "andb"},
|
||||
{0, ADDOP, 041, "and"},
|
||||
{0, ADDOP, 050, "subb"},
|
||||
{0, ADDOP, 051, "sub"},
|
||||
{0, ADDOP, 060, "xorb"},
|
||||
{0, ADDOP, 061, "xor"},
|
||||
{0, ADDOP, 070, "cmpb"},
|
||||
{0, ADDOP, 071, "cmp"},
|
||||
{0, ROLOP, 000, "rolb"},
|
||||
{0, ROLOP, 001, "rol"},
|
||||
{0, ROLOP, 010, "rorb"},
|
||||
{0, ROLOP, 011, "ror"},
|
||||
{0, ROLOP, 020, "rclb"},
|
||||
{0, ROLOP, 021, "rcl"},
|
||||
{0, ROLOP, 030, "rcrb"},
|
||||
{0, ROLOP, 031, "rcr"},
|
||||
{0, ROLOP, 040, "salb"},
|
||||
{0, ROLOP, 040, "shlb"},
|
||||
{0, ROLOP, 041, "sal"},
|
||||
{0, ROLOP, 041, "shl"},
|
||||
{0, ROLOP, 050, "shrb"},
|
||||
{0, ROLOP, 051, "shr"},
|
||||
{0, ROLOP, 070, "sarb"},
|
||||
{0, ROLOP, 071, "sar"},
|
||||
{0, INCOP, 000, "incb"},
|
||||
{0, INCOP, 001, "inc"},
|
||||
{0, INCOP, 010, "decb"},
|
||||
{0, INCOP, 011, "dec"},
|
||||
{0, NOTOP, 020, "notb"},
|
||||
{0, NOTOP, 021, "not"},
|
||||
{0, NOTOP, 030, "negb"},
|
||||
{0, NOTOP, 031, "neg"},
|
||||
{0, NOTOP, 040, "mulb"},
|
||||
{0, NOTOP, 041, "mul"},
|
||||
{0, NOTOP, 050, "imulb"},
|
||||
{0, IMUL, 051, "imul"}, /* for 80286 */
|
||||
{0, NOTOP, 060, "divb"},
|
||||
{0, NOTOP, 061, "div"},
|
||||
{0, NOTOP, 070, "idivb"},
|
||||
{0, NOTOP, 071, "idiv"},
|
||||
{0, CALLOP, 020+(0350<<8), "call"},
|
||||
{0, CALLOP, 040+(0351<<8), "jmp"},
|
||||
{0, CALFOP, 030+(0232<<8), "callf"},
|
||||
{0, CALFOP, 050+(0352<<8), "jmpf"},
|
||||
{0, LEAOP, 0215, "lea"},
|
||||
{0, LEAOP, 0304, "les"},
|
||||
{0, LEAOP, 0305, "lds"},
|
||||
{0, ESC, 0, "esc"},
|
||||
{0, INT, 0, "int"},
|
||||
{0, RET, 0303, "ret"},
|
||||
{0, RET, 0313, "retf"},
|
||||
{0, XCHG, 0, "xchgb"},
|
||||
{0, XCHG, 1, "xchg"},
|
||||
{0, TEST, 0, "testb"},
|
||||
{0, TEST, 1, "test"},
|
||||
{0, MOV, 0, "movb"},
|
||||
{0, MOV, 1, "mov"},
|
||||
{0, MOV, 1, "movw"},
|
||||
|
||||
/* Intel 8087 coprocessor keywords */
|
||||
|
||||
0, ST, 0, "st",
|
||||
{0, ST, 0, "st"},
|
||||
|
||||
0, FNOOP, FESC+1+(0xF0<<8), "f2xm1",
|
||||
0, FNOOP, FESC+1+(0xE1<<8), "fabs",
|
||||
0, FNOOP, FESC+1+(0xE0<<8), "fchs",
|
||||
0, FNOOP, FESC+3+(0xE2<<8), "fclex",
|
||||
0, FNOOP, FESC+6+(0xD9<<8), "fcompp",
|
||||
0, FNOOP, FESC+1+(0xF6<<8), "fdecstp",
|
||||
0, FNOOP, FESC+3+(0xE1<<8), "fdisi",
|
||||
0, FNOOP, FESC+3+(0xE0<<8), "feni",
|
||||
0, FNOOP, FESC+1+(0xF7<<8), "fincstp",
|
||||
0, FNOOP, FESC+3+(0xE3<<8), "finit",
|
||||
0, FNOOP, FESC+1+(0xE8<<8), "fld1",
|
||||
0, FNOOP, FESC+1+(0xEA<<8), "fldl2e",
|
||||
0, FNOOP, FESC+1+(0xE9<<8), "fldl2t",
|
||||
0, FNOOP, FESC+1+(0xEC<<8), "fldlg2",
|
||||
0, FNOOP, FESC+1+(0xED<<8), "fldln2",
|
||||
0, FNOOP, FESC+1+(0xEB<<8), "fldpi",
|
||||
0, FNOOP, FESC+1+(0xEE<<8), "fldz",
|
||||
0, FNOOP, FESC+1+(0xD0<<8), "fnop",
|
||||
0, FNOOP, FESC+1+(0xF3<<8), "fpatan",
|
||||
0, FNOOP, FESC+1+(0xF8<<8), "fprem",
|
||||
0, FNOOP, FESC+1+(0xF2<<8), "fptan",
|
||||
0, FNOOP, FESC+1+(0xFC<<8), "frndint",
|
||||
0, FNOOP, FESC+1+(0xFD<<8), "fscale",
|
||||
0, FNOOP, FESC+1+(0xFA<<8), "fsqrt",
|
||||
0, FNOOP, FESC+7+(0xE0<<8), "fstswax", /* 80287 */
|
||||
0, FNOOP, FESC+1+(0xE4<<8), "ftst",
|
||||
0, FNOOP, FESC+1+(0xE5<<8), "fxam",
|
||||
0, FNOOP, FESC+1+(0xF4<<8), "fxtract",
|
||||
0, FNOOP, FESC+1+(0xF1<<8), "fyl2x",
|
||||
0, FNOOP, FESC+1+(0xF9<<8), "fyl2pi",
|
||||
{0, FNOOP, FESC+1+(0xF0<<8), "f2xm1"},
|
||||
{0, FNOOP, FESC+1+(0xE1<<8), "fabs"},
|
||||
{0, FNOOP, FESC+1+(0xE0<<8), "fchs"},
|
||||
{0, FNOOP, FESC+3+(0xE2<<8), "fclex"},
|
||||
{0, FNOOP, FESC+6+(0xD9<<8), "fcompp"},
|
||||
{0, FNOOP, FESC+1+(0xF6<<8), "fdecstp"},
|
||||
{0, FNOOP, FESC+3+(0xE1<<8), "fdisi"},
|
||||
{0, FNOOP, FESC+3+(0xE0<<8), "feni"},
|
||||
{0, FNOOP, FESC+1+(0xF7<<8), "fincstp"},
|
||||
{0, FNOOP, FESC+3+(0xE3<<8), "finit"},
|
||||
{0, FNOOP, FESC+1+(0xE8<<8), "fld1"},
|
||||
{0, FNOOP, FESC+1+(0xEA<<8), "fldl2e"},
|
||||
{0, FNOOP, FESC+1+(0xE9<<8), "fldl2t"},
|
||||
{0, FNOOP, FESC+1+(0xEC<<8), "fldlg2"},
|
||||
{0, FNOOP, FESC+1+(0xED<<8), "fldln2"},
|
||||
{0, FNOOP, FESC+1+(0xEB<<8), "fldpi"},
|
||||
{0, FNOOP, FESC+1+(0xEE<<8), "fldz"},
|
||||
{0, FNOOP, FESC+1+(0xD0<<8), "fnop"},
|
||||
{0, FNOOP, FESC+1+(0xF3<<8), "fpatan"},
|
||||
{0, FNOOP, FESC+1+(0xF8<<8), "fprem"},
|
||||
{0, FNOOP, FESC+1+(0xF2<<8), "fptan"},
|
||||
{0, FNOOP, FESC+1+(0xFC<<8), "frndint"},
|
||||
{0, FNOOP, FESC+1+(0xFD<<8), "fscale"},
|
||||
{0, FNOOP, FESC+1+(0xFA<<8), "fsqrt"},
|
||||
{0, FNOOP, FESC+7+(0xE0<<8), "fstswax"}, /* 80287 */
|
||||
{0, FNOOP, FESC+1+(0xE4<<8), "ftst"},
|
||||
{0, FNOOP, FESC+1+(0xE5<<8), "fxam"},
|
||||
{0, FNOOP, FESC+1+(0xF4<<8), "fxtract"},
|
||||
{0, FNOOP, FESC+1+(0xF1<<8), "fyl2x"},
|
||||
{0, FNOOP, FESC+1+(0xF9<<8), "fyl2pi"},
|
||||
|
||||
0, FMEM, FESC+6+(0<<11), "fiadds",
|
||||
0, FMEM, FESC+2+(0<<11), "fiaddl",
|
||||
0, FMEM, FESC+0+(0<<11), "fadds",
|
||||
0, FMEM, FESC+4+(0<<11), "faddd",
|
||||
0, FMEM, FESC+7+(4<<11), "fbld",
|
||||
0, FMEM, FESC+7+(6<<11), "fbstp",
|
||||
0, FMEM, FESC+6+(2<<11), "ficoms",
|
||||
0, FMEM, FESC+2+(2<<11), "ficoml",
|
||||
0, FMEM, FESC+0+(2<<11), "fcoms",
|
||||
0, FMEM, FESC+4+(2<<11), "fcomd",
|
||||
0, FMEM, FESC+6+(3<<11), "ficomps",
|
||||
0, FMEM, FESC+2+(3<<11), "ficompl",
|
||||
0, FMEM, FESC+0+(3<<11), "fcomps",
|
||||
0, FMEM, FESC+4+(3<<11), "fcompd",
|
||||
0, FMEM, FESC+6+(6<<11), "fidivs",
|
||||
0, FMEM, FESC+2+(6<<11), "fidivl",
|
||||
0, FMEM, FESC+0+(6<<11), "fdivs",
|
||||
0, FMEM, FESC+4+(6<<11), "fdivd",
|
||||
0, FMEM, FESC+6+(7<<11), "fidivrs",
|
||||
0, FMEM, FESC+2+(7<<11), "fidivrl",
|
||||
0, FMEM, FESC+0+(7<<11), "fdivrs",
|
||||
0, FMEM, FESC+4+(7<<11), "fdivrd",
|
||||
0, FMEM, FESC+7+(5<<11), "fildq",
|
||||
0, FMEM, FESC+7+(0<<11), "filds",
|
||||
0, FMEM, FESC+3+(0<<11), "fildl",
|
||||
0, FMEM, FESC+1+(0<<11), "flds",
|
||||
0, FMEM, FESC+5+(0<<11), "fldd",
|
||||
0, FMEM, FESC+3+(5<<11), "fldx",
|
||||
0, FMEM, FESC+1+(5<<11), "fldcw",
|
||||
0, FMEM, FESC+1+(4<<11), "fldenv",
|
||||
0, FMEM, FESC+6+(1<<11), "fimuls",
|
||||
0, FMEM, FESC+2+(1<<11), "fimull",
|
||||
0, FMEM, FESC+0+(1<<11), "fmuls",
|
||||
0, FMEM, FESC+4+(1<<11), "fmuld",
|
||||
0, FMEM, FESC+5+(4<<11), "frstor",
|
||||
0, FMEM, FESC+5+(6<<11), "fsave",
|
||||
0, FMEM, FESC+7+(2<<11), "fists",
|
||||
0, FMEM, FESC+3+(2<<11), "fistl",
|
||||
0, FMEM, FESC+1+(2<<11), "fsts",
|
||||
0, FMEM, FESC+5+(2<<11), "fstd",
|
||||
0, FMEM, FESC+7+(7<<11), "fistpq",
|
||||
0, FMEM, FESC+7+(3<<11), "fistps",
|
||||
0, FMEM, FESC+3+(3<<11), "fistpl",
|
||||
0, FMEM, FESC+1+(3<<11), "fstps",
|
||||
0, FMEM, FESC+5+(3<<11), "fstpd",
|
||||
0, FMEM, FESC+3+(7<<11), "fstpx",
|
||||
0, FMEM, FESC+1+(7<<11), "fstcw",
|
||||
0, FMEM, FESC+1+(6<<11), "fstenv",
|
||||
0, FMEM, FESC+5+(7<<11), "fstsw",
|
||||
0, FMEM, FESC+6+(4<<11), "fisubs",
|
||||
0, FMEM, FESC+2+(4<<11), "fisubl",
|
||||
0, FMEM, FESC+0+(4<<11), "fsubs",
|
||||
0, FMEM, FESC+4+(4<<11), "fsubd",
|
||||
0, FMEM, FESC+6+(5<<11), "fisubrs",
|
||||
0, FMEM, FESC+2+(5<<11), "fisubrl",
|
||||
0, FMEM, FESC+0+(5<<11), "fsubrs",
|
||||
0, FMEM, FESC+4+(5<<11), "fsubrd",
|
||||
{0, FMEM, FESC+6+(0<<11), "fiadds"},
|
||||
{0, FMEM, FESC+2+(0<<11), "fiaddl"},
|
||||
{0, FMEM, FESC+0+(0<<11), "fadds"},
|
||||
{0, FMEM, FESC+4+(0<<11), "faddd"},
|
||||
{0, FMEM, FESC+7+(4<<11), "fbld"},
|
||||
{0, FMEM, FESC+7+(6<<11), "fbstp"},
|
||||
{0, FMEM, FESC+6+(2<<11), "ficoms"},
|
||||
{0, FMEM, FESC+2+(2<<11), "ficoml"},
|
||||
{0, FMEM, FESC+0+(2<<11), "fcoms"},
|
||||
{0, FMEM, FESC+4+(2<<11), "fcomd"},
|
||||
{0, FMEM, FESC+6+(3<<11), "ficomps"},
|
||||
{0, FMEM, FESC+2+(3<<11), "ficompl"},
|
||||
{0, FMEM, FESC+0+(3<<11), "fcomps"},
|
||||
{0, FMEM, FESC+4+(3<<11), "fcompd"},
|
||||
{0, FMEM, FESC+6+(6<<11), "fidivs"},
|
||||
{0, FMEM, FESC+2+(6<<11), "fidivl"},
|
||||
{0, FMEM, FESC+0+(6<<11), "fdivs"},
|
||||
{0, FMEM, FESC+4+(6<<11), "fdivd"},
|
||||
{0, FMEM, FESC+6+(7<<11), "fidivrs"},
|
||||
{0, FMEM, FESC+2+(7<<11), "fidivrl"},
|
||||
{0, FMEM, FESC+0+(7<<11), "fdivrs"},
|
||||
{0, FMEM, FESC+4+(7<<11), "fdivrd"},
|
||||
{0, FMEM, FESC+7+(5<<11), "fildq"},
|
||||
{0, FMEM, FESC+7+(0<<11), "filds"},
|
||||
{0, FMEM, FESC+3+(0<<11), "fildl"},
|
||||
{0, FMEM, FESC+1+(0<<11), "flds"},
|
||||
{0, FMEM, FESC+5+(0<<11), "fldd"},
|
||||
{0, FMEM, FESC+3+(5<<11), "fldx"},
|
||||
{0, FMEM, FESC+1+(5<<11), "fldcw"},
|
||||
{0, FMEM, FESC+1+(4<<11), "fldenv"},
|
||||
{0, FMEM, FESC+6+(1<<11), "fimuls"},
|
||||
{0, FMEM, FESC+2+(1<<11), "fimull"},
|
||||
{0, FMEM, FESC+0+(1<<11), "fmuls"},
|
||||
{0, FMEM, FESC+4+(1<<11), "fmuld"},
|
||||
{0, FMEM, FESC+5+(4<<11), "frstor"},
|
||||
{0, FMEM, FESC+5+(6<<11), "fsave"},
|
||||
{0, FMEM, FESC+7+(2<<11), "fists"},
|
||||
{0, FMEM, FESC+3+(2<<11), "fistl"},
|
||||
{0, FMEM, FESC+1+(2<<11), "fsts"},
|
||||
{0, FMEM, FESC+5+(2<<11), "fstd"},
|
||||
{0, FMEM, FESC+7+(7<<11), "fistpq"},
|
||||
{0, FMEM, FESC+7+(3<<11), "fistps"},
|
||||
{0, FMEM, FESC+3+(3<<11), "fistpl"},
|
||||
{0, FMEM, FESC+1+(3<<11), "fstps"},
|
||||
{0, FMEM, FESC+5+(3<<11), "fstpd"},
|
||||
{0, FMEM, FESC+3+(7<<11), "fstpx"},
|
||||
{0, FMEM, FESC+1+(7<<11), "fstcw"},
|
||||
{0, FMEM, FESC+1+(6<<11), "fstenv"},
|
||||
{0, FMEM, FESC+5+(7<<11), "fstsw"},
|
||||
{0, FMEM, FESC+6+(4<<11), "fisubs"},
|
||||
{0, FMEM, FESC+2+(4<<11), "fisubl"},
|
||||
{0, FMEM, FESC+0+(4<<11), "fsubs"},
|
||||
{0, FMEM, FESC+4+(4<<11), "fsubd"},
|
||||
{0, FMEM, FESC+6+(5<<11), "fisubrs"},
|
||||
{0, FMEM, FESC+2+(5<<11), "fisubrl"},
|
||||
{0, FMEM, FESC+0+(5<<11), "fsubrs"},
|
||||
{0, FMEM, FESC+4+(5<<11), "fsubrd"},
|
||||
|
||||
0, FST_I, FESC+1+(0xC0<<8), "fld",
|
||||
0, FST_I, FESC+5+(0xD0<<8), "fst",
|
||||
0, FST_I, FESC+5+(0xC8<<8), "fstp",
|
||||
0, FST_I, FESC+1+(0xC8<<8), "fxch",
|
||||
0, FST_I, FESC+0+(0xD0<<8), "fcom",
|
||||
0, FST_I, FESC+0+(0xD8<<8), "fcomp",
|
||||
0, FST_I, FESC+5+(0xC0<<8), "ffree",
|
||||
{0, FST_I, FESC+1+(0xC0<<8), "fld"},
|
||||
{0, FST_I, FESC+5+(0xD0<<8), "fst"},
|
||||
{0, FST_I, FESC+5+(0xC8<<8), "fstp"},
|
||||
{0, FST_I, FESC+1+(0xC8<<8), "fxch"},
|
||||
{0, FST_I, FESC+0+(0xD0<<8), "fcom"},
|
||||
{0, FST_I, FESC+0+(0xD8<<8), "fcomp"},
|
||||
{0, FST_I, FESC+5+(0xC0<<8), "ffree"},
|
||||
|
||||
0, FST_ST, FESC+0+(0xC0<<8), "fadd",
|
||||
0, FST_ST, FESC+2+(0xC0<<8), "faddp",
|
||||
0, FST_ST2, FESC+0+(0xF0<<8), "fdiv",
|
||||
0, FST_ST2, FESC+2+(0xF0<<8), "fdivp",
|
||||
0, FST_ST2, FESC+0+(0xF8<<8), "fdivr",
|
||||
0, FST_ST2, FESC+2+(0xF8<<8), "fdivrp",
|
||||
0, FST_ST, FESC+0+(0xC8<<8), "fmul",
|
||||
0, FST_ST, FESC+2+(0xC8<<8), "fmulp",
|
||||
0, FST_ST2, FESC+0+(0xE0<<8), "fsub",
|
||||
0, FST_ST2, FESC+2+(0xE0<<8), "fsubp",
|
||||
0, FST_ST2, FESC+0+(0xE8<<8), "fsubr",
|
||||
0, FST_ST2, FESC+2+(0xE8<<8), "fsubrp",
|
||||
{0, FST_ST, FESC+0+(0xC0<<8), "fadd"},
|
||||
{0, FST_ST, FESC+2+(0xC0<<8), "faddp"},
|
||||
{0, FST_ST2, FESC+0+(0xF0<<8), "fdiv"},
|
||||
{0, FST_ST2, FESC+2+(0xF0<<8), "fdivp"},
|
||||
{0, FST_ST2, FESC+0+(0xF8<<8), "fdivr"},
|
||||
{0, FST_ST2, FESC+2+(0xF8<<8), "fdivrp"},
|
||||
{0, FST_ST, FESC+0+(0xC8<<8), "fmul"},
|
||||
{0, FST_ST, FESC+2+(0xC8<<8), "fmulp"},
|
||||
{0, FST_ST2, FESC+0+(0xE0<<8), "fsub"},
|
||||
{0, FST_ST2, FESC+2+(0xE0<<8), "fsubp"},
|
||||
{0, FST_ST2, FESC+0+(0xE8<<8), "fsubr"},
|
||||
{0, FST_ST2, FESC+2+(0xE8<<8), "fsubrp"},
|
||||
|
||||
/* 80286 keywords */
|
||||
0, NOOP_1, 0140, "pusha",
|
||||
0, NOOP_1, 0141, "popa",
|
||||
0, NOOP_1, 0154, "insb",
|
||||
0, NOOP_1, 0155, "ins",
|
||||
0, NOOP_1, 0155, "insw",
|
||||
0, NOOP_1, 0156, "outsb",
|
||||
0, NOOP_1, 0157, "outs",
|
||||
0, NOOP_1, 0157, "outsw",
|
||||
{0, NOOP_1, 0140, "pusha"},
|
||||
{0, NOOP_1, 0141, "popa"},
|
||||
{0, NOOP_1, 0154, "insb"},
|
||||
{0, NOOP_1, 0155, "ins"},
|
||||
{0, NOOP_1, 0155, "insw"},
|
||||
{0, NOOP_1, 0156, "outsb"},
|
||||
{0, NOOP_1, 0157, "outs"},
|
||||
{0, NOOP_1, 0157, "outsw"},
|
||||
|
||||
0, ARPLOP, 0143, "arpl",
|
||||
0, ENTER, 0310, "enter",
|
||||
0, NOOP_1, 0311, "leave",
|
||||
0, LEAOP, 0142, "bound",
|
||||
{0, ARPLOP, 0143, "arpl"},
|
||||
{0, ENTER, 0310, "enter"},
|
||||
{0, NOOP_1, 0311, "leave"},
|
||||
{0, LEAOP, 0142, "bound"},
|
||||
|
||||
0, NOOP_2, 017+06<<8, "clts",
|
||||
{0, NOOP_2, 017+06<<8, "clts"},
|
||||
|
||||
0, EXTOP, 0002, "lar",
|
||||
0, EXTOP, 0003, "lsl",
|
||||
{0, EXTOP, 0002, "lar"},
|
||||
{0, EXTOP, 0003, "lsl"},
|
||||
|
||||
0, EXTOP1, 0021, "lgdt",
|
||||
0, EXTOP1, 0001, "sgdt",
|
||||
0, EXTOP1, 0031, "lidt",
|
||||
0, EXTOP1, 0011, "sidt",
|
||||
0, EXTOP1, 0020, "lldt",
|
||||
0, EXTOP1, 0000, "sldt",
|
||||
0, EXTOP1, 0030, "ltr",
|
||||
0, EXTOP1, 0010, "str",
|
||||
0, EXTOP1, 0061, "lmsw",
|
||||
0, EXTOP1, 0041, "smsw",
|
||||
0, EXTOP1, 0050, "verw",
|
||||
0, EXTOP1, 0040, "verr",
|
||||
{0, EXTOP1, 0021, "lgdt"},
|
||||
{0, EXTOP1, 0001, "sgdt"},
|
||||
{0, EXTOP1, 0031, "lidt"},
|
||||
{0, EXTOP1, 0011, "sidt"},
|
||||
{0, EXTOP1, 0020, "lldt"},
|
||||
{0, EXTOP1, 0000, "sldt"},
|
||||
{0, EXTOP1, 0030, "ltr"},
|
||||
{0, EXTOP1, 0010, "str"},
|
||||
{0, EXTOP1, 0061, "lmsw"},
|
||||
{0, EXTOP1, 0041, "smsw"},
|
||||
{0, EXTOP1, 0050, "verw"},
|
||||
{0, EXTOP1, 0040, "verr"},
|
||||
|
|
|
@ -8,7 +8,8 @@
|
|||
* INTEL 8086 special routines
|
||||
*/
|
||||
|
||||
ea_1(param) {
|
||||
void ea_1(int param)
|
||||
{
|
||||
|
||||
if ((mrg_1 & 070) || (param & ~070)) {
|
||||
serror("bad operand");
|
||||
|
@ -41,7 +42,7 @@ ea_1(param) {
|
|||
}
|
||||
}
|
||||
|
||||
ea_2(param) {
|
||||
void ea_2(int param) {
|
||||
|
||||
mrg_1 = mrg_2;
|
||||
exp_1 = exp_2;
|
||||
|
@ -49,8 +50,10 @@ ea_2(param) {
|
|||
ea_1(param);
|
||||
}
|
||||
|
||||
reverse() {
|
||||
register m, r; expr_t e;
|
||||
void reverse(void)
|
||||
{
|
||||
register int m, r;
|
||||
expr_t e;
|
||||
|
||||
m = mrg_1; mrg_1 = mrg_2; mrg_2 = m;
|
||||
e = exp_1; exp_1 = exp_2; exp_2 = e;
|
||||
|
@ -59,13 +62,15 @@ reverse() {
|
|||
#endif
|
||||
}
|
||||
|
||||
badsyntax() {
|
||||
void badsyntax(void)
|
||||
{
|
||||
|
||||
serror("bad operands");
|
||||
}
|
||||
|
||||
regsize(sz) register sz; {
|
||||
register bit;
|
||||
void regsize(register int sz)
|
||||
{
|
||||
register int bit;
|
||||
|
||||
sz <<= 3;
|
||||
bit = 010;
|
||||
|
@ -77,7 +82,8 @@ regsize(sz) register sz; {
|
|||
mrg_2 &= ~bit;
|
||||
}
|
||||
|
||||
indexed() {
|
||||
void indexed(void)
|
||||
{
|
||||
int sm1, sm2;
|
||||
|
||||
if (mrg_2 & ~7)
|
||||
|
@ -98,8 +104,9 @@ indexed() {
|
|||
}
|
||||
}
|
||||
|
||||
branch(opc,exp) register opc; expr_t exp; {
|
||||
register sm,dist;
|
||||
void branch(register int opc,expr_t exp)
|
||||
{
|
||||
register int sm,dist;
|
||||
int saving = opc == 0353 ? 1 : 3;
|
||||
|
||||
dist = exp.val - (DOTVAL + 2);
|
||||
|
@ -132,7 +139,8 @@ branch(opc,exp) register opc; expr_t exp; {
|
|||
emit1(dist);
|
||||
}
|
||||
|
||||
pushop(opc) register opc; {
|
||||
void pushop(register int opc)
|
||||
{
|
||||
|
||||
regsize(1);
|
||||
if (mrg_1 & 020) {
|
||||
|
@ -161,8 +169,8 @@ pushop(opc) register opc; {
|
|||
}
|
||||
}
|
||||
|
||||
addop(opc) register opc; {
|
||||
|
||||
void addop(register int opc)
|
||||
{
|
||||
regsize(opc);
|
||||
if (mrg_2 >= 0300) {
|
||||
emit1(opc); ea_1((mrg_2&7)<<3);
|
||||
|
@ -197,8 +205,9 @@ addop(opc) register opc; {
|
|||
badsyntax();
|
||||
}
|
||||
|
||||
rolop(opc) register opc; {
|
||||
register cmrg;
|
||||
void rolop(register int opc)
|
||||
{
|
||||
register int cmrg;
|
||||
|
||||
cmrg = mrg_2;
|
||||
mrg_2 = mrg_1;
|
||||
|
@ -217,7 +226,8 @@ rolop(opc) register opc; {
|
|||
badsyntax();
|
||||
}
|
||||
|
||||
incop(opc) register opc; {
|
||||
void incop(register int opc)
|
||||
{
|
||||
|
||||
regsize(opc);
|
||||
if ((opc&1) && mrg_1>=0300) {
|
||||
|
@ -228,8 +238,8 @@ incop(opc) register opc; {
|
|||
}
|
||||
}
|
||||
|
||||
callop(opc) register opc; {
|
||||
|
||||
void callop(register int opc)
|
||||
{
|
||||
regsize(1);
|
||||
if (mrg_1 & 040) {
|
||||
if (opc == (040+(0351<<8))) {
|
||||
|
@ -249,8 +259,8 @@ callop(opc) register opc; {
|
|||
}
|
||||
}
|
||||
|
||||
xchg(opc) register opc; {
|
||||
|
||||
void xchg(register int opc)
|
||||
{
|
||||
regsize(opc);
|
||||
if (mrg_2 == 0300 || mrg_1 < 0300)
|
||||
reverse();
|
||||
|
@ -262,8 +272,8 @@ xchg(opc) register opc; {
|
|||
badsyntax();
|
||||
}
|
||||
|
||||
test(opc) register opc; {
|
||||
|
||||
void test(register int opc)
|
||||
{
|
||||
regsize(opc);
|
||||
if ((mrg_1 & 040) || mrg_2 >= 0300)
|
||||
reverse();
|
||||
|
@ -288,8 +298,8 @@ test(opc) register opc; {
|
|||
badsyntax();
|
||||
}
|
||||
|
||||
mov(opc) register opc; {
|
||||
|
||||
void mov(register int opc)
|
||||
{
|
||||
regsize(opc);
|
||||
if (mrg_1 & 020) {
|
||||
emit1(0216); ea_2((mrg_1&3)<<3);
|
||||
|
@ -334,8 +344,7 @@ mov(opc) register opc; {
|
|||
}
|
||||
}
|
||||
|
||||
imul(opc)
|
||||
int opc;
|
||||
void imul(int opc)
|
||||
{
|
||||
regsize(opc);
|
||||
if (exp_2.typ != S_ABS || ((mrg_2 & 040) == 0)) {
|
||||
|
|
|
@ -119,3 +119,44 @@ short eamode[] = {
|
|||
* '(expression).w', which still have to be relocatable.
|
||||
*/
|
||||
#endif
|
||||
|
||||
/* 680x0 specific routines */
|
||||
void emit_instr(void);
|
||||
|
||||
#ifdef RELOCATION
|
||||
void t_emit2(short word, short relotype, int reloinfo, valu_t relnm);
|
||||
#else
|
||||
void t_emit2(short word);
|
||||
#endif
|
||||
|
||||
#ifdef RELOCATION
|
||||
void t_emit4(long words, short relotype, int reloinfo, valu_t relnm);
|
||||
#else
|
||||
void t_emit4(long words);
|
||||
#endif
|
||||
|
||||
void ea_1(int sz, int bits);
|
||||
void ea_2(int sz, int bits);
|
||||
void checksize(int sz, int bits);
|
||||
void check_fsize(int sz, int size);
|
||||
void ch_sz_dreg(int size, int mode);
|
||||
int checkscale(valu_t val);
|
||||
void badoperand(void);
|
||||
void shift_op(int opc, int sz);
|
||||
void bitop(int opc);
|
||||
void bitfield(int opc, int extension);
|
||||
void add(int opc, int sz);
|
||||
void and(int opc, int sz);
|
||||
int to_dreg(int opc, int sz, int bits);
|
||||
int from_dreg(int opc, int sz, int bits);
|
||||
void cmp(int sz);
|
||||
void link_instr(int sz, int areg);
|
||||
void move(int sz);
|
||||
void move_special(int sz);
|
||||
void movem(int dr, int sz, int regs);
|
||||
int reverse(register int regs, int max);
|
||||
void movep(int sz);
|
||||
void branch(int opc, expr_t exp);
|
||||
void cpbcc(int opc, expr_t exp);
|
||||
void ea7071(int sz);
|
||||
void fbranch(int opc, expr_t exp);
|
||||
|
|
|
@ -7,460 +7,460 @@
|
|||
* Motorola 68020 keywords
|
||||
*/
|
||||
|
||||
0, SIZE, SIZE_B, ".b",
|
||||
0, SIZE, SIZE_W, ".w",
|
||||
0, SIZE, SIZE_L, ".l",
|
||||
{0, SIZE, SIZE_B, ".b"},
|
||||
{0, SIZE, SIZE_W, ".w"},
|
||||
{0, SIZE, SIZE_L, ".l"},
|
||||
|
||||
0, DREG, 00, "d0",
|
||||
0, DREG, 01, "d1",
|
||||
0, DREG, 02, "d2",
|
||||
0, DREG, 03, "d3",
|
||||
0, DREG, 04, "d4",
|
||||
0, DREG, 05, "d5",
|
||||
0, DREG, 06, "d6",
|
||||
0, DREG, 07, "d7",
|
||||
{0, DREG, 00, "d0"},
|
||||
{0, DREG, 01, "d1"},
|
||||
{0, DREG, 02, "d2"},
|
||||
{0, DREG, 03, "d3"},
|
||||
{0, DREG, 04, "d4"},
|
||||
{0, DREG, 05, "d5"},
|
||||
{0, DREG, 06, "d6"},
|
||||
{0, DREG, 07, "d7"},
|
||||
|
||||
0, AREG, 00, "a0",
|
||||
0, AREG, 01, "a1",
|
||||
0, AREG, 02, "a2",
|
||||
0, AREG, 03, "a3",
|
||||
0, AREG, 04, "a4",
|
||||
0, AREG, 05, "a5",
|
||||
0, AREG, 06, "a6",
|
||||
0, AREG, 07, "a7",
|
||||
0, AREG, 07, "sp",
|
||||
{0, AREG, 00, "a0"},
|
||||
{0, AREG, 01, "a1"},
|
||||
{0, AREG, 02, "a2"},
|
||||
{0, AREG, 03, "a3"},
|
||||
{0, AREG, 04, "a4"},
|
||||
{0, AREG, 05, "a5"},
|
||||
{0, AREG, 06, "a6"},
|
||||
{0, AREG, 07, "a7"},
|
||||
{0, AREG, 07, "sp"},
|
||||
|
||||
0, PC, 0, "pc",
|
||||
0, PC, 0200, "zpc",
|
||||
{0, PC, 0, "pc"},
|
||||
{0, PC, 0200, "zpc"},
|
||||
|
||||
0, CREG, 04001, "vbr",
|
||||
0, CREG, 0, "sfc",
|
||||
0, CREG, 00001, "dfc",
|
||||
0, CREG, 00002, "cacr",
|
||||
0, CREG, 04002, "caar",
|
||||
0, CREG, 04003, "msp",
|
||||
0, CREG, 04004, "isp",
|
||||
{0, CREG, 04001, "vbr"},
|
||||
{0, CREG, 0, "sfc"},
|
||||
{0, CREG, 00001, "dfc"},
|
||||
{0, CREG, 00002, "cacr"},
|
||||
{0, CREG, 04002, "caar"},
|
||||
{0, CREG, 04003, "msp"},
|
||||
{0, CREG, 04004, "isp"},
|
||||
|
||||
0, SPEC, 075, "usp",
|
||||
0, SPEC, 076, "ccr",
|
||||
0, SPEC, 077, "sr",
|
||||
{0, SPEC, 075, "usp"},
|
||||
{0, SPEC, 076, "ccr"},
|
||||
{0, SPEC, 077, "sr"},
|
||||
|
||||
0, ABCD, 0140400, "abcd",
|
||||
0, ABCD, 0100400, "sbcd",
|
||||
{0, ABCD, 0140400, "abcd"},
|
||||
{0, ABCD, 0100400, "sbcd"},
|
||||
|
||||
0, ADDX, 0150400, "addx",
|
||||
0, ADDX, 0110400, "subx",
|
||||
{0, ADDX, 0150400, "addx"},
|
||||
{0, ADDX, 0110400, "subx"},
|
||||
|
||||
0, ADD, 0153300, "add",
|
||||
0, ADD, 0112700, "sub",
|
||||
{0, ADD, 0153300, "add"},
|
||||
{0, ADD, 0112700, "sub"},
|
||||
|
||||
0, AND, 0141000, "and",
|
||||
0, AND, 0135000, "eor",
|
||||
0, AND, 0100000, "or",
|
||||
{0, AND, 0141000, "and"},
|
||||
{0, AND, 0135000, "eor"},
|
||||
{0, AND, 0100000, "or"},
|
||||
|
||||
0, BITOP, 0000, "btst",
|
||||
0, BITOP, 0100, "bchg",
|
||||
0, BITOP, 0200, "bclr",
|
||||
0, BITOP, 0300, "bset",
|
||||
{0, BITOP, 0000, "btst"},
|
||||
{0, BITOP, 0100, "bchg"},
|
||||
{0, BITOP, 0200, "bclr"},
|
||||
{0, BITOP, 0300, "bset"},
|
||||
|
||||
0, BITFIELD, 0164300, "bftst",
|
||||
0, BITFIELD, 0165300, "bfchg",
|
||||
0, BITFIELD, 0166300, "bfclr",
|
||||
0, BITFIELD, 0167300, "bfset",
|
||||
0, BF_TO_D, 0164700, "bfextu",
|
||||
0, BF_TO_D, 0164700, "bfexts",
|
||||
0, BF_TO_D, 0164700, "bfffo",
|
||||
0, BFINS, 0167700, "bfins",
|
||||
{0, BITFIELD, 0164300, "bftst"},
|
||||
{0, BITFIELD, 0165300, "bfchg"},
|
||||
{0, BITFIELD, 0166300, "bfclr"},
|
||||
{0, BITFIELD, 0167300, "bfset"},
|
||||
{0, BF_TO_D, 0164700, "bfextu"},
|
||||
{0, BF_TO_D, 0164700, "bfexts"},
|
||||
{0, BF_TO_D, 0164700, "bfffo"},
|
||||
{0, BFINS, 0167700, "bfins"},
|
||||
|
||||
0, SHIFT, 0160340, "asr",
|
||||
0, SHIFT, 0160740, "asl",
|
||||
0, SHIFT, 0161350, "lsr",
|
||||
0, SHIFT, 0161750, "lsl",
|
||||
0, SHIFT, 0162360, "roxr",
|
||||
0, SHIFT, 0162760, "roxl",
|
||||
0, SHIFT, 0163370, "ror",
|
||||
0, SHIFT, 0163770, "rol",
|
||||
{0, SHIFT, 0160340, "asr"},
|
||||
{0, SHIFT, 0160740, "asl"},
|
||||
{0, SHIFT, 0161350, "lsr"},
|
||||
{0, SHIFT, 0161750, "lsl"},
|
||||
{0, SHIFT, 0162360, "roxr"},
|
||||
{0, SHIFT, 0162760, "roxl"},
|
||||
{0, SHIFT, 0163370, "ror"},
|
||||
{0, SHIFT, 0163770, "rol"},
|
||||
|
||||
0, SZ_EA, 041000|DTA|ALT, "clr",
|
||||
0, SZ_EA, 042000|DTA|ALT, "neg",
|
||||
0, SZ_EA, 040000|DTA|ALT, "negx",
|
||||
0, SZ_EA, 043000|DTA|ALT, "not",
|
||||
0, SZ_EA, 045000, "tst",
|
||||
{0, SZ_EA, 041000|DTA|ALT, "clr"},
|
||||
{0, SZ_EA, 042000|DTA|ALT, "neg"},
|
||||
{0, SZ_EA, 040000|DTA|ALT, "negx"},
|
||||
{0, SZ_EA, 043000|DTA|ALT, "not"},
|
||||
{0, SZ_EA, 045000, "tst"},
|
||||
|
||||
0, OP_EA, 044000|DTA|ALT, "nbcd",
|
||||
0, OP_EA, 045300|DTA|ALT, "tas",
|
||||
0, OP_EA, 047200|CTR, "jsr",
|
||||
0, OP_EA, 047300|CTR, "jmp",
|
||||
0, OP_EA, 044100|CTR, "pea",
|
||||
{0, OP_EA, 044000|DTA|ALT, "nbcd"},
|
||||
{0, OP_EA, 045300|DTA|ALT, "tas"},
|
||||
{0, OP_EA, 047200|CTR, "jsr"},
|
||||
{0, OP_EA, 047300|CTR, "jmp"},
|
||||
{0, OP_EA, 044100|CTR, "pea"},
|
||||
|
||||
0, OP_EA, 050300, "st",
|
||||
0, OP_EA, 050700, "sf",
|
||||
0, OP_EA, 051300, "shi",
|
||||
0, OP_EA, 051700, "sls",
|
||||
0, OP_EA, 052300, "scc",
|
||||
0, OP_EA, 052700, "scs",
|
||||
0, OP_EA, 053300, "sne",
|
||||
0, OP_EA, 053700, "seq",
|
||||
0, OP_EA, 054300, "svc",
|
||||
0, OP_EA, 054700, "svs",
|
||||
0, OP_EA, 055300, "spl",
|
||||
0, OP_EA, 055700, "smi",
|
||||
0, OP_EA, 056300, "sge",
|
||||
0, OP_EA, 056700, "slt",
|
||||
0, OP_EA, 057300, "sgt",
|
||||
0, OP_EA, 057700, "sle",
|
||||
{0, OP_EA, 050300, "st"},
|
||||
{0, OP_EA, 050700, "sf"},
|
||||
{0, OP_EA, 051300, "shi"},
|
||||
{0, OP_EA, 051700, "sls"},
|
||||
{0, OP_EA, 052300, "scc"},
|
||||
{0, OP_EA, 052700, "scs"},
|
||||
{0, OP_EA, 053300, "sne"},
|
||||
{0, OP_EA, 053700, "seq"},
|
||||
{0, OP_EA, 054300, "svc"},
|
||||
{0, OP_EA, 054700, "svs"},
|
||||
{0, OP_EA, 055300, "spl"},
|
||||
{0, OP_EA, 055700, "smi"},
|
||||
{0, OP_EA, 056300, "sge"},
|
||||
{0, OP_EA, 056700, "slt"},
|
||||
{0, OP_EA, 057300, "sgt"},
|
||||
{0, OP_EA, 057700, "sle"},
|
||||
|
||||
0, OP_NOOP, 047160, "reset",
|
||||
0, OP_NOOP, 047161, "nop",
|
||||
0, OP_NOOP, 047163, "rte",
|
||||
0, OP_NOOP, 047165, "rts",
|
||||
0, OP_NOOP, 047166, "trapv",
|
||||
0, OP_NOOP, 047167, "rtr",
|
||||
0, OP_NOOP, 045374, "illegal",
|
||||
{0, OP_NOOP, 047160, "reset"},
|
||||
{0, OP_NOOP, 047161, "nop"},
|
||||
{0, OP_NOOP, 047163, "rte"},
|
||||
{0, OP_NOOP, 047165, "rts"},
|
||||
{0, OP_NOOP, 047166, "trapv"},
|
||||
{0, OP_NOOP, 047167, "rtr"},
|
||||
{0, OP_NOOP, 045374, "illegal"},
|
||||
|
||||
0, PACK, 0100500, "pack",
|
||||
0, PACK, 0100600, "unpk",
|
||||
{0, PACK, 0100500, "pack"},
|
||||
{0, PACK, 0100600, "unpk"},
|
||||
|
||||
0, DIVMUL, 0100, "divu",
|
||||
0, DIVMUL, 0101, "divs",
|
||||
0, DIVMUL, 0000, "mulu",
|
||||
0, DIVMUL, 0001, "muls",
|
||||
{0, DIVMUL, 0100, "divu"},
|
||||
{0, DIVMUL, 0101, "divs"},
|
||||
{0, DIVMUL, 0000, "mulu"},
|
||||
{0, DIVMUL, 0001, "muls"},
|
||||
|
||||
0, DIVL, 046100, "divul",
|
||||
0, DIVL, 046101, "divsl",
|
||||
{0, DIVL, 046100, "divul"},
|
||||
{0, DIVL, 046101, "divsl"},
|
||||
|
||||
0, BR, 060000, "bra",
|
||||
0, BR, 060400, "bsr",
|
||||
0, BR, 061000, "bhi",
|
||||
0, BR, 061400, "bls",
|
||||
0, BR, 062000, "bcc",
|
||||
0, BR, 062400, "bcs",
|
||||
0, BR, 063000, "bne",
|
||||
0, BR, 063400, "beq",
|
||||
0, BR, 064000, "bvc",
|
||||
0, BR, 064400, "bvs",
|
||||
0, BR, 065000, "bpl",
|
||||
0, BR, 065400, "bmi",
|
||||
0, BR, 066000, "bge",
|
||||
0, BR, 066400, "blt",
|
||||
0, BR, 067000, "bgt",
|
||||
0, BR, 067400, "ble",
|
||||
{0, BR, 060000, "bra"},
|
||||
{0, BR, 060400, "bsr"},
|
||||
{0, BR, 061000, "bhi"},
|
||||
{0, BR, 061400, "bls"},
|
||||
{0, BR, 062000, "bcc"},
|
||||
{0, BR, 062400, "bcs"},
|
||||
{0, BR, 063000, "bne"},
|
||||
{0, BR, 063400, "beq"},
|
||||
{0, BR, 064000, "bvc"},
|
||||
{0, BR, 064400, "bvs"},
|
||||
{0, BR, 065000, "bpl"},
|
||||
{0, BR, 065400, "bmi"},
|
||||
{0, BR, 066000, "bge"},
|
||||
{0, BR, 066400, "blt"},
|
||||
{0, BR, 067000, "bgt"},
|
||||
{0, BR, 067400, "ble"},
|
||||
|
||||
0, DBR, 050310, "dbt",
|
||||
0, DBR, 050710, "dbf",
|
||||
0, DBR, 050710, "dbra",
|
||||
0, DBR, 051310, "dbhi",
|
||||
0, DBR, 051710, "dbls",
|
||||
0, DBR, 052310, "dbcc",
|
||||
0, DBR, 052710, "dbcs",
|
||||
0, DBR, 053310, "dbne",
|
||||
0, DBR, 053710, "dbeq",
|
||||
0, DBR, 054310, "dbvc",
|
||||
0, DBR, 054710, "dbvs",
|
||||
0, DBR, 055310, "dbpl",
|
||||
0, DBR, 055710, "dbmi",
|
||||
0, DBR, 056310, "dbge",
|
||||
0, DBR, 056710, "dblt",
|
||||
0, DBR, 057310, "dbgt",
|
||||
0, DBR, 057710, "dble",
|
||||
{0, DBR, 050310, "dbt"},
|
||||
{0, DBR, 050710, "dbf"},
|
||||
{0, DBR, 050710, "dbra"},
|
||||
{0, DBR, 051310, "dbhi"},
|
||||
{0, DBR, 051710, "dbls"},
|
||||
{0, DBR, 052310, "dbcc"},
|
||||
{0, DBR, 052710, "dbcs"},
|
||||
{0, DBR, 053310, "dbne"},
|
||||
{0, DBR, 053710, "dbeq"},
|
||||
{0, DBR, 054310, "dbvc"},
|
||||
{0, DBR, 054710, "dbvs"},
|
||||
{0, DBR, 055310, "dbpl"},
|
||||
{0, DBR, 055710, "dbmi"},
|
||||
{0, DBR, 056310, "dbge"},
|
||||
{0, DBR, 056710, "dblt"},
|
||||
{0, DBR, 057310, "dbgt"},
|
||||
{0, DBR, 057710, "dble"},
|
||||
|
||||
0, OP_EXT, 044000, "ext",
|
||||
0, OP_EXT, 044400, "extb",
|
||||
{0, OP_EXT, 044000, "ext"},
|
||||
{0, OP_EXT, 044400, "extb"},
|
||||
|
||||
0, OP_RANGE, 04000, "chk2",
|
||||
0, OP_RANGE, 0, "cmp2",
|
||||
{0, OP_RANGE, 04000, "chk2"},
|
||||
{0, OP_RANGE, 0, "cmp2"},
|
||||
|
||||
0, TRAPCC, 050370, "trapt",
|
||||
0, TRAPCC, 050770, "trapf",
|
||||
0, TRAPCC, 051370, "traphi",
|
||||
0, TRAPCC, 051770, "trapls",
|
||||
0, TRAPCC, 052370, "trapcc",
|
||||
0, TRAPCC, 052770, "trapcs",
|
||||
0, TRAPCC, 053370, "trapeq",
|
||||
0, TRAPCC, 053770, "trapvc",
|
||||
0, TRAPCC, 054370, "trapvs",
|
||||
0, TRAPCC, 054770, "trappl",
|
||||
0, TRAPCC, 055370, "trapmi",
|
||||
0, TRAPCC, 055770, "trapge",
|
||||
0, TRAPCC, 056370, "traplt",
|
||||
0, TRAPCC, 056770, "trapgt",
|
||||
0, TRAPCC, 057370, "traple",
|
||||
0, TRAPCC, 057770, "trapne",
|
||||
{0, TRAPCC, 050370, "trapt"},
|
||||
{0, TRAPCC, 050770, "trapf"},
|
||||
{0, TRAPCC, 051370, "traphi"},
|
||||
{0, TRAPCC, 051770, "trapls"},
|
||||
{0, TRAPCC, 052370, "trapcc"},
|
||||
{0, TRAPCC, 052770, "trapcs"},
|
||||
{0, TRAPCC, 053370, "trapeq"},
|
||||
{0, TRAPCC, 053770, "trapvc"},
|
||||
{0, TRAPCC, 054370, "trapvs"},
|
||||
{0, TRAPCC, 054770, "trappl"},
|
||||
{0, TRAPCC, 055370, "trapmi"},
|
||||
{0, TRAPCC, 055770, "trapge"},
|
||||
{0, TRAPCC, 056370, "traplt"},
|
||||
{0, TRAPCC, 056770, "trapgt"},
|
||||
{0, TRAPCC, 057370, "traple"},
|
||||
{0, TRAPCC, 057770, "trapne"},
|
||||
|
||||
0, CMP, 0, "cmp",
|
||||
{0, CMP, 0, "cmp"},
|
||||
|
||||
0, MOVE, 0, "move",
|
||||
0, MOVESP, 0, "movep",
|
||||
0, MOVEM, 0, "movem",
|
||||
0, MOVESP, 1, "moves",
|
||||
0, MOVEC, 0, "movec",
|
||||
{0, MOVE, 0, "move"},
|
||||
{0, MOVESP, 0, "movep"},
|
||||
{0, MOVEM, 0, "movem"},
|
||||
{0, MOVESP, 1, "moves"},
|
||||
{0, MOVEC, 0, "movec"},
|
||||
|
||||
0, SWAP, 0, "swap",
|
||||
{0, SWAP, 0, "swap"},
|
||||
|
||||
0, LINK, 0, "link",
|
||||
{0, LINK, 0, "link"},
|
||||
|
||||
0, UNLK, 0, "unlk",
|
||||
{0, UNLK, 0, "unlk"},
|
||||
|
||||
0, TRAP, 0, "trap",
|
||||
{0, TRAP, 0, "trap"},
|
||||
|
||||
0, OP_IMM, 047162, "stop",
|
||||
{0, OP_IMM, 047162, "stop"},
|
||||
|
||||
0, CHK, 0, "chk",
|
||||
{0, CHK, 0, "chk"},
|
||||
|
||||
0, RTM, 0, "rtm",
|
||||
{0, RTM, 0, "rtm"},
|
||||
|
||||
0, EXG, 0, "exg",
|
||||
{0, EXG, 0, "exg"},
|
||||
|
||||
0, LEA, 0, "lea",
|
||||
{0, LEA, 0, "lea"},
|
||||
|
||||
0, OP_IMM, 047164, "rtd",
|
||||
{0, OP_IMM, 047164, "rtd"},
|
||||
|
||||
0, BKPT, 0, "bkpt",
|
||||
{0, BKPT, 0, "bkpt"},
|
||||
|
||||
0, CALLM, 0, "callm",
|
||||
{0, CALLM, 0, "callm"},
|
||||
|
||||
0, CAS, 0, "cas",
|
||||
{0, CAS, 0, "cas"},
|
||||
|
||||
0, CAS2, 0, "cas2",
|
||||
{0, CAS2, 0, "cas2"},
|
||||
|
||||
0, CP, 00000, "c0",
|
||||
0, CP, 01000, "c1",
|
||||
0, CP, 02000, "c2",
|
||||
0, CP, 03000, "c3",
|
||||
0, CP, 04000, "c4",
|
||||
0, CP, 05000, "c5",
|
||||
0, CP, 06000, "c6",
|
||||
0, CP, 07000, "c7",
|
||||
{0, CP, 00000, "c0"},
|
||||
{0, CP, 01000, "c1"},
|
||||
{0, CP, 02000, "c2"},
|
||||
{0, CP, 03000, "c3"},
|
||||
{0, CP, 04000, "c4"},
|
||||
{0, CP, 05000, "c5"},
|
||||
{0, CP, 06000, "c6"},
|
||||
{0, CP, 07000, "c7"},
|
||||
|
||||
/* ???? what is this ???? */
|
||||
0, CPGEN, 0170000, ".gen",
|
||||
0, CPSCC, 0170100, ".s",
|
||||
0, CPDBCC, 0170110, ".db",
|
||||
0, CPTRAPCC, 0170170, ".trap",
|
||||
0, CPBCC, 0170200, ".br", /* 'r' to distinguish from SIZE_B
|
||||
{0, CPGEN, 0170000, ".gen"},
|
||||
{0, CPSCC, 0170100, ".s"},
|
||||
{0, CPDBCC, 0170110, ".db"},
|
||||
{0, CPTRAPCC, 0170170, ".trap"},
|
||||
{0, CPBCC, 0170200, ".br"}, /* 'r' to distinguish from SIZE_B
|
||||
*/
|
||||
0, CPSAVREST, 0170400, ".save",
|
||||
0, CPSAVREST, 0170500, ".restore",
|
||||
{0, CPSAVREST, 0170400, ".save"},
|
||||
{0, CPSAVREST, 0170500, ".restore"},
|
||||
/* ???? end of what is this ???? */
|
||||
|
||||
/* M68030 MMU registers */
|
||||
0, MREG, 0040000, "tc",
|
||||
0, MREG, 0044000, "srp",
|
||||
0, MREG, 0046000, "crp",
|
||||
0, MREG, 0060000, "mmusr",
|
||||
0, MREG, 0060000, "psr",
|
||||
0, MREG, 0004000, "tt0",
|
||||
0, MREG, 0006000, "tt1",
|
||||
{0, MREG, 0040000, "tc"},
|
||||
{0, MREG, 0044000, "srp"},
|
||||
{0, MREG, 0046000, "crp"},
|
||||
{0, MREG, 0060000, "mmusr"},
|
||||
{0, MREG, 0060000, "psr"},
|
||||
{0, MREG, 0004000, "tt0"},
|
||||
{0, MREG, 0006000, "tt1"},
|
||||
|
||||
/* M68030 MMU instructions */
|
||||
|
||||
0, PFLUSHA, 0022000, "pflusha",
|
||||
0, PFLUSH, 0020000, "pflush",
|
||||
0, PLOAD, 0021000, "ploadr",
|
||||
0, PLOAD, 0020000, "ploadw",
|
||||
0, PTEST, 0101000, "ptestr",
|
||||
0, PTEST, 0100000, "ptestw",
|
||||
0, PMOVE, 0000000, "pmove",
|
||||
0, PMOVE, 0000400, "pmovefd",
|
||||
{0, PFLUSHA, 0022000, "pflusha"},
|
||||
{0, PFLUSH, 0020000, "pflush"},
|
||||
{0, PLOAD, 0021000, "ploadr"},
|
||||
{0, PLOAD, 0020000, "ploadw"},
|
||||
{0, PTEST, 0101000, "ptestr"},
|
||||
{0, PTEST, 0100000, "ptestw"},
|
||||
{0, PMOVE, 0000000, "pmove"},
|
||||
{0, PMOVE, 0000400, "pmovefd"},
|
||||
|
||||
/* floating point coprocessor ... */
|
||||
|
||||
0, FSIZE, FSIZE_S, ".s",
|
||||
0, FSIZE, FSIZE_X, ".x",
|
||||
0, FSIZE, FSIZE_P, ".p",
|
||||
0, FSIZE, FSIZE_D, ".d",
|
||||
{0, FSIZE, FSIZE_S, ".s"},
|
||||
{0, FSIZE, FSIZE_X, ".x"},
|
||||
{0, FSIZE, FSIZE_P, ".p"},
|
||||
{0, FSIZE, FSIZE_D, ".d"},
|
||||
|
||||
0, FPREG, 0, "fp0",
|
||||
0, FPREG, 1, "fp1",
|
||||
0, FPREG, 2, "fp2",
|
||||
0, FPREG, 3, "fp3",
|
||||
0, FPREG, 4, "fp4",
|
||||
0, FPREG, 5, "fp5",
|
||||
0, FPREG, 6, "fp6",
|
||||
0, FPREG, 7, "fp7",
|
||||
{0, FPREG, 0, "fp0"},
|
||||
{0, FPREG, 1, "fp1"},
|
||||
{0, FPREG, 2, "fp2"},
|
||||
{0, FPREG, 3, "fp3"},
|
||||
{0, FPREG, 4, "fp4"},
|
||||
{0, FPREG, 5, "fp5"},
|
||||
{0, FPREG, 6, "fp6"},
|
||||
{0, FPREG, 7, "fp7"},
|
||||
|
||||
0, FPCR, 1, "fpiar",
|
||||
0, FPCR, 2, "fpsr",
|
||||
0, FPCR, 4, "fpcr",
|
||||
{0, FPCR, 1, "fpiar"},
|
||||
{0, FPCR, 2, "fpsr"},
|
||||
{0, FPCR, 4, "fpcr"},
|
||||
|
||||
0, FMOVE, 0, "fmove",
|
||||
0, FMOVECR, 0, "fmovecr",
|
||||
0, FMOVEM, 0, "fmovem",
|
||||
{0, FMOVE, 0, "fmove"},
|
||||
{0, FMOVECR, 0, "fmovecr"},
|
||||
{0, FMOVEM, 0, "fmovem"},
|
||||
|
||||
0, FDYADIC, 042, "fadd",
|
||||
0, FDYADIC, 070, "fcmp",
|
||||
0, FDYADIC, 040, "fdiv",
|
||||
0, FDYADIC, 041, "fmod",
|
||||
0, FDYADIC, 043, "fmul",
|
||||
0, FDYADIC, 045, "frem",
|
||||
0, FDYADIC, 046, "fscale",
|
||||
0, FDYADIC, 044, "fsgldiv",
|
||||
0, FDYADIC, 047, "fsglmul",
|
||||
0, FDYADIC, 050, "fsub",
|
||||
{0, FDYADIC, 042, "fadd"},
|
||||
{0, FDYADIC, 070, "fcmp"},
|
||||
{0, FDYADIC, 040, "fdiv"},
|
||||
{0, FDYADIC, 041, "fmod"},
|
||||
{0, FDYADIC, 043, "fmul"},
|
||||
{0, FDYADIC, 045, "frem"},
|
||||
{0, FDYADIC, 046, "fscale"},
|
||||
{0, FDYADIC, 044, "fsgldiv"},
|
||||
{0, FDYADIC, 047, "fsglmul"},
|
||||
{0, FDYADIC, 050, "fsub"},
|
||||
|
||||
0, FMONADIC, 030, "fabs",
|
||||
0, FMONADIC, 034, "facos",
|
||||
0, FMONADIC, 014, "fasin",
|
||||
0, FMONADIC, 012, "fatan",
|
||||
0, FMONADIC, 015, "fatanh",
|
||||
0, FMONADIC, 035, "fcos",
|
||||
0, FMONADIC, 031, "fcosh",
|
||||
0, FMONADIC, 020, "fetox",
|
||||
0, FMONADIC, 010, "fetoxm1",
|
||||
0, FMONADIC, 036, "fgetexp",
|
||||
0, FMONADIC, 037, "fgetman",
|
||||
0, FMONADIC, 001, "fint",
|
||||
0, FMONADIC, 003, "fintrz",
|
||||
0, FMONADIC, 024, "flogn",
|
||||
0, FMONADIC, 006, "flognp1",
|
||||
0, FMONADIC, 025, "flog10",
|
||||
0, FMONADIC, 026, "flog2",
|
||||
0, FMONADIC, 032, "fneg",
|
||||
0, FMONADIC, 016, "fsin",
|
||||
0, FMONADIC, 002, "fsinh",
|
||||
0, FMONADIC, 004, "fsqrt",
|
||||
0, FMONADIC, 017, "ftan",
|
||||
0, FMONADIC, 011, "ftanh",
|
||||
0, FMONADIC, 022, "ftentox",
|
||||
0, FMONADIC, 021, "ftwotox",
|
||||
{0, FMONADIC, 030, "fabs"},
|
||||
{0, FMONADIC, 034, "facos"},
|
||||
{0, FMONADIC, 014, "fasin"},
|
||||
{0, FMONADIC, 012, "fatan"},
|
||||
{0, FMONADIC, 015, "fatanh"},
|
||||
{0, FMONADIC, 035, "fcos"},
|
||||
{0, FMONADIC, 031, "fcosh"},
|
||||
{0, FMONADIC, 020, "fetox"},
|
||||
{0, FMONADIC, 010, "fetoxm1"},
|
||||
{0, FMONADIC, 036, "fgetexp"},
|
||||
{0, FMONADIC, 037, "fgetman"},
|
||||
{0, FMONADIC, 001, "fint"},
|
||||
{0, FMONADIC, 003, "fintrz"},
|
||||
{0, FMONADIC, 024, "flogn"},
|
||||
{0, FMONADIC, 006, "flognp1"},
|
||||
{0, FMONADIC, 025, "flog10"},
|
||||
{0, FMONADIC, 026, "flog2"},
|
||||
{0, FMONADIC, 032, "fneg"},
|
||||
{0, FMONADIC, 016, "fsin"},
|
||||
{0, FMONADIC, 002, "fsinh"},
|
||||
{0, FMONADIC, 004, "fsqrt"},
|
||||
{0, FMONADIC, 017, "ftan"},
|
||||
{0, FMONADIC, 011, "ftanh"},
|
||||
{0, FMONADIC, 022, "ftentox"},
|
||||
{0, FMONADIC, 021, "ftwotox"},
|
||||
|
||||
0, FSINCOS, 060, "fsincos",
|
||||
{0, FSINCOS, 060, "fsincos"},
|
||||
|
||||
0, FBCC, 001, "fbeq",
|
||||
0, FBCC, 016, "fbne",
|
||||
0, FBCC, 022, "fbgt",
|
||||
0, FBCC, 035, "fbngt",
|
||||
0, FBCC, 023, "fbge",
|
||||
0, FBCC, 034, "fbnge",
|
||||
0, FBCC, 024, "fblt",
|
||||
0, FBCC, 033, "fbnlt",
|
||||
0, FBCC, 025, "fble",
|
||||
0, FBCC, 032, "fbnle",
|
||||
0, FBCC, 026, "fbgl",
|
||||
0, FBCC, 031, "fbngl",
|
||||
0, FBCC, 027, "fbgle",
|
||||
0, FBCC, 030, "fbngle",
|
||||
0, FBCC, 002, "fbogt",
|
||||
0, FBCC, 015, "fbule",
|
||||
0, FBCC, 003, "fboge",
|
||||
0, FBCC, 014, "fbult",
|
||||
0, FBCC, 004, "fbolt",
|
||||
0, FBCC, 013, "fbuge",
|
||||
0, FBCC, 005, "fbole",
|
||||
0, FBCC, 012, "fbugt",
|
||||
0, FBCC, 006, "fbogl",
|
||||
0, FBCC, 011, "fbueq",
|
||||
0, FBCC, 007, "fbor",
|
||||
0, FBCC, 010, "fbun",
|
||||
0, FBCC, 000, "fbf",
|
||||
0, FBCC, 017, "fbt",
|
||||
0, FBCC, 020, "fbsf",
|
||||
0, FBCC, 037, "fbst",
|
||||
0, FBCC, 021, "fbseq",
|
||||
0, FBCC, 036, "fbsne",
|
||||
{0, FBCC, 001, "fbeq"},
|
||||
{0, FBCC, 016, "fbne"},
|
||||
{0, FBCC, 022, "fbgt"},
|
||||
{0, FBCC, 035, "fbngt"},
|
||||
{0, FBCC, 023, "fbge"},
|
||||
{0, FBCC, 034, "fbnge"},
|
||||
{0, FBCC, 024, "fblt"},
|
||||
{0, FBCC, 033, "fbnlt"},
|
||||
{0, FBCC, 025, "fble"},
|
||||
{0, FBCC, 032, "fbnle"},
|
||||
{0, FBCC, 026, "fbgl"},
|
||||
{0, FBCC, 031, "fbngl"},
|
||||
{0, FBCC, 027, "fbgle"},
|
||||
{0, FBCC, 030, "fbngle"},
|
||||
{0, FBCC, 002, "fbogt"},
|
||||
{0, FBCC, 015, "fbule"},
|
||||
{0, FBCC, 003, "fboge"},
|
||||
{0, FBCC, 014, "fbult"},
|
||||
{0, FBCC, 004, "fbolt"},
|
||||
{0, FBCC, 013, "fbuge"},
|
||||
{0, FBCC, 005, "fbole"},
|
||||
{0, FBCC, 012, "fbugt"},
|
||||
{0, FBCC, 006, "fbogl"},
|
||||
{0, FBCC, 011, "fbueq"},
|
||||
{0, FBCC, 007, "fbor"},
|
||||
{0, FBCC, 010, "fbun"},
|
||||
{0, FBCC, 000, "fbf"},
|
||||
{0, FBCC, 017, "fbt"},
|
||||
{0, FBCC, 020, "fbsf"},
|
||||
{0, FBCC, 037, "fbst"},
|
||||
{0, FBCC, 021, "fbseq"},
|
||||
{0, FBCC, 036, "fbsne"},
|
||||
|
||||
0, FDBCC, 001, "fdbeq",
|
||||
0, FDBCC, 016, "fdbne",
|
||||
0, FDBCC, 022, "fdbgt",
|
||||
0, FDBCC, 035, "fdbngt",
|
||||
0, FDBCC, 023, "fdbge",
|
||||
0, FDBCC, 034, "fdbnge",
|
||||
0, FDBCC, 024, "fdblt",
|
||||
0, FDBCC, 033, "fdbnlt",
|
||||
0, FDBCC, 025, "fdble",
|
||||
0, FDBCC, 032, "fdbnle",
|
||||
0, FDBCC, 026, "fdbgl",
|
||||
0, FDBCC, 031, "fdbngl",
|
||||
0, FDBCC, 027, "fdbgle",
|
||||
0, FDBCC, 030, "fdbngle",
|
||||
0, FDBCC, 002, "fdbogt",
|
||||
0, FDBCC, 015, "fdbule",
|
||||
0, FDBCC, 003, "fdboge",
|
||||
0, FDBCC, 014, "fdbult",
|
||||
0, FDBCC, 004, "fdbolt",
|
||||
0, FDBCC, 013, "fdbuge",
|
||||
0, FDBCC, 005, "fdbole",
|
||||
0, FDBCC, 012, "fdbugt",
|
||||
0, FDBCC, 006, "fdbogl",
|
||||
0, FDBCC, 011, "fdbueq",
|
||||
0, FDBCC, 007, "fdbor",
|
||||
0, FDBCC, 010, "fdbun",
|
||||
0, FDBCC, 000, "fdbf",
|
||||
0, FDBCC, 017, "fdbt",
|
||||
0, FDBCC, 020, "fdbsf",
|
||||
0, FDBCC, 037, "fdbst",
|
||||
0, FDBCC, 021, "fdbseq",
|
||||
0, FDBCC, 036, "fdbsne",
|
||||
{0, FDBCC, 001, "fdbeq"},
|
||||
{0, FDBCC, 016, "fdbne"},
|
||||
{0, FDBCC, 022, "fdbgt"},
|
||||
{0, FDBCC, 035, "fdbngt"},
|
||||
{0, FDBCC, 023, "fdbge"},
|
||||
{0, FDBCC, 034, "fdbnge"},
|
||||
{0, FDBCC, 024, "fdblt"},
|
||||
{0, FDBCC, 033, "fdbnlt"},
|
||||
{0, FDBCC, 025, "fdble"},
|
||||
{0, FDBCC, 032, "fdbnle"},
|
||||
{0, FDBCC, 026, "fdbgl"},
|
||||
{0, FDBCC, 031, "fdbngl"},
|
||||
{0, FDBCC, 027, "fdbgle"},
|
||||
{0, FDBCC, 030, "fdbngle"},
|
||||
{0, FDBCC, 002, "fdbogt"},
|
||||
{0, FDBCC, 015, "fdbule"},
|
||||
{0, FDBCC, 003, "fdboge"},
|
||||
{0, FDBCC, 014, "fdbult"},
|
||||
{0, FDBCC, 004, "fdbolt"},
|
||||
{0, FDBCC, 013, "fdbuge"},
|
||||
{0, FDBCC, 005, "fdbole"},
|
||||
{0, FDBCC, 012, "fdbugt"},
|
||||
{0, FDBCC, 006, "fdbogl"},
|
||||
{0, FDBCC, 011, "fdbueq"},
|
||||
{0, FDBCC, 007, "fdbor"},
|
||||
{0, FDBCC, 010, "fdbun"},
|
||||
{0, FDBCC, 000, "fdbf"},
|
||||
{0, FDBCC, 017, "fdbt"},
|
||||
{0, FDBCC, 020, "fdbsf"},
|
||||
{0, FDBCC, 037, "fdbst"},
|
||||
{0, FDBCC, 021, "fdbseq"},
|
||||
{0, FDBCC, 036, "fdbsne"},
|
||||
|
||||
0, FNOP, 0, "fnop",
|
||||
{0, FNOP, 0, "fnop"},
|
||||
|
||||
0, FSCC, 001, "fseq",
|
||||
0, FSCC, 016, "fsne",
|
||||
0, FSCC, 022, "fsgt",
|
||||
0, FSCC, 035, "fsngt",
|
||||
0, FSCC, 023, "fsge",
|
||||
0, FSCC, 034, "fsnge",
|
||||
0, FSCC, 024, "fslt",
|
||||
0, FSCC, 033, "fsnlt",
|
||||
0, FSCC, 025, "fsle",
|
||||
0, FSCC, 032, "fsnle",
|
||||
0, FSCC, 026, "fsgl",
|
||||
0, FSCC, 031, "fsngl",
|
||||
0, FSCC, 027, "fsgle",
|
||||
0, FSCC, 030, "fsngle",
|
||||
0, FSCC, 002, "fsogt",
|
||||
0, FSCC, 015, "fsule",
|
||||
0, FSCC, 003, "fsoge",
|
||||
0, FSCC, 014, "fsult",
|
||||
0, FSCC, 004, "fsolt",
|
||||
0, FSCC, 013, "fsuge",
|
||||
0, FSCC, 005, "fsole",
|
||||
0, FSCC, 012, "fsugt",
|
||||
0, FSCC, 006, "fsogl",
|
||||
0, FSCC, 011, "fsueq",
|
||||
0, FSCC, 007, "fsor",
|
||||
0, FSCC, 010, "fsun",
|
||||
0, FSCC, 000, "fsf",
|
||||
0, FSCC, 017, "fst",
|
||||
0, FSCC, 020, "fssf",
|
||||
0, FSCC, 037, "fsst",
|
||||
0, FSCC, 021, "fsseq",
|
||||
0, FSCC, 036, "fssne",
|
||||
{0, FSCC, 001, "fseq"},
|
||||
{0, FSCC, 016, "fsne"},
|
||||
{0, FSCC, 022, "fsgt"},
|
||||
{0, FSCC, 035, "fsngt"},
|
||||
{0, FSCC, 023, "fsge"},
|
||||
{0, FSCC, 034, "fsnge"},
|
||||
{0, FSCC, 024, "fslt"},
|
||||
{0, FSCC, 033, "fsnlt"},
|
||||
{0, FSCC, 025, "fsle"},
|
||||
{0, FSCC, 032, "fsnle"},
|
||||
{0, FSCC, 026, "fsgl"},
|
||||
{0, FSCC, 031, "fsngl"},
|
||||
{0, FSCC, 027, "fsgle"},
|
||||
{0, FSCC, 030, "fsngle"},
|
||||
{0, FSCC, 002, "fsogt"},
|
||||
{0, FSCC, 015, "fsule"},
|
||||
{0, FSCC, 003, "fsoge"},
|
||||
{0, FSCC, 014, "fsult"},
|
||||
{0, FSCC, 004, "fsolt"},
|
||||
{0, FSCC, 013, "fsuge"},
|
||||
{0, FSCC, 005, "fsole"},
|
||||
{0, FSCC, 012, "fsugt"},
|
||||
{0, FSCC, 006, "fsogl"},
|
||||
{0, FSCC, 011, "fsueq"},
|
||||
{0, FSCC, 007, "fsor"},
|
||||
{0, FSCC, 010, "fsun"},
|
||||
{0, FSCC, 000, "fsf"},
|
||||
{0, FSCC, 017, "fst"},
|
||||
{0, FSCC, 020, "fssf"},
|
||||
{0, FSCC, 037, "fsst"},
|
||||
{0, FSCC, 021, "fsseq"},
|
||||
{0, FSCC, 036, "fssne"},
|
||||
|
||||
0, FTST, 0, "ftst",
|
||||
{0, FTST, 0, "ftst"},
|
||||
|
||||
0, FSAVRES, MEM|ALT|0430, "fsave",
|
||||
0, FSAVRES, MEM|0540, "frestore",
|
||||
{0, FSAVRES, MEM|ALT|0430, "fsave"},
|
||||
{0, FSAVRES, MEM|0540, "frestore"},
|
||||
|
||||
0, FTRAPCC, 001, "ftrapeq",
|
||||
0, FTRAPCC, 016, "ftrapne",
|
||||
0, FTRAPCC, 022, "ftrapgt",
|
||||
0, FTRAPCC, 035, "ftrapngt",
|
||||
0, FTRAPCC, 023, "ftrapge",
|
||||
0, FTRAPCC, 034, "ftrapnge",
|
||||
0, FTRAPCC, 024, "ftraplt",
|
||||
0, FTRAPCC, 033, "ftrapnlt",
|
||||
0, FTRAPCC, 025, "ftraple",
|
||||
0, FTRAPCC, 032, "ftrapnle",
|
||||
0, FTRAPCC, 026, "ftrapgl",
|
||||
0, FTRAPCC, 031, "ftrapngl",
|
||||
0, FTRAPCC, 027, "ftrapgle",
|
||||
0, FTRAPCC, 030, "ftrapngle",
|
||||
0, FTRAPCC, 002, "ftrapogt",
|
||||
0, FTRAPCC, 015, "ftrapule",
|
||||
0, FTRAPCC, 003, "ftrapoge",
|
||||
0, FTRAPCC, 014, "ftrapult",
|
||||
0, FTRAPCC, 004, "ftrapolt",
|
||||
0, FTRAPCC, 013, "ftrapuge",
|
||||
0, FTRAPCC, 005, "ftrapole",
|
||||
0, FTRAPCC, 012, "ftrapugt",
|
||||
0, FTRAPCC, 006, "ftrapogl",
|
||||
0, FTRAPCC, 011, "ftrapueq",
|
||||
0, FTRAPCC, 007, "ftrapor",
|
||||
0, FTRAPCC, 010, "ftrapun",
|
||||
0, FTRAPCC, 000, "ftrapf",
|
||||
0, FTRAPCC, 017, "ftrapt",
|
||||
0, FTRAPCC, 020, "ftrapsf",
|
||||
0, FTRAPCC, 037, "ftrapst",
|
||||
0, FTRAPCC, 021, "ftrapseq",
|
||||
0, FTRAPCC, 036, "ftrapsne",
|
||||
{0, FTRAPCC, 001, "ftrapeq"},
|
||||
{0, FTRAPCC, 016, "ftrapne"},
|
||||
{0, FTRAPCC, 022, "ftrapgt"},
|
||||
{0, FTRAPCC, 035, "ftrapngt"},
|
||||
{0, FTRAPCC, 023, "ftrapge"},
|
||||
{0, FTRAPCC, 034, "ftrapnge"},
|
||||
{0, FTRAPCC, 024, "ftraplt"},
|
||||
{0, FTRAPCC, 033, "ftrapnlt"},
|
||||
{0, FTRAPCC, 025, "ftraple"},
|
||||
{0, FTRAPCC, 032, "ftrapnle"},
|
||||
{0, FTRAPCC, 026, "ftrapgl"},
|
||||
{0, FTRAPCC, 031, "ftrapngl"},
|
||||
{0, FTRAPCC, 027, "ftrapgle"},
|
||||
{0, FTRAPCC, 030, "ftrapngle"},
|
||||
{0, FTRAPCC, 002, "ftrapogt"},
|
||||
{0, FTRAPCC, 015, "ftrapule"},
|
||||
{0, FTRAPCC, 003, "ftrapoge"},
|
||||
{0, FTRAPCC, 014, "ftrapult"},
|
||||
{0, FTRAPCC, 004, "ftrapolt"},
|
||||
{0, FTRAPCC, 013, "ftrapuge"},
|
||||
{0, FTRAPCC, 005, "ftrapole"},
|
||||
{0, FTRAPCC, 012, "ftrapugt"},
|
||||
{0, FTRAPCC, 006, "ftrapogl"},
|
||||
{0, FTRAPCC, 011, "ftrapueq"},
|
||||
{0, FTRAPCC, 007, "ftrapor"},
|
||||
{0, FTRAPCC, 010, "ftrapun"},
|
||||
{0, FTRAPCC, 000, "ftrapf"},
|
||||
{0, FTRAPCC, 017, "ftrapt"},
|
||||
{0, FTRAPCC, 020, "ftrapsf"},
|
||||
{0, FTRAPCC, 037, "ftrapst"},
|
||||
{0, FTRAPCC, 021, "ftrapseq"},
|
||||
{0, FTRAPCC, 036, "ftrapsne"},
|
||||
|
|
|
@ -21,9 +21,9 @@
|
|||
* then emitted in one go, by emit_instr().
|
||||
*/
|
||||
|
||||
void move_special();
|
||||
|
||||
emit_instr()
|
||||
|
||||
void emit_instr(void)
|
||||
{
|
||||
register instr_t *ip;
|
||||
|
||||
|
@ -38,17 +38,13 @@ emit_instr()
|
|||
|
||||
|
||||
#ifdef RELOCATION
|
||||
t_emit2(word, relotype, reloinfo, relnm)
|
||||
short word;
|
||||
short relotype;
|
||||
valu_t relnm;
|
||||
void t_emit2(short word, short relotype, int reloinfo, valu_t relnm)
|
||||
#else
|
||||
t_emit2(word)
|
||||
short word;
|
||||
void t_emit2(short word)
|
||||
#endif
|
||||
{
|
||||
#ifdef RELOCATION
|
||||
if (instrp->i_reloinfo = reloinfo) {
|
||||
if ((instrp->i_reloinfo = reloinfo)) {
|
||||
RELOMOVE(instrp->i_relonami, relnm);
|
||||
instrp->i_relotype = relotype;
|
||||
}
|
||||
|
@ -59,21 +55,16 @@ short word;
|
|||
}
|
||||
|
||||
#ifdef RELOCATION
|
||||
t_emit4(words, relotype, reloinfo, relnm)
|
||||
long words;
|
||||
short relotype;
|
||||
valu_t relnm;
|
||||
void t_emit4(long words, short relotype, int reloinfo, valu_t relnm)
|
||||
#else
|
||||
t_emit4(words)
|
||||
long words;
|
||||
void t_emit4(long words)
|
||||
#endif
|
||||
{
|
||||
T_EMIT2((short)(words>>16), relotype, reloinfo, relnm);
|
||||
T_EMIT2((short)(words), 0, 0, 0);
|
||||
}
|
||||
|
||||
void
|
||||
ea_1(sz, bits)
|
||||
void ea_1(int sz, int bits)
|
||||
{
|
||||
/* Because displacements come in three sizes (null displacement,
|
||||
* word and long displacement), each displacement requires
|
||||
|
@ -81,8 +72,8 @@ ea_1(sz, bits)
|
|||
* one of these calls is a dummy call.
|
||||
*/
|
||||
|
||||
register flag;
|
||||
register sm, sm1, sm2;
|
||||
register int flag;
|
||||
register int sm, sm1, sm2;
|
||||
|
||||
if (mrg_1 > 074)
|
||||
serror("no specials");
|
||||
|
@ -195,7 +186,7 @@ ea_1(sz, bits)
|
|||
T_EMIT2(loww(bd_1.val), bd_1.typ, (flag>>8), bd_rel1);
|
||||
}
|
||||
|
||||
ea_2(sz, bits)
|
||||
void ea_2(int sz, int bits)
|
||||
{
|
||||
mrg_1 = mrg_2;
|
||||
bd_1 = bd_2;
|
||||
|
@ -206,27 +197,26 @@ ea_2(sz, bits)
|
|||
ea_1(sz, bits);
|
||||
}
|
||||
|
||||
checksize(sz, bits)
|
||||
void checksize(int sz, int bits)
|
||||
{
|
||||
if ((bits & (1 << (sz>>6))) == 0)
|
||||
serror("bad size");
|
||||
}
|
||||
|
||||
check_fsize(sz, size)
|
||||
void check_fsize(int sz, int size)
|
||||
{
|
||||
if (sz != size)
|
||||
serror("bad size");
|
||||
}
|
||||
|
||||
ch_sz_dreg(size, mode)
|
||||
void ch_sz_dreg(int size, int mode)
|
||||
{
|
||||
if (mode == 0 &&
|
||||
(size == FSIZE_X || size == FSIZE_P || size == FSIZE_D))
|
||||
serror("illegal size for data register");
|
||||
}
|
||||
|
||||
checkscale(val)
|
||||
valu_t val;
|
||||
int checkscale(valu_t val)
|
||||
{
|
||||
int v = val;
|
||||
|
||||
|
@ -240,13 +230,12 @@ valu_t val;
|
|||
}
|
||||
}
|
||||
|
||||
badoperand()
|
||||
void badoperand(void)
|
||||
{
|
||||
serror("bad operand(s)");
|
||||
}
|
||||
|
||||
void
|
||||
shift_op(opc, sz)
|
||||
void shift_op(int opc, int sz)
|
||||
{
|
||||
if (mrg_1 < 010 && mrg_2 < 010) {
|
||||
T_EMIT2((opc & 0170470) | sz | mrg_1<<9 | mrg_2, 0, 0, 0);
|
||||
|
@ -267,10 +256,9 @@ shift_op(opc, sz)
|
|||
ea_2(SIZE_W, MEM|ALT);
|
||||
}
|
||||
|
||||
void
|
||||
bitop(opc)
|
||||
void bitop(int opc)
|
||||
{
|
||||
register bits;
|
||||
register int bits;
|
||||
|
||||
bits = DTA|ALT;
|
||||
if (opc == 0 && (mrg_1 < 010 || mrg_2 != 074))
|
||||
|
@ -289,15 +277,14 @@ bitop(opc)
|
|||
badoperand();
|
||||
}
|
||||
|
||||
bitfield(opc, extension)
|
||||
void bitfield(int opc, int extension)
|
||||
{
|
||||
T_EMIT2(opc | mrg_2, 0, 0, 0);
|
||||
T_EMIT2(extension, 0, 0, 0);
|
||||
ea_2(SIZE_L, (mrg_2 < 010) ? 0 : (CTR | ALT));
|
||||
}
|
||||
|
||||
void
|
||||
add(opc, sz)
|
||||
void add(int opc, int sz)
|
||||
{
|
||||
if ((mrg_2 & 070) == 010)
|
||||
checksize(sz, 2|4);
|
||||
|
@ -332,8 +319,7 @@ add(opc, sz)
|
|||
badoperand();
|
||||
}
|
||||
|
||||
void
|
||||
and(opc, sz)
|
||||
void and(int opc, int sz)
|
||||
{
|
||||
if (mrg_1 == 074 && mrg_2 >= 076) { /* ccr or sr */
|
||||
if (sz != SIZE_NON)
|
||||
|
@ -359,7 +345,7 @@ and(opc, sz)
|
|||
badoperand();
|
||||
}
|
||||
|
||||
to_dreg(opc, sz, bits)
|
||||
int to_dreg(int opc, int sz, int bits)
|
||||
{
|
||||
if ((mrg_2 & 070) != 000)
|
||||
return(0);
|
||||
|
@ -368,7 +354,7 @@ to_dreg(opc, sz, bits)
|
|||
return(1);
|
||||
}
|
||||
|
||||
from_dreg(opc, sz, bits)
|
||||
int from_dreg(int opc, int sz, int bits)
|
||||
{
|
||||
if ((mrg_1 & 070) != 000)
|
||||
return(0);
|
||||
|
@ -377,10 +363,9 @@ from_dreg(opc, sz, bits)
|
|||
return(1);
|
||||
}
|
||||
|
||||
void
|
||||
cmp(sz)
|
||||
void cmp(int sz)
|
||||
{
|
||||
register opc;
|
||||
register int opc;
|
||||
|
||||
if ((mrg_1&070) == 030 && (mrg_2&070) == 030) {
|
||||
T_EMIT2(0130410 | sz | (mrg_1&7) | (mrg_2&7)<<9, 0, 0, 0);
|
||||
|
@ -408,7 +393,7 @@ cmp(sz)
|
|||
badoperand();
|
||||
}
|
||||
|
||||
link_instr(sz, areg)
|
||||
void link_instr(int sz, int areg)
|
||||
{
|
||||
if (sz == SIZE_NON) {
|
||||
if (bd_2.typ == S_ABS && fitw(bd_2.val))
|
||||
|
@ -424,10 +409,9 @@ link_instr(sz, areg)
|
|||
ea_2(sz, 0);
|
||||
}
|
||||
|
||||
void
|
||||
move(sz)
|
||||
void move(int sz)
|
||||
{
|
||||
register opc;
|
||||
register int opc;
|
||||
|
||||
if (mrg_1 > 074 || mrg_2 > 074) {
|
||||
move_special(sz);
|
||||
|
@ -457,8 +441,7 @@ move(sz)
|
|||
ea_2(sz, ALT);
|
||||
}
|
||||
|
||||
void
|
||||
move_special(sz)
|
||||
void move_special(int sz)
|
||||
{
|
||||
if (mrg_2 >= 076) {
|
||||
if (sz != SIZE_NON)
|
||||
|
@ -487,9 +470,9 @@ move_special(sz)
|
|||
badoperand();
|
||||
}
|
||||
|
||||
movem(dr, sz, regs)
|
||||
void movem(int dr, int sz, int regs)
|
||||
{
|
||||
register i;
|
||||
register int i;
|
||||
|
||||
if ((mrg_2>>3) == 04) {
|
||||
regs = reverse(regs, 16);
|
||||
|
@ -509,8 +492,7 @@ movem(dr, sz, regs)
|
|||
ea_2(sz, i);
|
||||
}
|
||||
|
||||
reverse(regs, max)
|
||||
register int regs;
|
||||
int reverse(register int regs, int max)
|
||||
{
|
||||
register int r, i;
|
||||
|
||||
|
@ -524,8 +506,7 @@ reverse(regs, max)
|
|||
return regs;
|
||||
}
|
||||
|
||||
void
|
||||
movep(sz)
|
||||
void movep(int sz)
|
||||
{
|
||||
checksize(sz, 2|4);
|
||||
if (mrg_1<010 && (mrg_2&070)==050) {
|
||||
|
@ -541,11 +522,9 @@ movep(sz)
|
|||
badoperand();
|
||||
}
|
||||
|
||||
void
|
||||
branch(opc, exp)
|
||||
expr_t exp;
|
||||
void branch(int opc, expr_t exp)
|
||||
{
|
||||
register sm;
|
||||
register int sm;
|
||||
|
||||
exp.val -= (DOTVAL + 2);
|
||||
if ((pass == PASS_2)
|
||||
|
@ -578,11 +557,9 @@ expr_t exp;
|
|||
T_EMIT4(exp.val, exp.typ, RELPC|RELO4, relonami);
|
||||
}
|
||||
|
||||
void
|
||||
cpbcc(opc, exp)
|
||||
expr_t exp;
|
||||
void cpbcc(int opc, expr_t exp)
|
||||
{
|
||||
register sm;
|
||||
register int sm;
|
||||
|
||||
exp.val -= (DOTVAL + 2);
|
||||
if ((pass == PASS_2)
|
||||
|
@ -606,8 +583,7 @@ expr_t exp;
|
|||
T_EMIT4(exp.val, exp.typ, RELPC|RELO4, relonami);
|
||||
}
|
||||
|
||||
void
|
||||
ea7071(sz)
|
||||
void ea7071(int sz)
|
||||
{
|
||||
mrg_2 = 071;
|
||||
switch (sz) {
|
||||
|
@ -685,11 +661,9 @@ ea7071(sz)
|
|||
mrg_2 = 070;
|
||||
}
|
||||
|
||||
void
|
||||
fbranch(opc, exp)
|
||||
expr_t exp;
|
||||
void fbranch(int opc, expr_t exp)
|
||||
{
|
||||
register sm;
|
||||
register int sm;
|
||||
|
||||
exp.val -= (DOTVAL + 2);
|
||||
if ((pass == PASS_2)
|
||||
|
|
|
@ -76,3 +76,33 @@ short eamode[] = {
|
|||
/* 074L */ DTA|MEM |PUTL | (RELO4 )<<8,
|
||||
};
|
||||
#endif
|
||||
|
||||
/* 680x0 specific instructions */
|
||||
void ea_1(int sz, int bits);
|
||||
void ea_2(int sz, int bits);
|
||||
void indexmode(int hibyte);
|
||||
void checksize(int sz, int bits);
|
||||
void test68010(void);
|
||||
void badoperand(void);
|
||||
void shift_op(int opc, int sz);
|
||||
void bitop(int opc);
|
||||
void add(int opc, int sz);
|
||||
void and(int opc, int sz);
|
||||
int to_dreg(int opc, int sz, int bits);
|
||||
int from_dreg(int opc, int sz, int bits);
|
||||
void cmp(int sz);
|
||||
void move(int sz);
|
||||
void move_special(int sz);
|
||||
int reverse(register int regs, int max);
|
||||
void movem(int dr, int sz, int regs);
|
||||
void movep(int sz);
|
||||
void branch(int opc, expr_t exp);
|
||||
void ea5x73(int rg, int sz);
|
||||
void ea707172(int sz);
|
||||
void ea6x(int rg, int ir, int sz);
|
||||
void ea72(void);
|
||||
void ea73(int ri, int sz);
|
||||
void Xnofit(void);
|
||||
void fbranch(int opc, expr_t exp);
|
||||
void ch_sz_dreg(int size, int mode);
|
||||
void check_fsize(int sz, int size);
|
||||
|
|
|
@ -8,382 +8,382 @@
|
|||
* Motorola 68000/68010 keywords
|
||||
*/
|
||||
|
||||
0, EXTERN, 0, ".globl",
|
||||
{0, EXTERN, 0, ".globl"},
|
||||
|
||||
0, SIZE, SIZE_B, ".b",
|
||||
0, SIZE, SIZE_W, ".w",
|
||||
0, SIZE, SIZE_L, ".l",
|
||||
{0, SIZE, SIZE_B, ".b"},
|
||||
{0, SIZE, SIZE_W, ".w"},
|
||||
{0, SIZE, SIZE_L, ".l"},
|
||||
|
||||
0, DREG, 00, "d0",
|
||||
0, DREG, 01, "d1",
|
||||
0, DREG, 02, "d2",
|
||||
0, DREG, 03, "d3",
|
||||
0, DREG, 04, "d4",
|
||||
0, DREG, 05, "d5",
|
||||
0, DREG, 06, "d6",
|
||||
0, DREG, 07, "d7",
|
||||
{0, DREG, 00, "d0"},
|
||||
{0, DREG, 01, "d1"},
|
||||
{0, DREG, 02, "d2"},
|
||||
{0, DREG, 03, "d3"},
|
||||
{0, DREG, 04, "d4"},
|
||||
{0, DREG, 05, "d5"},
|
||||
{0, DREG, 06, "d6"},
|
||||
{0, DREG, 07, "d7"},
|
||||
|
||||
0, AREG, 00, "a0",
|
||||
0, AREG, 01, "a1",
|
||||
0, AREG, 02, "a2",
|
||||
0, AREG, 03, "a3",
|
||||
0, AREG, 04, "a4",
|
||||
0, AREG, 05, "a5",
|
||||
0, AREG, 06, "a6",
|
||||
0, AREG, 07, "a7",
|
||||
0, AREG, 07, "sp",
|
||||
{0, AREG, 00, "a0"},
|
||||
{0, AREG, 01, "a1"},
|
||||
{0, AREG, 02, "a2"},
|
||||
{0, AREG, 03, "a3"},
|
||||
{0, AREG, 04, "a4"},
|
||||
{0, AREG, 05, "a5"},
|
||||
{0, AREG, 06, "a6"},
|
||||
{0, AREG, 07, "a7"},
|
||||
{0, AREG, 07, "sp"},
|
||||
|
||||
0, PC, 8, "pc",
|
||||
{0, PC, 8, "pc"},
|
||||
|
||||
0, MODEL, 0, ".68000",
|
||||
0, MODEL, 1, ".68010",
|
||||
{0, MODEL, 0, ".68000"},
|
||||
{0, MODEL, 1, ".68010"},
|
||||
|
||||
0, CREG, 04001, "vbr",
|
||||
0, CREG, 0, "sfc",
|
||||
0, CREG, 00001, "dfc",
|
||||
{0, CREG, 04001, "vbr"},
|
||||
{0, CREG, 0, "sfc"},
|
||||
{0, CREG, 00001, "dfc"},
|
||||
|
||||
0, SPEC, 075, "usp",
|
||||
0, SPEC, 076, "ccr",
|
||||
0, SPEC, 077, "sr",
|
||||
{0, SPEC, 075, "usp"},
|
||||
{0, SPEC, 076, "ccr"},
|
||||
{0, SPEC, 077, "sr"},
|
||||
|
||||
0, ABCD, 0140400, "abcd",
|
||||
0, ABCD, 0100400, "sbcd",
|
||||
{0, ABCD, 0140400, "abcd"},
|
||||
{0, ABCD, 0100400, "sbcd"},
|
||||
|
||||
0, ADDX, 0150400, "addx",
|
||||
0, ADDX, 0110400, "subx",
|
||||
{0, ADDX, 0150400, "addx"},
|
||||
{0, ADDX, 0110400, "subx"},
|
||||
|
||||
0, ADD, 0153300, "add",
|
||||
0, ADD, 0112700, "sub",
|
||||
{0, ADD, 0153300, "add"},
|
||||
{0, ADD, 0112700, "sub"},
|
||||
|
||||
0, AND, 0141000, "and",
|
||||
0, AND, 0135000, "eor",
|
||||
0, AND, 0100000, "or",
|
||||
{0, AND, 0141000, "and"},
|
||||
{0, AND, 0135000, "eor"},
|
||||
{0, AND, 0100000, "or"},
|
||||
|
||||
0, BITOP, 0000, "btst",
|
||||
0, BITOP, 0100, "bchg",
|
||||
0, BITOP, 0200, "bclr",
|
||||
0, BITOP, 0300, "bset",
|
||||
{0, BITOP, 0000, "btst"},
|
||||
{0, BITOP, 0100, "bchg"},
|
||||
{0, BITOP, 0200, "bclr"},
|
||||
{0, BITOP, 0300, "bset"},
|
||||
|
||||
0, SHIFT, 0160340, "asr",
|
||||
0, SHIFT, 0160740, "asl",
|
||||
0, SHIFT, 0161350, "lsr",
|
||||
0, SHIFT, 0161750, "lsl",
|
||||
0, SHIFT, 0162360, "roxr",
|
||||
0, SHIFT, 0162760, "roxl",
|
||||
0, SHIFT, 0163370, "ror",
|
||||
0, SHIFT, 0163770, "rol",
|
||||
{0, SHIFT, 0160340, "asr"},
|
||||
{0, SHIFT, 0160740, "asl"},
|
||||
{0, SHIFT, 0161350, "lsr"},
|
||||
{0, SHIFT, 0161750, "lsl"},
|
||||
{0, SHIFT, 0162360, "roxr"},
|
||||
{0, SHIFT, 0162760, "roxl"},
|
||||
{0, SHIFT, 0163370, "ror"},
|
||||
{0, SHIFT, 0163770, "rol"},
|
||||
|
||||
0, SZ_EA, 041000|DTA|ALT, "clr",
|
||||
0, SZ_EA, 042000|DTA|ALT, "neg",
|
||||
0, SZ_EA, 040000|DTA|ALT, "negx",
|
||||
0, SZ_EA, 043000|DTA|ALT, "not",
|
||||
0, SZ_EA, 045000|DTA|ALT, "tst",
|
||||
{0, SZ_EA, 041000|DTA|ALT, "clr"},
|
||||
{0, SZ_EA, 042000|DTA|ALT, "neg"},
|
||||
{0, SZ_EA, 040000|DTA|ALT, "negx"},
|
||||
{0, SZ_EA, 043000|DTA|ALT, "not"},
|
||||
{0, SZ_EA, 045000|DTA|ALT, "tst"},
|
||||
|
||||
0, OP_EA, 044000|DTA|ALT, "nbcd",
|
||||
0, OP_EA, 045300|DTA|ALT, "tas",
|
||||
0, OP_EA, 047200|CTR, "jsr",
|
||||
0, OP_EA, 047300|CTR, "jmp",
|
||||
0, OP_EA, 044100|CTR, "pea",
|
||||
{0, OP_EA, 044000|DTA|ALT, "nbcd"},
|
||||
{0, OP_EA, 045300|DTA|ALT, "tas"},
|
||||
{0, OP_EA, 047200|CTR, "jsr"},
|
||||
{0, OP_EA, 047300|CTR, "jmp"},
|
||||
{0, OP_EA, 044100|CTR, "pea"},
|
||||
|
||||
0, OP_EA, 050300, "st",
|
||||
0, OP_EA, 050700, "sf",
|
||||
0, OP_EA, 051300, "shi",
|
||||
0, OP_EA, 051700, "sls",
|
||||
0, OP_EA, 052300, "scc",
|
||||
0, OP_EA, 052700, "scs",
|
||||
0, OP_EA, 053300, "sne",
|
||||
0, OP_EA, 053700, "seq",
|
||||
0, OP_EA, 054300, "svc",
|
||||
0, OP_EA, 054700, "svs",
|
||||
0, OP_EA, 055300, "spl",
|
||||
0, OP_EA, 055700, "smi",
|
||||
0, OP_EA, 056300, "sge",
|
||||
0, OP_EA, 056700, "slt",
|
||||
0, OP_EA, 057300, "sgt",
|
||||
0, OP_EA, 057700, "sle",
|
||||
{0, OP_EA, 050300, "st"},
|
||||
{0, OP_EA, 050700, "sf"},
|
||||
{0, OP_EA, 051300, "shi"},
|
||||
{0, OP_EA, 051700, "sls"},
|
||||
{0, OP_EA, 052300, "scc"},
|
||||
{0, OP_EA, 052700, "scs"},
|
||||
{0, OP_EA, 053300, "sne"},
|
||||
{0, OP_EA, 053700, "seq"},
|
||||
{0, OP_EA, 054300, "svc"},
|
||||
{0, OP_EA, 054700, "svs"},
|
||||
{0, OP_EA, 055300, "spl"},
|
||||
{0, OP_EA, 055700, "smi"},
|
||||
{0, OP_EA, 056300, "sge"},
|
||||
{0, OP_EA, 056700, "slt"},
|
||||
{0, OP_EA, 057300, "sgt"},
|
||||
{0, OP_EA, 057700, "sle"},
|
||||
|
||||
0, OP_NOOP, 047160, "reset",
|
||||
0, OP_NOOP, 047161, "nop",
|
||||
0, OP_NOOP, 047163, "rte",
|
||||
0, OP_NOOP, 047165, "rts",
|
||||
0, OP_NOOP, 047166, "trapv",
|
||||
0, OP_NOOP, 047167, "rtr",
|
||||
0, OP_NOOP, 045374, "illegal",
|
||||
{0, OP_NOOP, 047160, "reset"},
|
||||
{0, OP_NOOP, 047161, "nop"},
|
||||
{0, OP_NOOP, 047163, "rte"},
|
||||
{0, OP_NOOP, 047165, "rts"},
|
||||
{0, OP_NOOP, 047166, "trapv"},
|
||||
{0, OP_NOOP, 047167, "rtr"},
|
||||
{0, OP_NOOP, 045374, "illegal"},
|
||||
|
||||
0, OP_EA_D, 040600, "chk",
|
||||
0, OP_EA_D, 0100300, "divu",
|
||||
0, OP_EA_D, 0100700, "divs",
|
||||
0, OP_EA_D, 0140300, "mulu",
|
||||
0, OP_EA_D, 0140700, "muls",
|
||||
{0, OP_EA_D, 040600, "chk"},
|
||||
{0, OP_EA_D, 0100300, "divu"},
|
||||
{0, OP_EA_D, 0100700, "divs"},
|
||||
{0, OP_EA_D, 0140300, "mulu"},
|
||||
{0, OP_EA_D, 0140700, "muls"},
|
||||
|
||||
0, BR, 060000, "bra",
|
||||
0, BR, 060400, "bsr",
|
||||
0, BR, 061000, "bhi",
|
||||
0, BR, 061400, "bls",
|
||||
0, BR, 062000, "bcc",
|
||||
0, BR, 062400, "bcs",
|
||||
0, BR, 063000, "bne",
|
||||
0, BR, 063400, "beq",
|
||||
0, BR, 064000, "bvc",
|
||||
0, BR, 064400, "bvs",
|
||||
0, BR, 065000, "bpl",
|
||||
0, BR, 065400, "bmi",
|
||||
0, BR, 066000, "bge",
|
||||
0, BR, 066400, "blt",
|
||||
0, BR, 067000, "bgt",
|
||||
0, BR, 067400, "ble",
|
||||
{0, BR, 060000, "bra"},
|
||||
{0, BR, 060400, "bsr"},
|
||||
{0, BR, 061000, "bhi"},
|
||||
{0, BR, 061400, "bls"},
|
||||
{0, BR, 062000, "bcc"},
|
||||
{0, BR, 062400, "bcs"},
|
||||
{0, BR, 063000, "bne"},
|
||||
{0, BR, 063400, "beq"},
|
||||
{0, BR, 064000, "bvc"},
|
||||
{0, BR, 064400, "bvs"},
|
||||
{0, BR, 065000, "bpl"},
|
||||
{0, BR, 065400, "bmi"},
|
||||
{0, BR, 066000, "bge"},
|
||||
{0, BR, 066400, "blt"},
|
||||
{0, BR, 067000, "bgt"},
|
||||
{0, BR, 067400, "ble"},
|
||||
|
||||
0, DBR, 050310, "dbt",
|
||||
0, DBR, 050710, "dbf",
|
||||
0, DBR, 050710, "dbra",
|
||||
0, DBR, 051310, "dbhi",
|
||||
0, DBR, 051710, "dbls",
|
||||
0, DBR, 052310, "dbcc",
|
||||
0, DBR, 052710, "dbcs",
|
||||
0, DBR, 053310, "dbne",
|
||||
0, DBR, 053710, "dbeq",
|
||||
0, DBR, 054310, "dbvc",
|
||||
0, DBR, 054710, "dbvs",
|
||||
0, DBR, 055310, "dbpl",
|
||||
0, DBR, 055710, "dbmi",
|
||||
0, DBR, 056310, "dbge",
|
||||
0, DBR, 056710, "dblt",
|
||||
0, DBR, 057310, "dbgt",
|
||||
0, DBR, 057710, "dble",
|
||||
{0, DBR, 050310, "dbt"},
|
||||
{0, DBR, 050710, "dbf"},
|
||||
{0, DBR, 050710, "dbra"},
|
||||
{0, DBR, 051310, "dbhi"},
|
||||
{0, DBR, 051710, "dbls"},
|
||||
{0, DBR, 052310, "dbcc"},
|
||||
{0, DBR, 052710, "dbcs"},
|
||||
{0, DBR, 053310, "dbne"},
|
||||
{0, DBR, 053710, "dbeq"},
|
||||
{0, DBR, 054310, "dbvc"},
|
||||
{0, DBR, 054710, "dbvs"},
|
||||
{0, DBR, 055310, "dbpl"},
|
||||
{0, DBR, 055710, "dbmi"},
|
||||
{0, DBR, 056310, "dbge"},
|
||||
{0, DBR, 056710, "dblt"},
|
||||
{0, DBR, 057310, "dbgt"},
|
||||
{0, DBR, 057710, "dble"},
|
||||
|
||||
0, CMP, 0, "cmp",
|
||||
{0, CMP, 0, "cmp"},
|
||||
|
||||
0, MOVE, 0, "move",
|
||||
0, MOVEP, 0, "movep",
|
||||
0, MOVEM, 0, "movem",
|
||||
0, MOVES, 0, "moves",
|
||||
0, MOVEC, 0, "movec",
|
||||
{0, MOVE, 0, "move"},
|
||||
{0, MOVEP, 0, "movep"},
|
||||
{0, MOVEM, 0, "movem"},
|
||||
{0, MOVES, 0, "moves"},
|
||||
{0, MOVEC, 0, "movec"},
|
||||
|
||||
0, SWAP, 0, "swap",
|
||||
{0, SWAP, 0, "swap"},
|
||||
|
||||
0, LINK, 0, "link",
|
||||
{0, LINK, 0, "link"},
|
||||
|
||||
0, UNLK, 0, "unlk",
|
||||
{0, UNLK, 0, "unlk"},
|
||||
|
||||
0, TRAP, 0, "trap",
|
||||
{0, TRAP, 0, "trap"},
|
||||
|
||||
0, STOP, 047162, "stop",
|
||||
{0, STOP, 047162, "stop"},
|
||||
|
||||
0, EXG, 0, "exg",
|
||||
{0, EXG, 0, "exg"},
|
||||
|
||||
0, OP_EXT, 0, "ext",
|
||||
{0, OP_EXT, 0, "ext"},
|
||||
|
||||
0, LEA, 0, "lea",
|
||||
{0, LEA, 0, "lea"},
|
||||
|
||||
0, RTD, 0, "rtd",
|
||||
{0, RTD, 0, "rtd"},
|
||||
|
||||
/* floating point coprocessor ... */
|
||||
|
||||
0, FSIZE, FSIZE_S, ".s",
|
||||
0, FSIZE, FSIZE_X, ".x",
|
||||
0, FSIZE, FSIZE_P, ".p",
|
||||
0, FSIZE, FSIZE_D, ".d",
|
||||
{0, FSIZE, FSIZE_S, ".s"},
|
||||
{0, FSIZE, FSIZE_X, ".x"},
|
||||
{0, FSIZE, FSIZE_P, ".p"},
|
||||
{0, FSIZE, FSIZE_D, ".d"},
|
||||
|
||||
0, FPREG, 0, "fp0",
|
||||
0, FPREG, 1, "fp1",
|
||||
0, FPREG, 2, "fp2",
|
||||
0, FPREG, 3, "fp3",
|
||||
0, FPREG, 4, "fp4",
|
||||
0, FPREG, 5, "fp5",
|
||||
0, FPREG, 6, "fp6",
|
||||
0, FPREG, 7, "fp7",
|
||||
{0, FPREG, 0, "fp0"},
|
||||
{0, FPREG, 1, "fp1"},
|
||||
{0, FPREG, 2, "fp2"},
|
||||
{0, FPREG, 3, "fp3"},
|
||||
{0, FPREG, 4, "fp4"},
|
||||
{0, FPREG, 5, "fp5"},
|
||||
{0, FPREG, 6, "fp6"},
|
||||
{0, FPREG, 7, "fp7"},
|
||||
|
||||
0, FPCR, 1, "fpiar",
|
||||
0, FPCR, 2, "fpsr",
|
||||
0, FPCR, 4, "fpcr",
|
||||
{0, FPCR, 1, "fpiar"},
|
||||
{0, FPCR, 2, "fpsr"},
|
||||
{0, FPCR, 4, "fpcr"},
|
||||
|
||||
0, FMOVE, 0, "fmove",
|
||||
0, FMOVECR, 0, "fmovecr",
|
||||
0, FMOVEM, 0, "fmovem",
|
||||
{0, FMOVE, 0, "fmove"},
|
||||
{0, FMOVECR, 0, "fmovecr"},
|
||||
{0, FMOVEM, 0, "fmovem"},
|
||||
|
||||
0, FDYADIC, 042, "fadd",
|
||||
0, FDYADIC, 070, "fcmp",
|
||||
0, FDYADIC, 040, "fdiv",
|
||||
0, FDYADIC, 041, "fmod",
|
||||
0, FDYADIC, 043, "fmul",
|
||||
0, FDYADIC, 045, "frem",
|
||||
0, FDYADIC, 046, "fscale",
|
||||
0, FDYADIC, 044, "fsgldiv",
|
||||
0, FDYADIC, 047, "fsglmul",
|
||||
0, FDYADIC, 050, "fsub",
|
||||
{0, FDYADIC, 042, "fadd"},
|
||||
{0, FDYADIC, 070, "fcmp"},
|
||||
{0, FDYADIC, 040, "fdiv"},
|
||||
{0, FDYADIC, 041, "fmod"},
|
||||
{0, FDYADIC, 043, "fmul"},
|
||||
{0, FDYADIC, 045, "frem"},
|
||||
{0, FDYADIC, 046, "fscale"},
|
||||
{0, FDYADIC, 044, "fsgldiv"},
|
||||
{0, FDYADIC, 047, "fsglmul"},
|
||||
{0, FDYADIC, 050, "fsub"},
|
||||
|
||||
0, FMONADIC, 030, "fabs",
|
||||
0, FMONADIC, 034, "facos",
|
||||
0, FMONADIC, 014, "fasin",
|
||||
0, FMONADIC, 012, "fatan",
|
||||
0, FMONADIC, 015, "fatanh",
|
||||
0, FMONADIC, 035, "fcos",
|
||||
0, FMONADIC, 031, "fcosh",
|
||||
0, FMONADIC, 020, "fetox",
|
||||
0, FMONADIC, 010, "fetoxm1",
|
||||
0, FMONADIC, 036, "fgetexp",
|
||||
0, FMONADIC, 037, "fgetman",
|
||||
0, FMONADIC, 001, "fint",
|
||||
0, FMONADIC, 003, "fintrz",
|
||||
0, FMONADIC, 024, "flogn",
|
||||
0, FMONADIC, 006, "flognp1",
|
||||
0, FMONADIC, 025, "flog10",
|
||||
0, FMONADIC, 026, "flog2",
|
||||
0, FMONADIC, 032, "fneg",
|
||||
0, FMONADIC, 016, "fsin",
|
||||
0, FMONADIC, 002, "fsinh",
|
||||
0, FMONADIC, 004, "fsqrt",
|
||||
0, FMONADIC, 017, "ftan",
|
||||
0, FMONADIC, 011, "ftanh",
|
||||
0, FMONADIC, 022, "ftentox",
|
||||
0, FMONADIC, 021, "ftwotox",
|
||||
{0, FMONADIC, 030, "fabs"},
|
||||
{0, FMONADIC, 034, "facos"},
|
||||
{0, FMONADIC, 014, "fasin"},
|
||||
{0, FMONADIC, 012, "fatan"},
|
||||
{0, FMONADIC, 015, "fatanh"},
|
||||
{0, FMONADIC, 035, "fcos"},
|
||||
{0, FMONADIC, 031, "fcosh"},
|
||||
{0, FMONADIC, 020, "fetox"},
|
||||
{0, FMONADIC, 010, "fetoxm1"},
|
||||
{0, FMONADIC, 036, "fgetexp"},
|
||||
{0, FMONADIC, 037, "fgetman"},
|
||||
{0, FMONADIC, 001, "fint"},
|
||||
{0, FMONADIC, 003, "fintrz"},
|
||||
{0, FMONADIC, 024, "flogn"},
|
||||
{0, FMONADIC, 006, "flognp1"},
|
||||
{0, FMONADIC, 025, "flog10"},
|
||||
{0, FMONADIC, 026, "flog2"},
|
||||
{0, FMONADIC, 032, "fneg"},
|
||||
{0, FMONADIC, 016, "fsin"},
|
||||
{0, FMONADIC, 002, "fsinh"},
|
||||
{0, FMONADIC, 004, "fsqrt"},
|
||||
{0, FMONADIC, 017, "ftan"},
|
||||
{0, FMONADIC, 011, "ftanh"},
|
||||
{0, FMONADIC, 022, "ftentox"},
|
||||
{0, FMONADIC, 021, "ftwotox"},
|
||||
|
||||
0, FSINCOS, 060, "fsincos",
|
||||
{0, FSINCOS, 060, "fsincos"},
|
||||
|
||||
0, FBCC, 001, "fbeq",
|
||||
0, FBCC, 016, "fbne",
|
||||
0, FBCC, 022, "fbgt",
|
||||
0, FBCC, 035, "fbngt",
|
||||
0, FBCC, 023, "fbge",
|
||||
0, FBCC, 034, "fbnge",
|
||||
0, FBCC, 024, "fblt",
|
||||
0, FBCC, 033, "fbnlt",
|
||||
0, FBCC, 025, "fble",
|
||||
0, FBCC, 032, "fbnle",
|
||||
0, FBCC, 026, "fbgl",
|
||||
0, FBCC, 031, "fbngl",
|
||||
0, FBCC, 027, "fbgle",
|
||||
0, FBCC, 030, "fbngle",
|
||||
0, FBCC, 002, "fbogt",
|
||||
0, FBCC, 015, "fbule",
|
||||
0, FBCC, 003, "fboge",
|
||||
0, FBCC, 014, "fbult",
|
||||
0, FBCC, 004, "fbolt",
|
||||
0, FBCC, 013, "fbuge",
|
||||
0, FBCC, 005, "fbole",
|
||||
0, FBCC, 012, "fbugt",
|
||||
0, FBCC, 006, "fbogl",
|
||||
0, FBCC, 011, "fbueq",
|
||||
0, FBCC, 007, "fbor",
|
||||
0, FBCC, 010, "fbun",
|
||||
0, FBCC, 000, "fbf",
|
||||
0, FBCC, 017, "fbt",
|
||||
0, FBCC, 020, "fbsf",
|
||||
0, FBCC, 037, "fbst",
|
||||
0, FBCC, 021, "fbseq",
|
||||
0, FBCC, 036, "fbsne",
|
||||
{0, FBCC, 001, "fbeq"},
|
||||
{0, FBCC, 016, "fbne"},
|
||||
{0, FBCC, 022, "fbgt"},
|
||||
{0, FBCC, 035, "fbngt"},
|
||||
{0, FBCC, 023, "fbge"},
|
||||
{0, FBCC, 034, "fbnge"},
|
||||
{0, FBCC, 024, "fblt"},
|
||||
{0, FBCC, 033, "fbnlt"},
|
||||
{0, FBCC, 025, "fble"},
|
||||
{0, FBCC, 032, "fbnle"},
|
||||
{0, FBCC, 026, "fbgl"},
|
||||
{0, FBCC, 031, "fbngl"},
|
||||
{0, FBCC, 027, "fbgle"},
|
||||
{0, FBCC, 030, "fbngle"},
|
||||
{0, FBCC, 002, "fbogt"},
|
||||
{0, FBCC, 015, "fbule"},
|
||||
{0, FBCC, 003, "fboge"},
|
||||
{0, FBCC, 014, "fbult"},
|
||||
{0, FBCC, 004, "fbolt"},
|
||||
{0, FBCC, 013, "fbuge"},
|
||||
{0, FBCC, 005, "fbole"},
|
||||
{0, FBCC, 012, "fbugt"},
|
||||
{0, FBCC, 006, "fbogl"},
|
||||
{0, FBCC, 011, "fbueq"},
|
||||
{0, FBCC, 007, "fbor"},
|
||||
{0, FBCC, 010, "fbun"},
|
||||
{0, FBCC, 000, "fbf"},
|
||||
{0, FBCC, 017, "fbt"},
|
||||
{0, FBCC, 020, "fbsf"},
|
||||
{0, FBCC, 037, "fbst"},
|
||||
{0, FBCC, 021, "fbseq"},
|
||||
{0, FBCC, 036, "fbsne"},
|
||||
|
||||
0, FDBCC, 001, "fdbeq",
|
||||
0, FDBCC, 016, "fdbne",
|
||||
0, FDBCC, 022, "fdbgt",
|
||||
0, FDBCC, 035, "fdbngt",
|
||||
0, FDBCC, 023, "fdbge",
|
||||
0, FDBCC, 034, "fdbnge",
|
||||
0, FDBCC, 024, "fdblt",
|
||||
0, FDBCC, 033, "fdbnlt",
|
||||
0, FDBCC, 025, "fdble",
|
||||
0, FDBCC, 032, "fdbnle",
|
||||
0, FDBCC, 026, "fdbgl",
|
||||
0, FDBCC, 031, "fdbngl",
|
||||
0, FDBCC, 027, "fdbgle",
|
||||
0, FDBCC, 030, "fdbngle",
|
||||
0, FDBCC, 002, "fdbogt",
|
||||
0, FDBCC, 015, "fdbule",
|
||||
0, FDBCC, 003, "fdboge",
|
||||
0, FDBCC, 014, "fdbult",
|
||||
0, FDBCC, 004, "fdbolt",
|
||||
0, FDBCC, 013, "fdbuge",
|
||||
0, FDBCC, 005, "fdbole",
|
||||
0, FDBCC, 012, "fdbugt",
|
||||
0, FDBCC, 006, "fdbogl",
|
||||
0, FDBCC, 011, "fdbueq",
|
||||
0, FDBCC, 007, "fdbor",
|
||||
0, FDBCC, 010, "fdbun",
|
||||
0, FDBCC, 000, "fdbf",
|
||||
0, FDBCC, 017, "fdbt",
|
||||
0, FDBCC, 020, "fdbsf",
|
||||
0, FDBCC, 037, "fdbst",
|
||||
0, FDBCC, 021, "fdbseq",
|
||||
0, FDBCC, 036, "fdbsne",
|
||||
{0, FDBCC, 001, "fdbeq"},
|
||||
{0, FDBCC, 016, "fdbne"},
|
||||
{0, FDBCC, 022, "fdbgt"},
|
||||
{0, FDBCC, 035, "fdbngt"},
|
||||
{0, FDBCC, 023, "fdbge"},
|
||||
{0, FDBCC, 034, "fdbnge"},
|
||||
{0, FDBCC, 024, "fdblt"},
|
||||
{0, FDBCC, 033, "fdbnlt"},
|
||||
{0, FDBCC, 025, "fdble"},
|
||||
{0, FDBCC, 032, "fdbnle"},
|
||||
{0, FDBCC, 026, "fdbgl"},
|
||||
{0, FDBCC, 031, "fdbngl"},
|
||||
{0, FDBCC, 027, "fdbgle"},
|
||||
{0, FDBCC, 030, "fdbngle"},
|
||||
{0, FDBCC, 002, "fdbogt"},
|
||||
{0, FDBCC, 015, "fdbule"},
|
||||
{0, FDBCC, 003, "fdboge"},
|
||||
{0, FDBCC, 014, "fdbult"},
|
||||
{0, FDBCC, 004, "fdbolt"},
|
||||
{0, FDBCC, 013, "fdbuge"},
|
||||
{0, FDBCC, 005, "fdbole"},
|
||||
{0, FDBCC, 012, "fdbugt"},
|
||||
{0, FDBCC, 006, "fdbogl"},
|
||||
{0, FDBCC, 011, "fdbueq"},
|
||||
{0, FDBCC, 007, "fdbor"},
|
||||
{0, FDBCC, 010, "fdbun"},
|
||||
{0, FDBCC, 000, "fdbf"},
|
||||
{0, FDBCC, 017, "fdbt"},
|
||||
{0, FDBCC, 020, "fdbsf"},
|
||||
{0, FDBCC, 037, "fdbst"},
|
||||
{0, FDBCC, 021, "fdbseq"},
|
||||
{0, FDBCC, 036, "fdbsne"},
|
||||
|
||||
0, FNOP, 0, "fnop",
|
||||
{0, FNOP, 0, "fnop"},
|
||||
|
||||
0, FSCC, 001, "fseq",
|
||||
0, FSCC, 016, "fsne",
|
||||
0, FSCC, 022, "fsgt",
|
||||
0, FSCC, 035, "fsngt",
|
||||
0, FSCC, 023, "fsge",
|
||||
0, FSCC, 034, "fsnge",
|
||||
0, FSCC, 024, "fslt",
|
||||
0, FSCC, 033, "fsnlt",
|
||||
0, FSCC, 025, "fsle",
|
||||
0, FSCC, 032, "fsnle",
|
||||
0, FSCC, 026, "fsgl",
|
||||
0, FSCC, 031, "fsngl",
|
||||
0, FSCC, 027, "fsgle",
|
||||
0, FSCC, 030, "fsngle",
|
||||
0, FSCC, 002, "fsogt",
|
||||
0, FSCC, 015, "fsule",
|
||||
0, FSCC, 003, "fsoge",
|
||||
0, FSCC, 014, "fsult",
|
||||
0, FSCC, 004, "fsolt",
|
||||
0, FSCC, 013, "fsuge",
|
||||
0, FSCC, 005, "fsole",
|
||||
0, FSCC, 012, "fsugt",
|
||||
0, FSCC, 006, "fsogl",
|
||||
0, FSCC, 011, "fsueq",
|
||||
0, FSCC, 007, "fsor",
|
||||
0, FSCC, 010, "fsun",
|
||||
0, FSCC, 000, "fsf",
|
||||
0, FSCC, 017, "fst",
|
||||
0, FSCC, 020, "fssf",
|
||||
0, FSCC, 037, "fsst",
|
||||
0, FSCC, 021, "fsseq",
|
||||
0, FSCC, 036, "fssne",
|
||||
{0, FSCC, 001, "fseq"},
|
||||
{0, FSCC, 016, "fsne"},
|
||||
{0, FSCC, 022, "fsgt"},
|
||||
{0, FSCC, 035, "fsngt"},
|
||||
{0, FSCC, 023, "fsge"},
|
||||
{0, FSCC, 034, "fsnge"},
|
||||
{0, FSCC, 024, "fslt"},
|
||||
{0, FSCC, 033, "fsnlt"},
|
||||
{0, FSCC, 025, "fsle"},
|
||||
{0, FSCC, 032, "fsnle"},
|
||||
{0, FSCC, 026, "fsgl"},
|
||||
{0, FSCC, 031, "fsngl"},
|
||||
{0, FSCC, 027, "fsgle"},
|
||||
{0, FSCC, 030, "fsngle"},
|
||||
{0, FSCC, 002, "fsogt"},
|
||||
{0, FSCC, 015, "fsule"},
|
||||
{0, FSCC, 003, "fsoge"},
|
||||
{0, FSCC, 014, "fsult"},
|
||||
{0, FSCC, 004, "fsolt"},
|
||||
{0, FSCC, 013, "fsuge"},
|
||||
{0, FSCC, 005, "fsole"},
|
||||
{0, FSCC, 012, "fsugt"},
|
||||
{0, FSCC, 006, "fsogl"},
|
||||
{0, FSCC, 011, "fsueq"},
|
||||
{0, FSCC, 007, "fsor"},
|
||||
{0, FSCC, 010, "fsun"},
|
||||
{0, FSCC, 000, "fsf"},
|
||||
{0, FSCC, 017, "fst"},
|
||||
{0, FSCC, 020, "fssf"},
|
||||
{0, FSCC, 037, "fsst"},
|
||||
{0, FSCC, 021, "fsseq"},
|
||||
{0, FSCC, 036, "fssne"},
|
||||
|
||||
0, FTST, 0, "ftst",
|
||||
{0, FTST, 0, "ftst"},
|
||||
|
||||
0, FSAVRES, MEM|ALT|0430, "fsave",
|
||||
0, FSAVRES, MEM|0540, "frestore",
|
||||
{0, FSAVRES, MEM|ALT|0430, "fsave"},
|
||||
{0, FSAVRES, MEM|0540, "frestore"},
|
||||
|
||||
0, FTRAPCC, 001, "ftrapeq",
|
||||
0, FTRAPCC, 016, "ftrapne",
|
||||
0, FTRAPCC, 022, "ftrapgt",
|
||||
0, FTRAPCC, 035, "ftrapngt",
|
||||
0, FTRAPCC, 023, "ftrapge",
|
||||
0, FTRAPCC, 034, "ftrapnge",
|
||||
0, FTRAPCC, 024, "ftraplt",
|
||||
0, FTRAPCC, 033, "ftrapnlt",
|
||||
0, FTRAPCC, 025, "ftraple",
|
||||
0, FTRAPCC, 032, "ftrapnle",
|
||||
0, FTRAPCC, 026, "ftrapgl",
|
||||
0, FTRAPCC, 031, "ftrapngl",
|
||||
0, FTRAPCC, 027, "ftrapgle",
|
||||
0, FTRAPCC, 030, "ftrapngle",
|
||||
0, FTRAPCC, 002, "ftrapogt",
|
||||
0, FTRAPCC, 015, "ftrapule",
|
||||
0, FTRAPCC, 003, "ftrapoge",
|
||||
0, FTRAPCC, 014, "ftrapult",
|
||||
0, FTRAPCC, 004, "ftrapolt",
|
||||
0, FTRAPCC, 013, "ftrapuge",
|
||||
0, FTRAPCC, 005, "ftrapole",
|
||||
0, FTRAPCC, 012, "ftrapugt",
|
||||
0, FTRAPCC, 006, "ftrapogl",
|
||||
0, FTRAPCC, 011, "ftrapueq",
|
||||
0, FTRAPCC, 007, "ftrapor",
|
||||
0, FTRAPCC, 010, "ftrapun",
|
||||
0, FTRAPCC, 000, "ftrapf",
|
||||
0, FTRAPCC, 017, "ftrapt",
|
||||
0, FTRAPCC, 020, "ftrapsf",
|
||||
0, FTRAPCC, 037, "ftrapst",
|
||||
0, FTRAPCC, 021, "ftrapseq",
|
||||
0, FTRAPCC, 036, "ftrapsne",
|
||||
{0, FTRAPCC, 001, "ftrapeq"},
|
||||
{0, FTRAPCC, 016, "ftrapne"},
|
||||
{0, FTRAPCC, 022, "ftrapgt"},
|
||||
{0, FTRAPCC, 035, "ftrapngt"},
|
||||
{0, FTRAPCC, 023, "ftrapge"},
|
||||
{0, FTRAPCC, 034, "ftrapnge"},
|
||||
{0, FTRAPCC, 024, "ftraplt"},
|
||||
{0, FTRAPCC, 033, "ftrapnlt"},
|
||||
{0, FTRAPCC, 025, "ftraple"},
|
||||
{0, FTRAPCC, 032, "ftrapnle"},
|
||||
{0, FTRAPCC, 026, "ftrapgl"},
|
||||
{0, FTRAPCC, 031, "ftrapngl"},
|
||||
{0, FTRAPCC, 027, "ftrapgle"},
|
||||
{0, FTRAPCC, 030, "ftrapngle"},
|
||||
{0, FTRAPCC, 002, "ftrapogt"},
|
||||
{0, FTRAPCC, 015, "ftrapule"},
|
||||
{0, FTRAPCC, 003, "ftrapoge"},
|
||||
{0, FTRAPCC, 014, "ftrapult"},
|
||||
{0, FTRAPCC, 004, "ftrapolt"},
|
||||
{0, FTRAPCC, 013, "ftrapuge"},
|
||||
{0, FTRAPCC, 005, "ftrapole"},
|
||||
{0, FTRAPCC, 012, "ftrapugt"},
|
||||
{0, FTRAPCC, 006, "ftrapogl"},
|
||||
{0, FTRAPCC, 011, "ftrapueq"},
|
||||
{0, FTRAPCC, 007, "ftrapor"},
|
||||
{0, FTRAPCC, 010, "ftrapun"},
|
||||
{0, FTRAPCC, 000, "ftrapf"},
|
||||
{0, FTRAPCC, 017, "ftrapt"},
|
||||
{0, FTRAPCC, 020, "ftrapsf"},
|
||||
{0, FTRAPCC, 037, "ftrapst"},
|
||||
{0, FTRAPCC, 021, "ftrapseq"},
|
||||
{0, FTRAPCC, 036, "ftrapsne"},
|
||||
|
||||
0, CP, 00000, "c0",
|
||||
0, CP, 01000, "c1",
|
||||
0, CP, 02000, "c2",
|
||||
0, CP, 03000, "c3",
|
||||
0, CP, 04000, "c4",
|
||||
0, CP, 05000, "c5",
|
||||
0, CP, 06000, "c6",
|
||||
0, CP, 07000, "c7",
|
||||
{0, CP, 00000, "c0"},
|
||||
{0, CP, 01000, "c1"},
|
||||
{0, CP, 02000, "c2"},
|
||||
{0, CP, 03000, "c3"},
|
||||
{0, CP, 04000, "c4"},
|
||||
{0, CP, 05000, "c5"},
|
||||
{0, CP, 06000, "c6"},
|
||||
{0, CP, 07000, "c7"},
|
||||
|
|
|
@ -8,8 +8,7 @@
|
|||
* Motorola 68000/68010 auxiliary functions
|
||||
*/
|
||||
|
||||
static int
|
||||
extension_offset()
|
||||
static int extension_offset(void)
|
||||
{
|
||||
switch(curr_instr) {
|
||||
case MOVEM:
|
||||
|
@ -25,9 +24,9 @@ extension_offset()
|
|||
return 2;
|
||||
}
|
||||
|
||||
ea_1(sz, bits)
|
||||
void ea_1(int sz, int bits)
|
||||
{
|
||||
register flag;
|
||||
register int flag;
|
||||
|
||||
if (mrg_1 > 074)
|
||||
serror("no specials");
|
||||
|
@ -61,7 +60,7 @@ ea_1(sz, bits)
|
|||
emit2(loww(exp_1.val));
|
||||
}
|
||||
|
||||
ea_2(sz, bits)
|
||||
void ea_2(int sz, int bits)
|
||||
{
|
||||
mrg_1 = mrg_2;
|
||||
exp_1 = exp_2;
|
||||
|
@ -69,30 +68,30 @@ ea_2(sz, bits)
|
|||
ea_1(sz, bits);
|
||||
}
|
||||
|
||||
indexmode(hibyte)
|
||||
void indexmode(int hibyte)
|
||||
{
|
||||
Xfit(fitb(exp_2.val));
|
||||
exp_2.val = hibyte | lowb(exp_2.val);
|
||||
}
|
||||
|
||||
checksize(sz, bits)
|
||||
void checksize(int sz, int bits)
|
||||
{
|
||||
if ((bits & (1 << (sz>>6))) == 0)
|
||||
serror("bad size");
|
||||
}
|
||||
|
||||
test68010()
|
||||
void test68010(void)
|
||||
{
|
||||
if (model != 1 && pass == PASS_3)
|
||||
warning("68010 instruction");
|
||||
}
|
||||
|
||||
badoperand()
|
||||
void badoperand(void)
|
||||
{
|
||||
serror("bad operands");
|
||||
}
|
||||
|
||||
shift_op(opc, sz)
|
||||
void shift_op(int opc, int sz)
|
||||
{
|
||||
if (mrg_1 < 010 && mrg_2 < 010) {
|
||||
emit2((opc&0170470) | sz | mrg_1<<9 | mrg_2);
|
||||
|
@ -113,9 +112,9 @@ shift_op(opc, sz)
|
|||
ea_2(SIZE_W, MEM|ALT);
|
||||
}
|
||||
|
||||
bitop(opc)
|
||||
void bitop(int opc)
|
||||
{
|
||||
register bits;
|
||||
register int bits;
|
||||
|
||||
bits = DTA|ALT;
|
||||
if (opc == 0 && (mrg_1 < 010 || mrg_2 != 074))
|
||||
|
@ -134,7 +133,7 @@ bitop(opc)
|
|||
badoperand();
|
||||
}
|
||||
|
||||
add(opc, sz)
|
||||
void add(int opc, int sz)
|
||||
{
|
||||
if ((mrg_2 & 070) == 010)
|
||||
checksize(sz, 2|4);
|
||||
|
@ -168,7 +167,7 @@ add(opc, sz)
|
|||
badoperand();
|
||||
}
|
||||
|
||||
and(opc, sz)
|
||||
void and(int opc, int sz)
|
||||
{
|
||||
if (mrg_1 == 074 && mrg_2 >= 076) { /* ccr or sr */
|
||||
if (sz != SIZE_NON)
|
||||
|
@ -194,7 +193,7 @@ and(opc, sz)
|
|||
badoperand();
|
||||
}
|
||||
|
||||
to_dreg(opc, sz, bits)
|
||||
int to_dreg(int opc, int sz, int bits)
|
||||
{
|
||||
if ((mrg_2 & 070) != 000)
|
||||
return(0);
|
||||
|
@ -203,7 +202,7 @@ to_dreg(opc, sz, bits)
|
|||
return(1);
|
||||
}
|
||||
|
||||
from_dreg(opc, sz, bits)
|
||||
int from_dreg(int opc, int sz, int bits)
|
||||
{
|
||||
if ((mrg_1 & 070) != 000)
|
||||
return(0);
|
||||
|
@ -212,9 +211,9 @@ from_dreg(opc, sz, bits)
|
|||
return(1);
|
||||
}
|
||||
|
||||
cmp(sz)
|
||||
void cmp(int sz)
|
||||
{
|
||||
register opc;
|
||||
register int opc;
|
||||
|
||||
if ((mrg_1&070) == 030 && (mrg_2&070) == 030) {
|
||||
emit2(0130410 | sz | (mrg_1&7) | (mrg_2&7)<<9);
|
||||
|
@ -259,9 +258,9 @@ cmp(sz)
|
|||
badoperand();
|
||||
}
|
||||
|
||||
move(sz)
|
||||
void move(int sz)
|
||||
{
|
||||
register opc;
|
||||
register int opc;
|
||||
|
||||
if (mrg_1 > 074 || mrg_2 > 074) {
|
||||
move_special(sz);
|
||||
|
@ -291,7 +290,7 @@ move(sz)
|
|||
ea_2(sz, ALT);
|
||||
}
|
||||
|
||||
move_special(sz)
|
||||
void move_special(int sz)
|
||||
{
|
||||
if (mrg_2 >= 076) {
|
||||
if (sz != SIZE_NON)
|
||||
|
@ -322,9 +321,7 @@ move_special(sz)
|
|||
badoperand();
|
||||
}
|
||||
|
||||
int
|
||||
reverse(regs, max)
|
||||
register int regs;
|
||||
int reverse(register int regs, int max)
|
||||
{
|
||||
register int r, i;
|
||||
|
||||
|
@ -337,9 +334,9 @@ reverse(regs, max)
|
|||
return regs;
|
||||
}
|
||||
|
||||
movem(dr, sz, regs)
|
||||
void movem(int dr, int sz, int regs)
|
||||
{
|
||||
register i;
|
||||
register int i;
|
||||
|
||||
if ((mrg_2>>3) == 04) {
|
||||
regs = reverse(regs, 16);
|
||||
|
@ -359,7 +356,7 @@ movem(dr, sz, regs)
|
|||
ea_2(sz, i);
|
||||
}
|
||||
|
||||
movep(sz)
|
||||
void movep(int sz)
|
||||
{
|
||||
checksize(sz, 2|4);
|
||||
if (mrg_1<010 && (mrg_2&070)==050) {
|
||||
|
@ -375,10 +372,9 @@ movep(sz)
|
|||
badoperand();
|
||||
}
|
||||
|
||||
branch(opc, exp)
|
||||
expr_t exp;
|
||||
void branch(int opc, expr_t exp)
|
||||
{
|
||||
register sm;
|
||||
register int sm;
|
||||
|
||||
exp.val -= (DOTVAL + 2);
|
||||
if ((pass == PASS_2)
|
||||
|
@ -406,7 +402,7 @@ expr_t exp;
|
|||
}
|
||||
}
|
||||
|
||||
ea5x73(rg, sz)
|
||||
void ea5x73(int rg, int sz)
|
||||
{
|
||||
if ((exp_2.typ & ~S_DOT) == DOTTYP) {
|
||||
/* pc relative with index */
|
||||
|
@ -426,9 +422,9 @@ ea5x73(rg, sz)
|
|||
badoperand();
|
||||
}
|
||||
|
||||
ea707172(sz)
|
||||
void ea707172(int sz)
|
||||
{
|
||||
register sm;
|
||||
register int sm;
|
||||
|
||||
mrg_2 = 071;
|
||||
switch (sz) {
|
||||
|
@ -474,20 +470,20 @@ ea707172(sz)
|
|||
}
|
||||
}
|
||||
|
||||
ea6x(rg, ir, sz)
|
||||
void ea6x(int rg, int ir, int sz)
|
||||
{
|
||||
mrg_2 = 060 | rg;
|
||||
checksize(sz, 2|4);
|
||||
indexmode(ir<<12 | (sz&0200)<<4);
|
||||
}
|
||||
|
||||
ea72()
|
||||
void ea72(void)
|
||||
{
|
||||
mrg_2 = 072;
|
||||
exp_2.val -= (DOTVAL + extension_offset());
|
||||
}
|
||||
|
||||
ea73(ri, sz)
|
||||
void ea73(int ri, int sz)
|
||||
{
|
||||
mrg_2 = 073;
|
||||
exp_2.val -= (DOTVAL + extension_offset());
|
||||
|
@ -495,15 +491,14 @@ ea73(ri, sz)
|
|||
indexmode(ri<<12 | (sz&0200)<<4);
|
||||
}
|
||||
|
||||
Xnofit()
|
||||
void Xnofit(void)
|
||||
{
|
||||
if (pass == PASS_3) serror("too big");
|
||||
}
|
||||
|
||||
fbranch(opc, exp)
|
||||
expr_t exp;
|
||||
void fbranch(int opc, expr_t exp)
|
||||
{
|
||||
register sm;
|
||||
register int sm;
|
||||
|
||||
exp.val -= (DOTVAL + 2);
|
||||
if ((pass == PASS_2)
|
||||
|
@ -528,14 +523,14 @@ expr_t exp;
|
|||
emit4(exp.val);
|
||||
}
|
||||
|
||||
ch_sz_dreg(size, mode)
|
||||
void ch_sz_dreg(int size, int mode)
|
||||
{
|
||||
if (mode == 0 &&
|
||||
(size == FSIZE_X || size == FSIZE_P || size == FSIZE_D))
|
||||
serror("illegal size for data register");
|
||||
}
|
||||
|
||||
check_fsize(sz, size)
|
||||
void check_fsize(int sz, int size)
|
||||
{
|
||||
if (sz != size) serror("bad size");
|
||||
}
|
||||
|
|
|
@ -115,3 +115,32 @@ extern struct {
|
|||
} mode1, mode2, *mode_ptr ;
|
||||
|
||||
#define not_imm(mode_ptr) if ( (mode_ptr)->m_mode==0x14 ) ill_imm() ;
|
||||
|
||||
|
||||
/* NS Specific routines */
|
||||
void clrmode(void);
|
||||
int ind_mode(int type);
|
||||
void badsyntax(void);
|
||||
void ill_imm(void);
|
||||
void form2(int id, int sval);
|
||||
void form3(int id);
|
||||
void form4(int id);
|
||||
void form5(int id, int sval);
|
||||
void form7x(int id,int i_type);
|
||||
void form8(int id,int reg);
|
||||
void form9(int id,int i_type,int f_type);
|
||||
void form11(int id);
|
||||
void form14(int id,int reg);
|
||||
void frm15_0(int id,int reg);
|
||||
void frm15_1(int id,int i_type,int s_type);
|
||||
void frm15_5(int id);
|
||||
void gen1(int id);
|
||||
void gengen(int id);
|
||||
void disp(register expr_t *expr, int relpc);
|
||||
void putdisp(valu_t val,int size);
|
||||
void dot_adjust(register expr_t *expr);
|
||||
int testsize(int type,int val);
|
||||
void imm(int i_type,register expr_t *expr);
|
||||
int reg_list(int list,int reverse);
|
||||
int cpu_opt(int indic);
|
||||
int string_opt(int indic);
|
||||
|
|
|
@ -9,449 +9,449 @@
|
|||
*/
|
||||
|
||||
/* Registers */
|
||||
0, REG, 0, "r0",
|
||||
0, REG, 1, "r1",
|
||||
0, REG, 2, "r2",
|
||||
0, REG, 3, "r3",
|
||||
0, REG, 4, "r4",
|
||||
0, REG, 5, "r5",
|
||||
0, REG, 6, "r6",
|
||||
0, REG, 7, "r7",
|
||||
0, FREG, 0, "f0",
|
||||
0, FREG, 1, "f1",
|
||||
0, FREG, 2, "f2",
|
||||
0, FREG, 3, "f3",
|
||||
0, FREG, 4, "f4",
|
||||
0, FREG, 5, "f5",
|
||||
0, FREG, 6, "f6",
|
||||
0, FREG, 7, "f7",
|
||||
{0, REG, 0, "r0"},
|
||||
{0, REG, 1, "r1"},
|
||||
{0, REG, 2, "r2"},
|
||||
{0, REG, 3, "r3"},
|
||||
{0, REG, 4, "r4"},
|
||||
{0, REG, 5, "r5"},
|
||||
{0, REG, 6, "r6"},
|
||||
{0, REG, 7, "r7"},
|
||||
{0, FREG, 0, "f0"},
|
||||
{0, FREG, 1, "f1"},
|
||||
{0, FREG, 2, "f2"},
|
||||
{0, FREG, 3, "f3"},
|
||||
{0, FREG, 4, "f4"},
|
||||
{0, FREG, 5, "f5"},
|
||||
{0, FREG, 6, "f6"},
|
||||
{0, FREG, 7, "f7"},
|
||||
/* CPU dedicated registers */
|
||||
0, AREG, 0x0, "us",
|
||||
0, AREG, 0x8, "fp",
|
||||
0, AREG, 0x9, "sp",
|
||||
0, AREG, 0xA, "sb",
|
||||
0, AREG, 0xD, "psr",
|
||||
0, AREG, 0xE, "intbase",
|
||||
0, AREG, 0xF, "mod",
|
||||
{0, AREG, 0x0, "us"},
|
||||
{0, AREG, 0x8, "fp"},
|
||||
{0, AREG, 0x9, "sp"},
|
||||
{0, AREG, 0xA, "sb"},
|
||||
{0, AREG, 0xD, "psr"},
|
||||
{0, AREG, 0xE, "intbase"},
|
||||
{0, AREG, 0xF, "mod"},
|
||||
/* Tokens dedicated to addressing modes */
|
||||
0, TOS, 0x17, "tos",
|
||||
0, EXTERNAL, 0x16, "external",
|
||||
0, PC, 0, "pc",
|
||||
0, INDICATOR, 'b', "b",
|
||||
0, INDICATOR, 'c', "c",
|
||||
0, INDICATOR, 'd', "d",
|
||||
0, INDICATOR, 'f', "f",
|
||||
0, INDICATOR, 'i', "i",
|
||||
0, INDICATOR, 'm', "m",
|
||||
0, INDICATOR, 'q', "q",
|
||||
0, INDICATOR, 'u', "u",
|
||||
0, INDICATOR, 'w', "w",
|
||||
{0, TOS, 0x17, "tos"},
|
||||
{0, EXTERNAL, 0x16, "external"},
|
||||
{0, PC, 0, "pc"},
|
||||
{0, INDICATOR, 'b', "b"},
|
||||
{0, INDICATOR, 'c', "c"},
|
||||
{0, INDICATOR, 'd', "d"},
|
||||
{0, INDICATOR, 'f', "f"},
|
||||
{0, INDICATOR, 'i', "i"},
|
||||
{0, INDICATOR, 'm', "m"},
|
||||
{0, INDICATOR, 'q', "q"},
|
||||
{0, INDICATOR, 'u', "u"},
|
||||
{0, INDICATOR, 'w', "w"},
|
||||
/* Memory management registers */
|
||||
0, MREG, 0x0, "bpr0",
|
||||
0, MREG, 0x1, "bpr1",
|
||||
0, MREG, 0x4, "pf0",
|
||||
0, MREG, 0x5, "pf1",
|
||||
0, MREG, 0x8, "sc",
|
||||
0, MREG, 0xA, "msr",
|
||||
0, MREG, 0xB, "bcnt",
|
||||
0, MREG, 0xC, "ptb0",
|
||||
0, MREG, 0xD, "ptb1",
|
||||
0, MREG, 0xF, "eia",
|
||||
{0, MREG, 0x0, "bpr0"},
|
||||
{0, MREG, 0x1, "bpr1"},
|
||||
{0, MREG, 0x4, "pf0"},
|
||||
{0, MREG, 0x5, "pf1"},
|
||||
{0, MREG, 0x8, "sc"},
|
||||
{0, MREG, 0xA, "msr"},
|
||||
{0, MREG, 0xB, "bcnt"},
|
||||
{0, MREG, 0xC, "ptb0"},
|
||||
{0, MREG, 0xD, "ptb1"},
|
||||
{0, MREG, 0xF, "eia"},
|
||||
/* Instruction types */
|
||||
/* Integer instructions */
|
||||
0, ADD_I, mk_op2(0x5,I_BYTE,I_BYTE), "movb",
|
||||
0, ADD_I, mk_op2(0x5,I_WORD,I_WORD), "movw",
|
||||
0, ADD_I, mk_op2(0x5,I_DOUBLE,I_DOUBLE), "movd",
|
||||
0, ADD_I, mk_op2(0x1,I_BYTE,I_BYTE), "cmpb",
|
||||
0, ADD_I, mk_op2(0x1,I_WORD,I_WORD), "cmpw",
|
||||
0, ADD_I, mk_op2(0x1,I_DOUBLE,I_DOUBLE), "cmpd",
|
||||
0, ADD_I, mk_op2(0x0,I_BYTE,I_BYTE), "addb",
|
||||
0, ADD_I, mk_op2(0x0,I_WORD,I_WORD), "addw",
|
||||
0, ADD_I, mk_op2(0x0,I_DOUBLE,I_DOUBLE), "addd",
|
||||
0, ADD_I, mk_op2(0x4,I_BYTE,I_BYTE), "addcb",
|
||||
0, ADD_I, mk_op2(0x4,I_WORD,I_WORD), "addcw",
|
||||
0, ADD_I, mk_op2(0x4,I_DOUBLE,I_DOUBLE), "addcd",
|
||||
0, ADD_I, mk_op2(0x8,I_BYTE,I_BYTE), "subb",
|
||||
0, ADD_I, mk_op2(0x8,I_WORD,I_WORD), "subw",
|
||||
0, ADD_I, mk_op2(0x8,I_DOUBLE,I_DOUBLE), "subd",
|
||||
0, ADD_I, mk_op2(0xC,I_BYTE,I_BYTE), "subcb",
|
||||
0, ADD_I, mk_op2(0xC,I_WORD,I_WORD), "subcw",
|
||||
0, ADD_I, mk_op2(0xC,I_DOUBLE,I_DOUBLE), "subcd",
|
||||
0, COM, mk_op2(0x8,I_BYTE,I_BYTE), "negb",
|
||||
0, COM, mk_op2(0x8,I_WORD,I_WORD), "negw",
|
||||
0, COM, mk_op2(0x8,I_DOUBLE,I_DOUBLE), "negd",
|
||||
0, COM, mk_op2(0xC,I_BYTE,I_BYTE), "absb",
|
||||
0, COM, mk_op2(0xC,I_WORD,I_WORD), "absw",
|
||||
0, COM, mk_op2(0xC,I_DOUBLE,I_DOUBLE), "absd",
|
||||
0, MUL_I, mk_op2(0x8,I_BYTE,I_BYTE), "mulb",
|
||||
0, MUL_I, mk_op2(0x8,I_WORD,I_WORD), "mulw",
|
||||
0, MUL_I, mk_op2(0x8,I_DOUBLE,I_DOUBLE), "muld",
|
||||
0, MUL_I, mk_op2(0xF,I_BYTE,I_BYTE), "divb",
|
||||
0, MUL_I, mk_op2(0xF,I_WORD,I_WORD), "divw",
|
||||
0, MUL_I, mk_op2(0xF,I_DOUBLE,I_DOUBLE), "divd",
|
||||
0, MUL_I, mk_op2(0xE,I_BYTE,I_BYTE), "modb",
|
||||
0, MUL_I, mk_op2(0xE,I_WORD,I_WORD), "modw",
|
||||
0, MUL_I, mk_op2(0xE,I_DOUBLE,I_DOUBLE), "modd",
|
||||
0, MUL_I, mk_op2(0xC,I_BYTE,I_BYTE), "quob",
|
||||
0, MUL_I, mk_op2(0xC,I_WORD,I_WORD), "quow",
|
||||
0, MUL_I, mk_op2(0xC,I_DOUBLE,I_DOUBLE), "quod",
|
||||
0, MUL_I, mk_op2(0xD,I_BYTE,I_BYTE), "remb",
|
||||
0, MUL_I, mk_op2(0xD,I_WORD,I_WORD), "remw",
|
||||
0, MUL_I, mk_op2(0xD,I_DOUBLE,I_DOUBLE), "remd",
|
||||
0, ADD_I, mk_op2(0xA,I_BYTE,I_BYTE), "andb",
|
||||
0, ADD_I, mk_op2(0xA,I_WORD,I_WORD), "andw",
|
||||
0, ADD_I, mk_op2(0xA,I_DOUBLE,I_DOUBLE), "andd",
|
||||
0, ADD_I, mk_op2(0x6,I_BYTE,I_BYTE), "orb",
|
||||
0, ADD_I, mk_op2(0x6,I_WORD,I_WORD), "orw",
|
||||
0, ADD_I, mk_op2(0x6,I_DOUBLE,I_DOUBLE), "ord",
|
||||
0, ADD_I, mk_op2(0x2,I_BYTE,I_BYTE), "bicb",
|
||||
0, ADD_I, mk_op2(0x2,I_WORD,I_WORD), "bicw",
|
||||
0, ADD_I, mk_op2(0x2,I_DOUBLE,I_DOUBLE), "bicd",
|
||||
0, ADD_I, mk_op2(0xE,I_BYTE,I_BYTE), "xorb",
|
||||
0, ADD_I, mk_op2(0xE,I_WORD,I_WORD), "xorw",
|
||||
0, ADD_I, mk_op2(0xE,I_DOUBLE,I_DOUBLE), "xord",
|
||||
0, COM, mk_op2(0xD,I_BYTE,I_BYTE), "comb",
|
||||
0, COM, mk_op2(0xD,I_WORD,I_WORD), "comw",
|
||||
0, COM, mk_op2(0xD,I_DOUBLE,I_DOUBLE), "comd",
|
||||
0, COM, mk_op2(0x1,I_BYTE,I_BYTE), "ashb",
|
||||
0, COM, mk_op2(0x1,I_BYTE,I_WORD), "ashw",
|
||||
0, COM, mk_op2(0x1,I_BYTE,I_DOUBLE), "ashd",
|
||||
0, COM, mk_op2(0x5,I_BYTE,I_BYTE), "lshb",
|
||||
0, COM, mk_op2(0x5,I_BYTE,I_WORD), "lshw",
|
||||
0, COM, mk_op2(0x5,I_BYTE,I_DOUBLE), "lshd",
|
||||
0, COM, mk_op2(0x0,I_BYTE,I_BYTE), "rotb",
|
||||
0, COM, mk_op2(0x0,I_BYTE,I_WORD), "rotw",
|
||||
0, COM, mk_op2(0x0,I_BYTE,I_DOUBLE), "rotd",
|
||||
0, MOVID, mk_op2(0x4,I_BYTE,I_WORD), "movxbw",
|
||||
0, MOVID, mk_op2(0x7,I_BYTE,I_DOUBLE), "movxbd",
|
||||
0, MOVID, mk_op2(0x7,I_WORD,I_DOUBLE), "movxwd",
|
||||
0, MOVID, mk_op2(0x5,I_BYTE,I_WORD), "movzbw",
|
||||
0, MOVID, mk_op2(0x6,I_BYTE,I_DOUBLE), "movzbd",
|
||||
0, MOVID, mk_op2(0x6,I_WORD,I_DOUBLE), "movzwd",
|
||||
{0, ADD_I, mk_op2(0x5,I_BYTE,I_BYTE), "movb"},
|
||||
{0, ADD_I, mk_op2(0x5,I_WORD,I_WORD), "movw"},
|
||||
{0, ADD_I, mk_op2(0x5,I_DOUBLE,I_DOUBLE), "movd"},
|
||||
{0, ADD_I, mk_op2(0x1,I_BYTE,I_BYTE), "cmpb"},
|
||||
{0, ADD_I, mk_op2(0x1,I_WORD,I_WORD), "cmpw"},
|
||||
{0, ADD_I, mk_op2(0x1,I_DOUBLE,I_DOUBLE), "cmpd"},
|
||||
{0, ADD_I, mk_op2(0x0,I_BYTE,I_BYTE), "addb"},
|
||||
{0, ADD_I, mk_op2(0x0,I_WORD,I_WORD), "addw"},
|
||||
{0, ADD_I, mk_op2(0x0,I_DOUBLE,I_DOUBLE), "addd"},
|
||||
{0, ADD_I, mk_op2(0x4,I_BYTE,I_BYTE), "addcb"},
|
||||
{0, ADD_I, mk_op2(0x4,I_WORD,I_WORD), "addcw"},
|
||||
{0, ADD_I, mk_op2(0x4,I_DOUBLE,I_DOUBLE), "addcd"},
|
||||
{0, ADD_I, mk_op2(0x8,I_BYTE,I_BYTE), "subb"},
|
||||
{0, ADD_I, mk_op2(0x8,I_WORD,I_WORD), "subw"},
|
||||
{0, ADD_I, mk_op2(0x8,I_DOUBLE,I_DOUBLE), "subd"},
|
||||
{0, ADD_I, mk_op2(0xC,I_BYTE,I_BYTE), "subcb"},
|
||||
{0, ADD_I, mk_op2(0xC,I_WORD,I_WORD), "subcw"},
|
||||
{0, ADD_I, mk_op2(0xC,I_DOUBLE,I_DOUBLE), "subcd"},
|
||||
{0, COM, mk_op2(0x8,I_BYTE,I_BYTE), "negb"},
|
||||
{0, COM, mk_op2(0x8,I_WORD,I_WORD), "negw"},
|
||||
{0, COM, mk_op2(0x8,I_DOUBLE,I_DOUBLE), "negd"},
|
||||
{0, COM, mk_op2(0xC,I_BYTE,I_BYTE), "absb"},
|
||||
{0, COM, mk_op2(0xC,I_WORD,I_WORD), "absw"},
|
||||
{0, COM, mk_op2(0xC,I_DOUBLE,I_DOUBLE), "absd"},
|
||||
{0, MUL_I, mk_op2(0x8,I_BYTE,I_BYTE), "mulb"},
|
||||
{0, MUL_I, mk_op2(0x8,I_WORD,I_WORD), "mulw"},
|
||||
{0, MUL_I, mk_op2(0x8,I_DOUBLE,I_DOUBLE), "muld"},
|
||||
{0, MUL_I, mk_op2(0xF,I_BYTE,I_BYTE), "divb"},
|
||||
{0, MUL_I, mk_op2(0xF,I_WORD,I_WORD), "divw"},
|
||||
{0, MUL_I, mk_op2(0xF,I_DOUBLE,I_DOUBLE), "divd"},
|
||||
{0, MUL_I, mk_op2(0xE,I_BYTE,I_BYTE), "modb"},
|
||||
{0, MUL_I, mk_op2(0xE,I_WORD,I_WORD), "modw"},
|
||||
{0, MUL_I, mk_op2(0xE,I_DOUBLE,I_DOUBLE), "modd"},
|
||||
{0, MUL_I, mk_op2(0xC,I_BYTE,I_BYTE), "quob"},
|
||||
{0, MUL_I, mk_op2(0xC,I_WORD,I_WORD), "quow"},
|
||||
{0, MUL_I, mk_op2(0xC,I_DOUBLE,I_DOUBLE), "quod"},
|
||||
{0, MUL_I, mk_op2(0xD,I_BYTE,I_BYTE), "remb"},
|
||||
{0, MUL_I, mk_op2(0xD,I_WORD,I_WORD), "remw"},
|
||||
{0, MUL_I, mk_op2(0xD,I_DOUBLE,I_DOUBLE), "remd"},
|
||||
{0, ADD_I, mk_op2(0xA,I_BYTE,I_BYTE), "andb"},
|
||||
{0, ADD_I, mk_op2(0xA,I_WORD,I_WORD), "andw"},
|
||||
{0, ADD_I, mk_op2(0xA,I_DOUBLE,I_DOUBLE), "andd"},
|
||||
{0, ADD_I, mk_op2(0x6,I_BYTE,I_BYTE), "orb"},
|
||||
{0, ADD_I, mk_op2(0x6,I_WORD,I_WORD), "orw"},
|
||||
{0, ADD_I, mk_op2(0x6,I_DOUBLE,I_DOUBLE), "ord"},
|
||||
{0, ADD_I, mk_op2(0x2,I_BYTE,I_BYTE), "bicb"},
|
||||
{0, ADD_I, mk_op2(0x2,I_WORD,I_WORD), "bicw"},
|
||||
{0, ADD_I, mk_op2(0x2,I_DOUBLE,I_DOUBLE), "bicd"},
|
||||
{0, ADD_I, mk_op2(0xE,I_BYTE,I_BYTE), "xorb"},
|
||||
{0, ADD_I, mk_op2(0xE,I_WORD,I_WORD), "xorw"},
|
||||
{0, ADD_I, mk_op2(0xE,I_DOUBLE,I_DOUBLE), "xord"},
|
||||
{0, COM, mk_op2(0xD,I_BYTE,I_BYTE), "comb"},
|
||||
{0, COM, mk_op2(0xD,I_WORD,I_WORD), "comw"},
|
||||
{0, COM, mk_op2(0xD,I_DOUBLE,I_DOUBLE), "comd"},
|
||||
{0, COM, mk_op2(0x1,I_BYTE,I_BYTE), "ashb"},
|
||||
{0, COM, mk_op2(0x1,I_BYTE,I_WORD), "ashw"},
|
||||
{0, COM, mk_op2(0x1,I_BYTE,I_DOUBLE), "ashd"},
|
||||
{0, COM, mk_op2(0x5,I_BYTE,I_BYTE), "lshb"},
|
||||
{0, COM, mk_op2(0x5,I_BYTE,I_WORD), "lshw"},
|
||||
{0, COM, mk_op2(0x5,I_BYTE,I_DOUBLE), "lshd"},
|
||||
{0, COM, mk_op2(0x0,I_BYTE,I_BYTE), "rotb"},
|
||||
{0, COM, mk_op2(0x0,I_BYTE,I_WORD), "rotw"},
|
||||
{0, COM, mk_op2(0x0,I_BYTE,I_DOUBLE), "rotd"},
|
||||
{0, MOVID, mk_op2(0x4,I_BYTE,I_WORD), "movxbw"},
|
||||
{0, MOVID, mk_op2(0x7,I_BYTE,I_DOUBLE), "movxbd"},
|
||||
{0, MOVID, mk_op2(0x7,I_WORD,I_DOUBLE), "movxwd"},
|
||||
{0, MOVID, mk_op2(0x5,I_BYTE,I_WORD), "movzbw"},
|
||||
{0, MOVID, mk_op2(0x6,I_BYTE,I_DOUBLE), "movzbd"},
|
||||
{0, MOVID, mk_op2(0x6,I_WORD,I_DOUBLE), "movzwd"},
|
||||
#ifdef UNUSED
|
||||
0, MOVID, mk_op2(0x7,I_DOUBLE,I_DOUBLE), "movxdd",
|
||||
0, MOVID, mk_op2(0x6,I_DOUBLE,I_DOUBLE), "movzdd",
|
||||
{0, MOVID, mk_op2(0x7,I_DOUBLE,I_DOUBLE), "movxdd"},
|
||||
{0, MOVID, mk_op2(0x6,I_DOUBLE,I_DOUBLE), "movzdd"},
|
||||
#endif
|
||||
0, ADD_I, mk_op2(0x9,I_DOUBLE,I_DOUBLE), "addr",
|
||||
{0, ADD_I, mk_op2(0x9,I_DOUBLE,I_DOUBLE), "addr"},
|
||||
/* Quick integer instructions */
|
||||
0, MOVQ, mk_op1(0x5,I_BYTE), "movqb",
|
||||
0, MOVQ, mk_op1(0x5,I_WORD), "movqw",
|
||||
0, MOVQ, mk_op1(0x5,I_DOUBLE), "movqd",
|
||||
0, MOVQ, mk_op1(0x1,I_BYTE), "cmpqb",
|
||||
0, MOVQ, mk_op1(0x1,I_WORD), "cmpqw",
|
||||
0, MOVQ, mk_op1(0x1,I_DOUBLE), "cmpqd",
|
||||
0, MOVQ, mk_op1(0x0,I_BYTE), "addqb",
|
||||
0, MOVQ, mk_op1(0x0,I_WORD), "addqw",
|
||||
0, MOVQ, mk_op1(0x0,I_DOUBLE), "addqd",
|
||||
{0, MOVQ, mk_op1(0x5,I_BYTE), "movqb"},
|
||||
{0, MOVQ, mk_op1(0x5,I_WORD), "movqw"},
|
||||
{0, MOVQ, mk_op1(0x5,I_DOUBLE), "movqd"},
|
||||
{0, MOVQ, mk_op1(0x1,I_BYTE), "cmpqb"},
|
||||
{0, MOVQ, mk_op1(0x1,I_WORD), "cmpqw"},
|
||||
{0, MOVQ, mk_op1(0x1,I_DOUBLE), "cmpqd"},
|
||||
{0, MOVQ, mk_op1(0x0,I_BYTE), "addqb"},
|
||||
{0, MOVQ, mk_op1(0x0,I_WORD), "addqw"},
|
||||
{0, MOVQ, mk_op1(0x0,I_DOUBLE), "addqd"},
|
||||
/* Extended integer instructions */
|
||||
0, MUL_I, mk_op2(0x9,I_BYTE,I_BYTE), "meib",
|
||||
0, MUL_I, mk_op2(0x9,I_WORD,I_WORD), "meiw",
|
||||
0, MUL_I, mk_op2(0x9,I_DOUBLE,I_DOUBLE), "meid",
|
||||
0, MUL_I, mk_op2(0xB,I_BYTE,I_BYTE), "deib",
|
||||
0, MUL_I, mk_op2(0xB,I_WORD,I_WORD), "deiw",
|
||||
0, MUL_I, mk_op2(0xB,I_DOUBLE,I_DOUBLE), "deid",
|
||||
{0, MUL_I, mk_op2(0x9,I_BYTE,I_BYTE), "meib"},
|
||||
{0, MUL_I, mk_op2(0x9,I_WORD,I_WORD), "meiw"},
|
||||
{0, MUL_I, mk_op2(0x9,I_DOUBLE,I_DOUBLE), "meid"},
|
||||
{0, MUL_I, mk_op2(0xB,I_BYTE,I_BYTE), "deib"},
|
||||
{0, MUL_I, mk_op2(0xB,I_WORD,I_WORD), "deiw"},
|
||||
{0, MUL_I, mk_op2(0xB,I_DOUBLE,I_DOUBLE), "deid"},
|
||||
/* Boolean instructions */
|
||||
0, COM, mk_op2(0x9,I_BYTE,I_BYTE), "notb",
|
||||
0, COM, mk_op2(0x9,I_WORD,I_WORD), "notw",
|
||||
0, COM, mk_op2(0x9,I_DOUBLE,I_DOUBLE), "notd",
|
||||
0, SEQ, mk_op1c(0x3,I_BYTE,B_EQ), "seqb",
|
||||
0, SEQ, mk_op1c(0x3,I_WORD,B_EQ), "seqw",
|
||||
0, SEQ, mk_op1c(0x3,I_DOUBLE,B_EQ), "seqd",
|
||||
0, SEQ, mk_op1c(0x3,I_BYTE,B_NE), "sneb",
|
||||
0, SEQ, mk_op1c(0x3,I_WORD,B_NE), "snew",
|
||||
0, SEQ, mk_op1c(0x3,I_DOUBLE,B_NE), "sned",
|
||||
0, SEQ, mk_op1c(0x3,I_BYTE,B_CS), "scsb",
|
||||
0, SEQ, mk_op1c(0x3,I_WORD,B_CS), "scsw",
|
||||
0, SEQ, mk_op1c(0x3,I_DOUBLE,B_CS), "scsd",
|
||||
0, SEQ, mk_op1c(0x3,I_BYTE,B_CC), "sccb",
|
||||
0, SEQ, mk_op1c(0x3,I_WORD,B_CC), "sccw",
|
||||
0, SEQ, mk_op1c(0x3,I_DOUBLE,B_CC), "sccd",
|
||||
0, SEQ, mk_op1c(0x3,I_BYTE,B_HI), "shib",
|
||||
0, SEQ, mk_op1c(0x3,I_WORD,B_HI), "shiw",
|
||||
0, SEQ, mk_op1c(0x3,I_DOUBLE,B_HI), "shid",
|
||||
0, SEQ, mk_op1c(0x3,I_BYTE,B_LS), "slsb",
|
||||
0, SEQ, mk_op1c(0x3,I_WORD,B_LS), "slsw",
|
||||
0, SEQ, mk_op1c(0x3,I_DOUBLE,B_LS), "slsd",
|
||||
0, SEQ, mk_op1c(0x3,I_BYTE,B_GT), "sgtb",
|
||||
0, SEQ, mk_op1c(0x3,I_WORD,B_GT), "sgtw",
|
||||
0, SEQ, mk_op1c(0x3,I_DOUBLE,B_GT), "sgtd",
|
||||
0, SEQ, mk_op1c(0x3,I_BYTE,B_LE), "sleb",
|
||||
0, SEQ, mk_op1c(0x3,I_WORD,B_LE), "slew",
|
||||
0, SEQ, mk_op1c(0x3,I_DOUBLE,B_LE), "sled",
|
||||
0, SEQ, mk_op1c(0x3,I_BYTE,B_FS), "sfsb",
|
||||
0, SEQ, mk_op1c(0x3,I_WORD,B_FS), "sfsw",
|
||||
0, SEQ, mk_op1c(0x3,I_DOUBLE,B_FS), "sfsd",
|
||||
0, SEQ, mk_op1c(0x3,I_BYTE,B_FC), "sfcb",
|
||||
0, SEQ, mk_op1c(0x3,I_WORD,B_FC), "sfcw",
|
||||
0, SEQ, mk_op1c(0x3,I_DOUBLE,B_FC), "sfcd",
|
||||
0, SEQ, mk_op1c(0x3,I_BYTE,B_LO), "slob",
|
||||
0, SEQ, mk_op1c(0x3,I_WORD,B_LO), "slow",
|
||||
0, SEQ, mk_op1c(0x3,I_DOUBLE,B_LO), "slod",
|
||||
0, SEQ, mk_op1c(0x3,I_BYTE,B_HS), "shsb",
|
||||
0, SEQ, mk_op1c(0x3,I_WORD,B_HS), "shsw",
|
||||
0, SEQ, mk_op1c(0x3,I_DOUBLE,B_HS), "shsd",
|
||||
0, SEQ, mk_op1c(0x3,I_BYTE,B_LT), "sltb",
|
||||
0, SEQ, mk_op1c(0x3,I_WORD,B_LT), "sltw",
|
||||
0, SEQ, mk_op1c(0x3,I_DOUBLE,B_LT), "sltd",
|
||||
0, SEQ, mk_op1c(0x3,I_BYTE,B_GE), "sgeb",
|
||||
0, SEQ, mk_op1c(0x3,I_WORD,B_GE), "sgew",
|
||||
0, SEQ, mk_op1c(0x3,I_DOUBLE,B_GE), "sged",
|
||||
{0, COM, mk_op2(0x9,I_BYTE,I_BYTE), "notb"},
|
||||
{0, COM, mk_op2(0x9,I_WORD,I_WORD), "notw"},
|
||||
{0, COM, mk_op2(0x9,I_DOUBLE,I_DOUBLE), "notd"},
|
||||
{0, SEQ, mk_op1c(0x3,I_BYTE,B_EQ), "seqb"},
|
||||
{0, SEQ, mk_op1c(0x3,I_WORD,B_EQ), "seqw"},
|
||||
{0, SEQ, mk_op1c(0x3,I_DOUBLE,B_EQ), "seqd"},
|
||||
{0, SEQ, mk_op1c(0x3,I_BYTE,B_NE), "sneb"},
|
||||
{0, SEQ, mk_op1c(0x3,I_WORD,B_NE), "snew"},
|
||||
{0, SEQ, mk_op1c(0x3,I_DOUBLE,B_NE), "sned"},
|
||||
{0, SEQ, mk_op1c(0x3,I_BYTE,B_CS), "scsb"},
|
||||
{0, SEQ, mk_op1c(0x3,I_WORD,B_CS), "scsw"},
|
||||
{0, SEQ, mk_op1c(0x3,I_DOUBLE,B_CS), "scsd"},
|
||||
{0, SEQ, mk_op1c(0x3,I_BYTE,B_CC), "sccb"},
|
||||
{0, SEQ, mk_op1c(0x3,I_WORD,B_CC), "sccw"},
|
||||
{0, SEQ, mk_op1c(0x3,I_DOUBLE,B_CC), "sccd"},
|
||||
{0, SEQ, mk_op1c(0x3,I_BYTE,B_HI), "shib"},
|
||||
{0, SEQ, mk_op1c(0x3,I_WORD,B_HI), "shiw"},
|
||||
{0, SEQ, mk_op1c(0x3,I_DOUBLE,B_HI), "shid"},
|
||||
{0, SEQ, mk_op1c(0x3,I_BYTE,B_LS), "slsb"},
|
||||
{0, SEQ, mk_op1c(0x3,I_WORD,B_LS), "slsw"},
|
||||
{0, SEQ, mk_op1c(0x3,I_DOUBLE,B_LS), "slsd"},
|
||||
{0, SEQ, mk_op1c(0x3,I_BYTE,B_GT), "sgtb"},
|
||||
{0, SEQ, mk_op1c(0x3,I_WORD,B_GT), "sgtw"},
|
||||
{0, SEQ, mk_op1c(0x3,I_DOUBLE,B_GT), "sgtd"},
|
||||
{0, SEQ, mk_op1c(0x3,I_BYTE,B_LE), "sleb"},
|
||||
{0, SEQ, mk_op1c(0x3,I_WORD,B_LE), "slew"},
|
||||
{0, SEQ, mk_op1c(0x3,I_DOUBLE,B_LE), "sled"},
|
||||
{0, SEQ, mk_op1c(0x3,I_BYTE,B_FS), "sfsb"},
|
||||
{0, SEQ, mk_op1c(0x3,I_WORD,B_FS), "sfsw"},
|
||||
{0, SEQ, mk_op1c(0x3,I_DOUBLE,B_FS), "sfsd"},
|
||||
{0, SEQ, mk_op1c(0x3,I_BYTE,B_FC), "sfcb"},
|
||||
{0, SEQ, mk_op1c(0x3,I_WORD,B_FC), "sfcw"},
|
||||
{0, SEQ, mk_op1c(0x3,I_DOUBLE,B_FC), "sfcd"},
|
||||
{0, SEQ, mk_op1c(0x3,I_BYTE,B_LO), "slob"},
|
||||
{0, SEQ, mk_op1c(0x3,I_WORD,B_LO), "slow"},
|
||||
{0, SEQ, mk_op1c(0x3,I_DOUBLE,B_LO), "slod"},
|
||||
{0, SEQ, mk_op1c(0x3,I_BYTE,B_HS), "shsb"},
|
||||
{0, SEQ, mk_op1c(0x3,I_WORD,B_HS), "shsw"},
|
||||
{0, SEQ, mk_op1c(0x3,I_DOUBLE,B_HS), "shsd"},
|
||||
{0, SEQ, mk_op1c(0x3,I_BYTE,B_LT), "sltb"},
|
||||
{0, SEQ, mk_op1c(0x3,I_WORD,B_LT), "sltw"},
|
||||
{0, SEQ, mk_op1c(0x3,I_DOUBLE,B_LT), "sltd"},
|
||||
{0, SEQ, mk_op1c(0x3,I_BYTE,B_GE), "sgeb"},
|
||||
{0, SEQ, mk_op1c(0x3,I_WORD,B_GE), "sgew"},
|
||||
{0, SEQ, mk_op1c(0x3,I_DOUBLE,B_GE), "sged"},
|
||||
#ifdef UNUSED
|
||||
0, SEQ, mk_op1c(0x3,I_BYTE,B_TRUE), "strueb",
|
||||
0, SEQ, mk_op1c(0x3,I_WORD,B_TRUE), "struew",
|
||||
0, SEQ, mk_op1c(0x3,I_DOUBLE,B_TRUE), "strued",
|
||||
0, SEQ, mk_op1c(0x3,I_BYTE,B_FALSE), "sfalseb",
|
||||
0, SEQ, mk_op1c(0x3,I_WORD,B_FALSE), "sfalsew",
|
||||
0, SEQ, mk_op1c(0x3,I_DOUBLE,B_FALSE), "sfalsed",
|
||||
{0, SEQ, mk_op1c(0x3,I_BYTE,B_TRUE), "strueb"},
|
||||
{0, SEQ, mk_op1c(0x3,I_WORD,B_TRUE), "struew"},
|
||||
{0, SEQ, mk_op1c(0x3,I_DOUBLE,B_TRUE), "strued"},
|
||||
{0, SEQ, mk_op1c(0x3,I_BYTE,B_FALSE), "sfalseb"},
|
||||
{0, SEQ, mk_op1c(0x3,I_WORD,B_FALSE), "sfalsew"},
|
||||
{0, SEQ, mk_op1c(0x3,I_DOUBLE,B_FALSE), "sfalsed"},
|
||||
#endif
|
||||
/* Bit instructions */
|
||||
0, ADD_I, mk_op2(0xD,I_BYTE,I_BYTE), "tbitb",
|
||||
0, ADD_I, mk_op2(0xD,I_WORD,I_WORD), "tbitw",
|
||||
0, ADD_I, mk_op2(0xD,I_DOUBLE,I_DOUBLE), "tbitd",
|
||||
0, COM, mk_op2(0x6,I_BYTE,I_BYTE), "sbitb",
|
||||
0, COM, mk_op2(0x6,I_WORD,I_WORD), "sbitw",
|
||||
0, COM, mk_op2(0x6,I_DOUBLE,I_DOUBLE), "sbitd",
|
||||
0, COM, mk_op2(0x7,I_BYTE,I_BYTE), "sbitib",
|
||||
0, COM, mk_op2(0x7,I_WORD,I_WORD), "sbitiw",
|
||||
0, COM, mk_op2(0x7,I_DOUBLE,I_DOUBLE), "sbitid",
|
||||
0, COM, mk_op2(0x2,I_BYTE,I_BYTE), "cbitb",
|
||||
0, COM, mk_op2(0x2,I_WORD,I_WORD), "cbitw",
|
||||
0, COM, mk_op2(0x2,I_DOUBLE,I_DOUBLE), "cbitd",
|
||||
0, COM, mk_op2(0x3,I_BYTE,I_BYTE), "cbitib",
|
||||
0, COM, mk_op2(0x3,I_WORD,I_WORD), "cbitiw",
|
||||
0, COM, mk_op2(0x3,I_DOUBLE,I_DOUBLE), "cbitid",
|
||||
0, COM, mk_op2(0xE,I_BYTE,I_BYTE), "ibitb",
|
||||
0, COM, mk_op2(0xE,I_WORD,I_WORD), "ibitw",
|
||||
0, COM, mk_op2(0xE,I_DOUBLE,I_DOUBLE), "ibitd",
|
||||
0, CHECK, mk_op1(0x1,I_DOUBLE), "cvtp",
|
||||
0, FFS, mk_op2c(0x5,I_BYTE,I_BYTE,0), "ffsb",
|
||||
0, FFS, mk_op2c(0x5,I_WORD,I_BYTE,0), "ffsw",
|
||||
0, FFS, mk_op2c(0x5,I_DOUBLE,I_BYTE,0), "ffsd",
|
||||
{0, ADD_I, mk_op2(0xD,I_BYTE,I_BYTE), "tbitb"},
|
||||
{0, ADD_I, mk_op2(0xD,I_WORD,I_WORD), "tbitw"},
|
||||
{0, ADD_I, mk_op2(0xD,I_DOUBLE,I_DOUBLE), "tbitd"},
|
||||
{0, COM, mk_op2(0x6,I_BYTE,I_BYTE), "sbitb"},
|
||||
{0, COM, mk_op2(0x6,I_WORD,I_WORD), "sbitw"},
|
||||
{0, COM, mk_op2(0x6,I_DOUBLE,I_DOUBLE), "sbitd"},
|
||||
{0, COM, mk_op2(0x7,I_BYTE,I_BYTE), "sbitib"},
|
||||
{0, COM, mk_op2(0x7,I_WORD,I_WORD), "sbitiw"},
|
||||
{0, COM, mk_op2(0x7,I_DOUBLE,I_DOUBLE), "sbitid"},
|
||||
{0, COM, mk_op2(0x2,I_BYTE,I_BYTE), "cbitb"},
|
||||
{0, COM, mk_op2(0x2,I_WORD,I_WORD), "cbitw"},
|
||||
{0, COM, mk_op2(0x2,I_DOUBLE,I_DOUBLE), "cbitd"},
|
||||
{0, COM, mk_op2(0x3,I_BYTE,I_BYTE), "cbitib"},
|
||||
{0, COM, mk_op2(0x3,I_WORD,I_WORD), "cbitiw"},
|
||||
{0, COM, mk_op2(0x3,I_DOUBLE,I_DOUBLE), "cbitid"},
|
||||
{0, COM, mk_op2(0xE,I_BYTE,I_BYTE), "ibitb"},
|
||||
{0, COM, mk_op2(0xE,I_WORD,I_WORD), "ibitw"},
|
||||
{0, COM, mk_op2(0xE,I_DOUBLE,I_DOUBLE), "ibitd"},
|
||||
{0, CHECK, mk_op1(0x1,I_DOUBLE), "cvtp"},
|
||||
{0, FFS, mk_op2c(0x5,I_BYTE,I_BYTE,0), "ffsb"},
|
||||
{0, FFS, mk_op2c(0x5,I_WORD,I_BYTE,0), "ffsw"},
|
||||
{0, FFS, mk_op2c(0x5,I_DOUBLE,I_BYTE,0), "ffsd"},
|
||||
/* Field instructions */
|
||||
0, INS, mk_op2(0x0,I_BYTE,I_BYTE), "extb",
|
||||
0, INS, mk_op2(0x0,I_WORD,I_WORD), "extw",
|
||||
0, INS, mk_op2(0x0,I_DOUBLE,I_DOUBLE), "extd",
|
||||
0, INSS, mk_op2(0x3,I_BYTE,I_BYTE), "extsb",
|
||||
0, INSS, mk_op2(0x3,I_WORD,I_WORD), "extsw",
|
||||
0, INSS, mk_op2(0x3,I_DOUBLE,I_DOUBLE), "extsd",
|
||||
0, INS, mk_op2(0x2,I_BYTE,I_BYTE), "insb",
|
||||
0, INS, mk_op2(0x2,I_WORD,I_WORD), "insw",
|
||||
0, INS, mk_op2(0x2,I_DOUBLE,I_DOUBLE), "insd",
|
||||
0, INSS, mk_op2(0x2,I_BYTE,I_BYTE), "inssb",
|
||||
0, INSS, mk_op2(0x2,I_WORD,I_WORD), "inssw",
|
||||
0, INSS, mk_op2(0x2,I_DOUBLE,I_DOUBLE), "inssd",
|
||||
{0, INS, mk_op2(0x0,I_BYTE,I_BYTE), "extb"},
|
||||
{0, INS, mk_op2(0x0,I_WORD,I_WORD), "extw"},
|
||||
{0, INS, mk_op2(0x0,I_DOUBLE,I_DOUBLE), "extd"},
|
||||
{0, INSS, mk_op2(0x3,I_BYTE,I_BYTE), "extsb"},
|
||||
{0, INSS, mk_op2(0x3,I_WORD,I_WORD), "extsw"},
|
||||
{0, INSS, mk_op2(0x3,I_DOUBLE,I_DOUBLE), "extsd"},
|
||||
{0, INS, mk_op2(0x2,I_BYTE,I_BYTE), "insb"},
|
||||
{0, INS, mk_op2(0x2,I_WORD,I_WORD), "insw"},
|
||||
{0, INS, mk_op2(0x2,I_DOUBLE,I_DOUBLE), "insd"},
|
||||
{0, INSS, mk_op2(0x2,I_BYTE,I_BYTE), "inssb"},
|
||||
{0, INSS, mk_op2(0x2,I_WORD,I_WORD), "inssw"},
|
||||
{0, INSS, mk_op2(0x2,I_DOUBLE,I_DOUBLE), "inssd"},
|
||||
/* String instructions */
|
||||
0, MOVS, mk_op1c(0x0,I_BYTE,0), "movsb",
|
||||
0, MOVS, mk_op1c(0x0,I_WORD,0), "movsw",
|
||||
0, MOVS, mk_op1c(0x0,I_DOUBLE,0), "movsd",
|
||||
0, MOVS, mk_op1c(0x0,I_BYTE,SO_TRANS), "movst",
|
||||
0, MOVS, mk_op1c(0x1,I_BYTE,0), "cmpsb",
|
||||
0, MOVS, mk_op1c(0x1,I_WORD,0), "cmpsw",
|
||||
0, MOVS, mk_op1c(0x1,I_DOUBLE,0), "cmpsd",
|
||||
0, MOVS, mk_op1c(0x1,I_BYTE,SO_TRANS), "cmpst",
|
||||
0, MOVS, mk_op1c(0x3,I_BYTE,0), "skpsb",
|
||||
0, MOVS, mk_op1c(0x3,I_WORD,0), "skpsw",
|
||||
0, MOVS, mk_op1c(0x3,I_DOUBLE,0), "skpsd",
|
||||
0, MOVS, mk_op1c(0x3,I_BYTE,SO_TRANS), "skpst",
|
||||
{0, MOVS, mk_op1c(0x0,I_BYTE,0), "movsb"},
|
||||
{0, MOVS, mk_op1c(0x0,I_WORD,0), "movsw"},
|
||||
{0, MOVS, mk_op1c(0x0,I_DOUBLE,0), "movsd"},
|
||||
{0, MOVS, mk_op1c(0x0,I_BYTE,SO_TRANS), "movst"},
|
||||
{0, MOVS, mk_op1c(0x1,I_BYTE,0), "cmpsb"},
|
||||
{0, MOVS, mk_op1c(0x1,I_WORD,0), "cmpsw"},
|
||||
{0, MOVS, mk_op1c(0x1,I_DOUBLE,0), "cmpsd"},
|
||||
{0, MOVS, mk_op1c(0x1,I_BYTE,SO_TRANS), "cmpst"},
|
||||
{0, MOVS, mk_op1c(0x3,I_BYTE,0), "skpsb"},
|
||||
{0, MOVS, mk_op1c(0x3,I_WORD,0), "skpsw"},
|
||||
{0, MOVS, mk_op1c(0x3,I_DOUBLE,0), "skpsd"},
|
||||
{0, MOVS, mk_op1c(0x3,I_BYTE,SO_TRANS), "skpst"},
|
||||
/* Block instructions */
|
||||
0, MOVM, mk_op2(0x0,I_BYTE,I_BYTE), "movmb",
|
||||
0, MOVM, mk_op2(0x0,I_WORD,I_WORD), "movmw",
|
||||
0, MOVM, mk_op2(0x0,I_DOUBLE,I_DOUBLE), "movmd",
|
||||
0, MOVM, mk_op2(0x1,I_BYTE,I_BYTE), "cmpmb",
|
||||
0, MOVM, mk_op2(0x1,I_WORD,I_WORD), "cmpmw",
|
||||
0, MOVM, mk_op2(0x1,I_DOUBLE,I_DOUBLE), "cmpmd",
|
||||
{0, MOVM, mk_op2(0x0,I_BYTE,I_BYTE), "movmb"},
|
||||
{0, MOVM, mk_op2(0x0,I_WORD,I_WORD), "movmw"},
|
||||
{0, MOVM, mk_op2(0x0,I_DOUBLE,I_DOUBLE), "movmd"},
|
||||
{0, MOVM, mk_op2(0x1,I_BYTE,I_BYTE), "cmpmb"},
|
||||
{0, MOVM, mk_op2(0x1,I_WORD,I_WORD), "cmpmw"},
|
||||
{0, MOVM, mk_op2(0x1,I_DOUBLE,I_DOUBLE), "cmpmd"},
|
||||
/* Packed decimal instructions */
|
||||
0, COM, mk_op2(0xF,I_BYTE,I_BYTE), "addpb",
|
||||
0, COM, mk_op2(0xF,I_WORD,I_WORD), "addpw",
|
||||
0, COM, mk_op2(0xF,I_DOUBLE,I_DOUBLE), "addpd",
|
||||
0, COM, mk_op2(0xB,I_BYTE,I_BYTE), "subpb",
|
||||
0, COM, mk_op2(0xB,I_WORD,I_WORD), "subpw",
|
||||
0, COM, mk_op2(0xB,I_DOUBLE,I_DOUBLE), "subpd",
|
||||
{0, COM, mk_op2(0xF,I_BYTE,I_BYTE), "addpb"},
|
||||
{0, COM, mk_op2(0xF,I_WORD,I_WORD), "addpw"},
|
||||
{0, COM, mk_op2(0xF,I_DOUBLE,I_DOUBLE), "addpd"},
|
||||
{0, COM, mk_op2(0xB,I_BYTE,I_BYTE), "subpb"},
|
||||
{0, COM, mk_op2(0xB,I_WORD,I_WORD), "subpw"},
|
||||
{0, COM, mk_op2(0xB,I_DOUBLE,I_DOUBLE), "subpd"},
|
||||
/* Array instructions */
|
||||
0, CHECK, mk_op2(0x4,I_BYTE,I_BYTE), "indexb",
|
||||
0, CHECK, mk_op2(0x4,I_WORD,I_WORD), "indexw",
|
||||
0, CHECK, mk_op2(0x4,I_DOUBLE,I_DOUBLE), "indexd",
|
||||
0, CHECK, mk_op2(0x3,I_BYTE,I_BYTE), "checkb",
|
||||
0, CHECK, mk_op2(0x3,I_WORD,I_WORD), "checkw",
|
||||
0, CHECK, mk_op2(0x3,I_DOUBLE,I_DOUBLE), "checkd",
|
||||
{0, CHECK, mk_op2(0x4,I_BYTE,I_BYTE), "indexb"},
|
||||
{0, CHECK, mk_op2(0x4,I_WORD,I_WORD), "indexw"},
|
||||
{0, CHECK, mk_op2(0x4,I_DOUBLE,I_DOUBLE), "indexd"},
|
||||
{0, CHECK, mk_op2(0x3,I_BYTE,I_BYTE), "checkb"},
|
||||
{0, CHECK, mk_op2(0x3,I_WORD,I_WORD), "checkw"},
|
||||
{0, CHECK, mk_op2(0x3,I_DOUBLE,I_DOUBLE), "checkd"},
|
||||
/* Processor control instructions */
|
||||
0, JUMP, mk_op1(0x4,I_DOUBLE), "jump",
|
||||
0, BR, mk_c(B_EQ), "beq",
|
||||
0, BR, mk_c(B_NE), "bne",
|
||||
0, BR, mk_c(B_CS), "bcs",
|
||||
0, BR, mk_c(B_CC), "bcc",
|
||||
0, BR, mk_c(B_HI), "bhi",
|
||||
0, BR, mk_c(B_LS), "bls",
|
||||
0, BR, mk_c(B_GT), "bgt",
|
||||
0, BR, mk_c(B_LE), "ble",
|
||||
0, BR, mk_c(B_FS), "bfs",
|
||||
0, BR, mk_c(B_FC), "bfc",
|
||||
0, BR, mk_c(B_LO), "blo",
|
||||
0, BR, mk_c(B_HS), "bhs",
|
||||
0, BR, mk_c(B_LT), "blt",
|
||||
0, BR, mk_c(B_GE), "bge",
|
||||
0, BR, mk_c(B_TRUE), "br",
|
||||
{0, JUMP, mk_op1(0x4,I_DOUBLE), "jump"},
|
||||
{0, BR, mk_c(B_EQ), "beq"},
|
||||
{0, BR, mk_c(B_NE), "bne"},
|
||||
{0, BR, mk_c(B_CS), "bcs"},
|
||||
{0, BR, mk_c(B_CC), "bcc"},
|
||||
{0, BR, mk_c(B_HI), "bhi"},
|
||||
{0, BR, mk_c(B_LS), "bls"},
|
||||
{0, BR, mk_c(B_GT), "bgt"},
|
||||
{0, BR, mk_c(B_LE), "ble"},
|
||||
{0, BR, mk_c(B_FS), "bfs"},
|
||||
{0, BR, mk_c(B_FC), "bfc"},
|
||||
{0, BR, mk_c(B_LO), "blo"},
|
||||
{0, BR, mk_c(B_HS), "bhs"},
|
||||
{0, BR, mk_c(B_LT), "blt"},
|
||||
{0, BR, mk_c(B_GE), "bge"},
|
||||
{0, BR, mk_c(B_TRUE), "br"},
|
||||
#ifdef UNUSED
|
||||
0, BR, mk_c(B_FALSE), "bfalse",
|
||||
{0, BR, mk_c(B_FALSE), "bfalse"},
|
||||
#endif
|
||||
0, ADJSP, mk_op1(0xE,I_BYTE), "caseb",
|
||||
0, ADJSP, mk_op1(0xE,I_WORD), "casew",
|
||||
0, ADJSP, mk_op1(0xE,I_DOUBLE), "cased",
|
||||
0, ACB, mk_op1(0x4,I_BYTE), "acbb",
|
||||
0, ACB, mk_op1(0x4,I_WORD), "acbw",
|
||||
0, ACB, mk_op1(0x4,I_DOUBLE), "acbd",
|
||||
0, JSR, mk_op1(0xC,I_DOUBLE), "jsr",
|
||||
0, BSR, mk_op(0x0), "bsr",
|
||||
0, RET, mk_op(0x1), "ret",
|
||||
0, RET, mk_op(0x2), "cxp",
|
||||
0, ADJSP, mk_op1(0x0,I_DOUBLE), "cxpd",
|
||||
0, RET, mk_op(0x3), "rxp",
|
||||
0, RET, mk_op(0x4), "rett",
|
||||
0, WAIT, mk_op(0x5), "reti",
|
||||
0, WAIT, mk_op(0xC), "dia",
|
||||
{0, ADJSP, mk_op1(0xE,I_BYTE), "caseb"},
|
||||
{0, ADJSP, mk_op1(0xE,I_WORD), "casew"},
|
||||
{0, ADJSP, mk_op1(0xE,I_DOUBLE), "cased"},
|
||||
{0, ACB, mk_op1(0x4,I_BYTE), "acbb"},
|
||||
{0, ACB, mk_op1(0x4,I_WORD), "acbw"},
|
||||
{0, ACB, mk_op1(0x4,I_DOUBLE), "acbd"},
|
||||
{0, JSR, mk_op1(0xC,I_DOUBLE), "jsr"},
|
||||
{0, BSR, mk_op(0x0), "bsr"},
|
||||
{0, RET, mk_op(0x1), "ret"},
|
||||
{0, RET, mk_op(0x2), "cxp"},
|
||||
{0, ADJSP, mk_op1(0x0,I_DOUBLE), "cxpd"},
|
||||
{0, RET, mk_op(0x3), "rxp"},
|
||||
{0, RET, mk_op(0x4), "rett"},
|
||||
{0, WAIT, mk_op(0x5), "reti"},
|
||||
{0, WAIT, mk_op(0xC), "dia"},
|
||||
/* Processor service instructions */
|
||||
0, ADJSP, mk_op1(0xA,I_BYTE), "adjspb",
|
||||
0, ADJSP, mk_op1(0xA,I_WORD), "adjspw",
|
||||
0, ADJSP, mk_op1(0xA,I_DOUBLE), "adjspd",
|
||||
0, ADJSP, mk_op1(0x2,I_BYTE), "bicpsrb",
|
||||
0, ADJSP, mk_op1(0x2,I_WORD), "bicpsrw",
|
||||
0, ADJSP, mk_op1(0x6,I_BYTE), "bispsrb",
|
||||
0, ADJSP, mk_op1(0x6,I_WORD), "bispsrw",
|
||||
{0, ADJSP, mk_op1(0xA,I_BYTE), "adjspb"},
|
||||
{0, ADJSP, mk_op1(0xA,I_WORD), "adjspw"},
|
||||
{0, ADJSP, mk_op1(0xA,I_DOUBLE), "adjspd"},
|
||||
{0, ADJSP, mk_op1(0x2,I_BYTE), "bicpsrb"},
|
||||
{0, ADJSP, mk_op1(0x2,I_WORD), "bicpsrw"},
|
||||
{0, ADJSP, mk_op1(0x6,I_BYTE), "bispsrb"},
|
||||
{0, ADJSP, mk_op1(0x6,I_WORD), "bispsrw"},
|
||||
#ifdef UNUSED
|
||||
0, ADJSP, mk_op1(0x2,I_DOUBLE), "bicpsrd",
|
||||
0, ADJSP, mk_op1(0x6,I_DOUBLE), "bispsrd",
|
||||
{0, ADJSP, mk_op1(0x2,I_DOUBLE), "bicpsrd"},
|
||||
{0, ADJSP, mk_op1(0x6,I_DOUBLE), "bispsrd"},
|
||||
#endif
|
||||
0, SAVE, mk_op(0x6), "save",
|
||||
0, SAVE, mk_op(0x7), "restore",
|
||||
0, ENTER, mk_op(0x8), "enter",
|
||||
0, SAVE, mk_op(0x9), "exit",
|
||||
0, LPR, mk_op1(0x6,I_BYTE), "lprb",
|
||||
0, LPR, mk_op1(0x6,I_WORD), "lprw",
|
||||
0, LPR, mk_op1(0x6,I_DOUBLE), "lprd",
|
||||
0, LPR, mk_op1(0x2,I_BYTE), "sprb",
|
||||
0, LPR, mk_op1(0x2,I_WORD), "sprw",
|
||||
0, LPR, mk_op1(0x2,I_DOUBLE), "sprd",
|
||||
0, SETCFG, mk_op1(0x2,I_DOUBLE), "setcfg",
|
||||
0, WAIT, mk_op(0xF), "bpt",
|
||||
0, WAIT, mk_op(0xD), "flag",
|
||||
0, WAIT, mk_op(0xE), "svc",
|
||||
0, WAIT, mk_op(0xA), "nop",
|
||||
0, WAIT, mk_op(0xB), "wait",
|
||||
{0, SAVE, mk_op(0x6), "save"},
|
||||
{0, SAVE, mk_op(0x7), "restore"},
|
||||
{0, ENTER, mk_op(0x8), "enter"},
|
||||
{0, SAVE, mk_op(0x9), "exit"},
|
||||
{0, LPR, mk_op1(0x6,I_BYTE), "lprb"},
|
||||
{0, LPR, mk_op1(0x6,I_WORD), "lprw"},
|
||||
{0, LPR, mk_op1(0x6,I_DOUBLE), "lprd"},
|
||||
{0, LPR, mk_op1(0x2,I_BYTE), "sprb"},
|
||||
{0, LPR, mk_op1(0x2,I_WORD), "sprw"},
|
||||
{0, LPR, mk_op1(0x2,I_DOUBLE), "sprd"},
|
||||
{0, SETCFG, mk_op1(0x2,I_DOUBLE), "setcfg"},
|
||||
{0, WAIT, mk_op(0xF), "bpt"},
|
||||
{0, WAIT, mk_op(0xD), "flag"},
|
||||
{0, WAIT, mk_op(0xE), "svc"},
|
||||
{0, WAIT, mk_op(0xA), "nop"},
|
||||
{0, WAIT, mk_op(0xB), "wait"},
|
||||
/* Memory management instructions */
|
||||
0, LMR, mk_op1(0x2,I_DOUBLE), "lmr",
|
||||
0, LMR, mk_op1(0x3,I_DOUBLE), "smr",
|
||||
0, RDVAL, mk_op1(0x0,I_DOUBLE), "rdval",
|
||||
0, RDVAL, mk_op1(0x1,I_DOUBLE), "wrval",
|
||||
{0, LMR, mk_op1(0x2,I_DOUBLE), "lmr"},
|
||||
{0, LMR, mk_op1(0x3,I_DOUBLE), "smr"},
|
||||
{0, RDVAL, mk_op1(0x0,I_DOUBLE), "rdval"},
|
||||
{0, RDVAL, mk_op1(0x1,I_DOUBLE), "wrval"},
|
||||
#ifdef SU_ASSEM
|
||||
/* The assembler ref. man and the CPU description booklet differ
|
||||
in the encoding of these instructions
|
||||
*/
|
||||
0, FFS, mk_op2c(0x6,I_BYTE,I_BYTE,1), "movsub",
|
||||
0, FFS, mk_op2c(0x6,I_WORD,I_WORD,1), "movsuw",
|
||||
0, FFS, mk_op2c(0x6,I_DOUBLE,I_DOUBLE,1),"movsud",
|
||||
0, FFS, mk_op2c(0x6,I_BYTE,I_BYTE,3), "movusb",
|
||||
0, FFS, mk_op2c(0x6,I_WORD,I_WORD,3), "movusw",
|
||||
0, FFS, mk_op2c(0x6,I_DOUBLE,I_DOUBLE,3),"movusd",
|
||||
{0, FFS, mk_op2c(0x6,I_BYTE,I_BYTE,1), "movsub"},
|
||||
{0, FFS, mk_op2c(0x6,I_WORD,I_WORD,1), "movsuw"},
|
||||
{0, FFS, mk_op2c(0x6,I_DOUBLE,I_DOUBLE,1),"movsud"},
|
||||
{0, FFS, mk_op2c(0x6,I_BYTE,I_BYTE,3), "movusb"},
|
||||
{0, FFS, mk_op2c(0x6,I_WORD,I_WORD,3), "movusw"},
|
||||
{0, FFS, mk_op2c(0x6,I_DOUBLE,I_DOUBLE,3),"movusd"},
|
||||
#else
|
||||
/* assembler reference manual version */
|
||||
0, FFS, mk_op2c(0x7,I_BYTE,I_BYTE,0), "movsub",
|
||||
0, FFS, mk_op2c(0x7,I_WORD,I_WORD,0), "movsuw",
|
||||
0, FFS, mk_op2c(0x7,I_DOUBLE,I_DOUBLE,0),"movsud",
|
||||
0, FFS, mk_op2c(0x6,I_BYTE,I_BYTE,0), "movusb",
|
||||
0, FFS, mk_op2c(0x6,I_WORD,I_WORD,0), "movusw",
|
||||
0, FFS, mk_op2c(0x6,I_DOUBLE,I_DOUBLE,0),"movusd",
|
||||
{0, FFS, mk_op2c(0x7,I_BYTE,I_BYTE,0), "movsub"},
|
||||
{0, FFS, mk_op2c(0x7,I_WORD,I_WORD,0), "movsuw"},
|
||||
{0, FFS, mk_op2c(0x7,I_DOUBLE,I_DOUBLE,0),"movsud"},
|
||||
{0, FFS, mk_op2c(0x6,I_BYTE,I_BYTE,0), "movusb"},
|
||||
{0, FFS, mk_op2c(0x6,I_WORD,I_WORD,0), "movusw"},
|
||||
{0, FFS, mk_op2c(0x6,I_DOUBLE,I_DOUBLE,0),"movusd"},
|
||||
#endif
|
||||
/* Floating point instructions */
|
||||
0, ADD_F, mk_op2(0xD,F_FLOAT,F_FLOAT), "absf",
|
||||
0, ADD_F, mk_op2(0xD,F_LONG,F_LONG), "absl",
|
||||
0, ADD_F, mk_op2(0x0,F_FLOAT,F_FLOAT), "addf",
|
||||
0, ADD_F, mk_op2(0x0,F_LONG,F_LONG), "addl",
|
||||
0, ADD_F, mk_op2(0x2,F_FLOAT,F_FLOAT), "cmpf",
|
||||
0, ADD_F, mk_op2(0x2,F_LONG,F_LONG), "cmpl",
|
||||
0, ADD_F, mk_op2(0x8,F_FLOAT,F_FLOAT), "divf",
|
||||
0, ADD_F, mk_op2(0x8,F_LONG,F_LONG), "divl",
|
||||
0, ADD_F, mk_op2(0xC,F_FLOAT,F_FLOAT), "mulf",
|
||||
0, ADD_F, mk_op2(0xC,F_LONG,F_LONG), "mull",
|
||||
0, ADD_F, mk_op2(0x4,F_FLOAT,F_FLOAT), "subf",
|
||||
0, ADD_F, mk_op2(0x4,F_LONG,F_LONG), "subl",
|
||||
0, ADD_F, mk_op2(0x5,F_FLOAT,F_FLOAT), "negf",
|
||||
0, ADD_F, mk_op2(0x5,F_LONG,F_LONG), "negl",
|
||||
0, ADD_F, mk_op2(0x1,F_FLOAT,F_FLOAT), "movf",
|
||||
0, ADD_F, mk_op2(0x1,F_LONG,F_LONG), "movl",
|
||||
0, MOVIF, mk_op2(0x0,I_BYTE,F_FLOAT), "movbf",
|
||||
0, MOVIF, mk_op2(0x0,I_WORD,F_FLOAT), "movwf",
|
||||
0, MOVIF, mk_op2(0x0,I_DOUBLE,F_FLOAT), "movdf",
|
||||
0, MOVIF, mk_op2(0x0,I_BYTE,F_LONG), "movbl",
|
||||
0, MOVIF, mk_op2(0x0,I_WORD,F_LONG), "movwl",
|
||||
0, MOVIF, mk_op2(0x0,I_DOUBLE,F_LONG), "movdl",
|
||||
0, MOVFL, mk_op2(0x3,F_FLOAT,F_LONG), "movfl",
|
||||
0, MOVFL, mk_op2(0x2,F_LONG,F_FLOAT), "movlf",
|
||||
0, TRUNC, mk_op2(0x7,F_FLOAT,I_BYTE), "floorfb",
|
||||
0, TRUNC, mk_op2(0x7,F_FLOAT,I_WORD), "floorfw",
|
||||
0, TRUNC, mk_op2(0x7,F_FLOAT,I_DOUBLE), "floorfd",
|
||||
0, TRUNC, mk_op2(0x7,F_LONG,I_BYTE), "floorlb",
|
||||
0, TRUNC, mk_op2(0x7,F_LONG,I_WORD), "floorlw",
|
||||
0, TRUNC, mk_op2(0x7,F_LONG,I_DOUBLE), "floorld",
|
||||
0, TRUNC, mk_op2(0x4,F_FLOAT,I_BYTE), "roundfb",
|
||||
0, TRUNC, mk_op2(0x4,F_FLOAT,I_WORD), "roundfw",
|
||||
0, TRUNC, mk_op2(0x4,F_FLOAT,I_DOUBLE), "roundfd",
|
||||
0, TRUNC, mk_op2(0x4,F_LONG,I_BYTE), "roundlb",
|
||||
0, TRUNC, mk_op2(0x4,F_LONG,I_WORD), "roundlw",
|
||||
0, TRUNC, mk_op2(0x4,F_LONG,I_DOUBLE), "roundld",
|
||||
0, TRUNC, mk_op2(0x5,F_FLOAT,I_BYTE), "truncfb",
|
||||
0, TRUNC, mk_op2(0x5,F_FLOAT,I_WORD), "truncfw",
|
||||
0, TRUNC, mk_op2(0x5,F_FLOAT,I_DOUBLE), "truncfd",
|
||||
0, TRUNC, mk_op2(0x5,F_LONG,I_BYTE), "trunclb",
|
||||
0, TRUNC, mk_op2(0x5,F_LONG,I_WORD), "trunclw",
|
||||
0, TRUNC, mk_op2(0x5,F_LONG,I_DOUBLE), "truncld",
|
||||
0, LFSR, mk_op(0x1), "lfsr",
|
||||
0, LFSR, mk_op(0x6), "sfsr",
|
||||
{0, ADD_F, mk_op2(0xD,F_FLOAT,F_FLOAT), "absf"},
|
||||
{0, ADD_F, mk_op2(0xD,F_LONG,F_LONG), "absl"},
|
||||
{0, ADD_F, mk_op2(0x0,F_FLOAT,F_FLOAT), "addf"},
|
||||
{0, ADD_F, mk_op2(0x0,F_LONG,F_LONG), "addl"},
|
||||
{0, ADD_F, mk_op2(0x2,F_FLOAT,F_FLOAT), "cmpf"},
|
||||
{0, ADD_F, mk_op2(0x2,F_LONG,F_LONG), "cmpl"},
|
||||
{0, ADD_F, mk_op2(0x8,F_FLOAT,F_FLOAT), "divf"},
|
||||
{0, ADD_F, mk_op2(0x8,F_LONG,F_LONG), "divl"},
|
||||
{0, ADD_F, mk_op2(0xC,F_FLOAT,F_FLOAT), "mulf"},
|
||||
{0, ADD_F, mk_op2(0xC,F_LONG,F_LONG), "mull"},
|
||||
{0, ADD_F, mk_op2(0x4,F_FLOAT,F_FLOAT), "subf"},
|
||||
{0, ADD_F, mk_op2(0x4,F_LONG,F_LONG), "subl"},
|
||||
{0, ADD_F, mk_op2(0x5,F_FLOAT,F_FLOAT), "negf"},
|
||||
{0, ADD_F, mk_op2(0x5,F_LONG,F_LONG), "negl"},
|
||||
{0, ADD_F, mk_op2(0x1,F_FLOAT,F_FLOAT), "movf"},
|
||||
{0, ADD_F, mk_op2(0x1,F_LONG,F_LONG), "movl"},
|
||||
{0, MOVIF, mk_op2(0x0,I_BYTE,F_FLOAT), "movbf"},
|
||||
{0, MOVIF, mk_op2(0x0,I_WORD,F_FLOAT), "movwf"},
|
||||
{0, MOVIF, mk_op2(0x0,I_DOUBLE,F_FLOAT), "movdf"},
|
||||
{0, MOVIF, mk_op2(0x0,I_BYTE,F_LONG), "movbl"},
|
||||
{0, MOVIF, mk_op2(0x0,I_WORD,F_LONG), "movwl"},
|
||||
{0, MOVIF, mk_op2(0x0,I_DOUBLE,F_LONG), "movdl"},
|
||||
{0, MOVFL, mk_op2(0x3,F_FLOAT,F_LONG), "movfl"},
|
||||
{0, MOVFL, mk_op2(0x2,F_LONG,F_FLOAT), "movlf"},
|
||||
{0, TRUNC, mk_op2(0x7,F_FLOAT,I_BYTE), "floorfb"},
|
||||
{0, TRUNC, mk_op2(0x7,F_FLOAT,I_WORD), "floorfw"},
|
||||
{0, TRUNC, mk_op2(0x7,F_FLOAT,I_DOUBLE), "floorfd"},
|
||||
{0, TRUNC, mk_op2(0x7,F_LONG,I_BYTE), "floorlb"},
|
||||
{0, TRUNC, mk_op2(0x7,F_LONG,I_WORD), "floorlw"},
|
||||
{0, TRUNC, mk_op2(0x7,F_LONG,I_DOUBLE), "floorld"},
|
||||
{0, TRUNC, mk_op2(0x4,F_FLOAT,I_BYTE), "roundfb"},
|
||||
{0, TRUNC, mk_op2(0x4,F_FLOAT,I_WORD), "roundfw"},
|
||||
{0, TRUNC, mk_op2(0x4,F_FLOAT,I_DOUBLE), "roundfd"},
|
||||
{0, TRUNC, mk_op2(0x4,F_LONG,I_BYTE), "roundlb"},
|
||||
{0, TRUNC, mk_op2(0x4,F_LONG,I_WORD), "roundlw"},
|
||||
{0, TRUNC, mk_op2(0x4,F_LONG,I_DOUBLE), "roundld"},
|
||||
{0, TRUNC, mk_op2(0x5,F_FLOAT,I_BYTE), "truncfb"},
|
||||
{0, TRUNC, mk_op2(0x5,F_FLOAT,I_WORD), "truncfw"},
|
||||
{0, TRUNC, mk_op2(0x5,F_FLOAT,I_DOUBLE), "truncfd"},
|
||||
{0, TRUNC, mk_op2(0x5,F_LONG,I_BYTE), "trunclb"},
|
||||
{0, TRUNC, mk_op2(0x5,F_LONG,I_WORD), "trunclw"},
|
||||
{0, TRUNC, mk_op2(0x5,F_LONG,I_DOUBLE), "truncld"},
|
||||
{0, LFSR, mk_op(0x1), "lfsr"},
|
||||
{0, LFSR, mk_op(0x6), "sfsr"},
|
||||
/* Slave processor instructions */
|
||||
0, LCR, mk_op1(0x2,I_DOUBLE), "lcr", /* Sure ? */
|
||||
0, LCR, mk_op1(0x3,I_DOUBLE), "scr", /* Sure ? */
|
||||
0, CATST, mk_op1(0x0,I_DOUBLE), "catst0",/* Sure ? */
|
||||
0, CATST, mk_op1(0x1,I_DOUBLE), "catst1",/* Sure ? */
|
||||
0, LCSR, mk_op1(0x1,S_DOUBLE), "lcsr", /* Sure ? */
|
||||
0, LCSR, mk_op1(0x6,S_DOUBLE), "scsr", /* Sure ? */
|
||||
0, CCVSI, mk_op2(0x7,S_DOUBLE,I_BYTE), "ccv0db",
|
||||
0, CCVSI, mk_op2(0x7,S_DOUBLE,I_WORD), "ccv0dw",
|
||||
0, CCVSI, mk_op2(0x7,S_DOUBLE,I_DOUBLE), "ccv0dd",
|
||||
0, CCVSI, mk_op2(0x7,S_QUAD,I_BYTE), "ccv0qb",
|
||||
0, CCVSI, mk_op2(0x7,S_QUAD,I_WORD), "ccv0qw",
|
||||
0, CCVSI, mk_op2(0x7,S_QUAD,I_DOUBLE), "ccv0qd",
|
||||
0, CCVSI, mk_op2(0x5,S_DOUBLE,I_BYTE), "ccv1db",
|
||||
0, CCVSI, mk_op2(0x5,S_DOUBLE,I_WORD), "ccv1dw",
|
||||
0, CCVSI, mk_op2(0x5,S_DOUBLE,I_DOUBLE), "ccv1dd",
|
||||
0, CCVSI, mk_op2(0x5,S_QUAD,I_BYTE), "ccv1qb",
|
||||
0, CCVSI, mk_op2(0x5,S_QUAD,I_WORD), "ccv1qw",
|
||||
0, CCVSI, mk_op2(0x5,S_QUAD,I_DOUBLE), "ccv1qd",
|
||||
0, CCVSI, mk_op2(0x4,S_DOUBLE,I_BYTE), "ccv2db",
|
||||
0, CCVSI, mk_op2(0x4,S_DOUBLE,I_WORD), "ccv2dw",
|
||||
0, CCVSI, mk_op2(0x4,S_DOUBLE,I_DOUBLE), "ccv2dd",
|
||||
0, CCVSI, mk_op2(0x4,S_QUAD,I_BYTE), "ccv2qb",
|
||||
0, CCVSI, mk_op2(0x4,S_QUAD,I_WORD), "ccv2qw",
|
||||
0, CCVSI, mk_op2(0x4,S_QUAD,I_DOUBLE), "ccv2qd",
|
||||
0, CCVIS, mk_op2(0x0,I_BYTE,S_DOUBLE), "ccv3bd",
|
||||
0, CCVIS, mk_op2(0x0,I_WORD,S_DOUBLE), "ccv3wd",
|
||||
0, CCVIS, mk_op2(0x0,I_DOUBLE,S_DOUBLE), "ccv3dd",
|
||||
0, CCVIS, mk_op2(0x0,I_BYTE,S_QUAD), "ccv3bq",
|
||||
0, CCVIS, mk_op2(0x0,I_WORD,S_QUAD), "ccv3wq",
|
||||
0, CCVIS, mk_op2(0x0,I_DOUBLE,S_QUAD), "ccv3dq",
|
||||
0, CCVSS, mk_op2(0x3,S_DOUBLE,S_QUAD), "ccv4dq",
|
||||
0, CCVSS, mk_op2(0x2,S_QUAD,S_DOUBLE), "ccv5qd",
|
||||
0, CMOV, mk_op2(0x0,S_DOUBLE,S_DOUBLE), "ccal0d",
|
||||
0, CMOV, mk_op2(0x0,S_QUAD,S_QUAD), "ccal0q",
|
||||
0, CMOV, mk_op2(0x4,S_DOUBLE,S_DOUBLE), "ccal1d",
|
||||
0, CMOV, mk_op2(0x4,S_QUAD,S_QUAD), "ccal1q",
|
||||
0, CMOV, mk_op2(0xC,S_DOUBLE,S_DOUBLE), "ccal2d",
|
||||
0, CMOV, mk_op2(0xC,S_QUAD,S_QUAD), "ccal2q",
|
||||
0, CMOV, mk_op2(0x8,S_DOUBLE,S_DOUBLE), "ccal3d",
|
||||
0, CMOV, mk_op2(0x8,S_QUAD,S_QUAD), "ccal3q",
|
||||
0, CMOV, mk_op2(0x2,S_DOUBLE,S_DOUBLE), "ccmpd",
|
||||
0, CMOV, mk_op2(0x2,S_QUAD,S_QUAD), "ccmpq",
|
||||
0, CMOV, mk_op2(0x1,S_DOUBLE,S_DOUBLE), "cmov0d",
|
||||
0, CMOV, mk_op2(0x1,S_QUAD,S_QUAD), "cmov0q",
|
||||
0, CMOV, mk_op2(0xD,S_DOUBLE,S_DOUBLE), "cmov1d",
|
||||
0, CMOV, mk_op2(0xD,S_QUAD,S_QUAD), "cmov1q",
|
||||
0, CMOV, mk_op2(0x5,S_DOUBLE,S_DOUBLE), "cmov2d",
|
||||
0, CMOV, mk_op2(0x5,S_QUAD,S_QUAD), "cmov2q",
|
||||
{0, LCR, mk_op1(0x2,I_DOUBLE), "lcr"}, /* Sure ? */
|
||||
{0, LCR, mk_op1(0x3,I_DOUBLE), "scr"}, /* Sure ? */
|
||||
{0, CATST, mk_op1(0x0,I_DOUBLE), "catst0"},/* Sure ? */
|
||||
{0, CATST, mk_op1(0x1,I_DOUBLE), "catst1"},/* Sure ? */
|
||||
{0, LCSR, mk_op1(0x1,S_DOUBLE), "lcsr"}, /* Sure ? */
|
||||
{0, LCSR, mk_op1(0x6,S_DOUBLE), "scsr"}, /* Sure ? */
|
||||
{0, CCVSI, mk_op2(0x7,S_DOUBLE,I_BYTE), "ccv0db"},
|
||||
{0, CCVSI, mk_op2(0x7,S_DOUBLE,I_WORD), "ccv0dw"},
|
||||
{0, CCVSI, mk_op2(0x7,S_DOUBLE,I_DOUBLE), "ccv0dd"},
|
||||
{0, CCVSI, mk_op2(0x7,S_QUAD,I_BYTE), "ccv0qb"},
|
||||
{0, CCVSI, mk_op2(0x7,S_QUAD,I_WORD), "ccv0qw"},
|
||||
{0, CCVSI, mk_op2(0x7,S_QUAD,I_DOUBLE), "ccv0qd"},
|
||||
{0, CCVSI, mk_op2(0x5,S_DOUBLE,I_BYTE), "ccv1db"},
|
||||
{0, CCVSI, mk_op2(0x5,S_DOUBLE,I_WORD), "ccv1dw"},
|
||||
{0, CCVSI, mk_op2(0x5,S_DOUBLE,I_DOUBLE), "ccv1dd"},
|
||||
{0, CCVSI, mk_op2(0x5,S_QUAD,I_BYTE), "ccv1qb"},
|
||||
{0, CCVSI, mk_op2(0x5,S_QUAD,I_WORD), "ccv1qw"},
|
||||
{0, CCVSI, mk_op2(0x5,S_QUAD,I_DOUBLE), "ccv1qd"},
|
||||
{0, CCVSI, mk_op2(0x4,S_DOUBLE,I_BYTE), "ccv2db"},
|
||||
{0, CCVSI, mk_op2(0x4,S_DOUBLE,I_WORD), "ccv2dw"},
|
||||
{0, CCVSI, mk_op2(0x4,S_DOUBLE,I_DOUBLE), "ccv2dd"},
|
||||
{0, CCVSI, mk_op2(0x4,S_QUAD,I_BYTE), "ccv2qb"},
|
||||
{0, CCVSI, mk_op2(0x4,S_QUAD,I_WORD), "ccv2qw"},
|
||||
{0, CCVSI, mk_op2(0x4,S_QUAD,I_DOUBLE), "ccv2qd"},
|
||||
{0, CCVIS, mk_op2(0x0,I_BYTE,S_DOUBLE), "ccv3bd"},
|
||||
{0, CCVIS, mk_op2(0x0,I_WORD,S_DOUBLE), "ccv3wd"},
|
||||
{0, CCVIS, mk_op2(0x0,I_DOUBLE,S_DOUBLE), "ccv3dd"},
|
||||
{0, CCVIS, mk_op2(0x0,I_BYTE,S_QUAD), "ccv3bq"},
|
||||
{0, CCVIS, mk_op2(0x0,I_WORD,S_QUAD), "ccv3wq"},
|
||||
{0, CCVIS, mk_op2(0x0,I_DOUBLE,S_QUAD), "ccv3dq"},
|
||||
{0, CCVSS, mk_op2(0x3,S_DOUBLE,S_QUAD), "ccv4dq"},
|
||||
{0, CCVSS, mk_op2(0x2,S_QUAD,S_DOUBLE), "ccv5qd"},
|
||||
{0, CMOV, mk_op2(0x0,S_DOUBLE,S_DOUBLE), "ccal0d"},
|
||||
{0, CMOV, mk_op2(0x0,S_QUAD,S_QUAD), "ccal0q"},
|
||||
{0, CMOV, mk_op2(0x4,S_DOUBLE,S_DOUBLE), "ccal1d"},
|
||||
{0, CMOV, mk_op2(0x4,S_QUAD,S_QUAD), "ccal1q"},
|
||||
{0, CMOV, mk_op2(0xC,S_DOUBLE,S_DOUBLE), "ccal2d"},
|
||||
{0, CMOV, mk_op2(0xC,S_QUAD,S_QUAD), "ccal2q"},
|
||||
{0, CMOV, mk_op2(0x8,S_DOUBLE,S_DOUBLE), "ccal3d"},
|
||||
{0, CMOV, mk_op2(0x8,S_QUAD,S_QUAD), "ccal3q"},
|
||||
{0, CMOV, mk_op2(0x2,S_DOUBLE,S_DOUBLE), "ccmpd"},
|
||||
{0, CMOV, mk_op2(0x2,S_QUAD,S_QUAD), "ccmpq"},
|
||||
{0, CMOV, mk_op2(0x1,S_DOUBLE,S_DOUBLE), "cmov0d"},
|
||||
{0, CMOV, mk_op2(0x1,S_QUAD,S_QUAD), "cmov0q"},
|
||||
{0, CMOV, mk_op2(0xD,S_DOUBLE,S_DOUBLE), "cmov1d"},
|
||||
{0, CMOV, mk_op2(0xD,S_QUAD,S_QUAD), "cmov1q"},
|
||||
{0, CMOV, mk_op2(0x5,S_DOUBLE,S_DOUBLE), "cmov2d"},
|
||||
{0, CMOV, mk_op2(0x5,S_QUAD,S_QUAD), "cmov2q"},
|
||||
|
|
|
@ -8,11 +8,11 @@
|
|||
* NS 16032 special routines
|
||||
*/
|
||||
|
||||
clrmode() { /* clear the current mode */
|
||||
void clrmode(void) { /* clear the current mode */
|
||||
mode_ptr->m_ndisp = 0 ;
|
||||
}
|
||||
|
||||
int ind_mode(type) {
|
||||
int ind_mode(int type) {
|
||||
switch ( type ) {
|
||||
case 'b' : return 0x1C ;
|
||||
case 'w' : return 0x1D ;
|
||||
|
@ -24,95 +24,95 @@ int ind_mode(type) {
|
|||
}
|
||||
}
|
||||
|
||||
badsyntax() {
|
||||
void badsyntax(void) {
|
||||
|
||||
serror("bad operands");
|
||||
}
|
||||
|
||||
ill_imm() {
|
||||
void ill_imm(void) {
|
||||
serror("immediate operand not allowed") ;
|
||||
}
|
||||
/* Create the output formats */
|
||||
form2(id,sval) {
|
||||
void form2(int id, int sval) {
|
||||
assert ( id_t1(id)==T_INT ) ;
|
||||
emit1( id_g1(id) | 0xC | (id_op(id)<<4) | ((sval&1)<<7 ) ) ;
|
||||
emit1( (sval>>1) | (mode1.m_mode<<3) ) ;
|
||||
}
|
||||
|
||||
form3(id) {
|
||||
void form3(int id) {
|
||||
assert ( id_t1(id)==T_INT ) ;
|
||||
emit1( id_g1(id) | 0x7C | ((id_op(id)&1)<<7) ) ;
|
||||
emit1( (id_op(id)>>1) | (mode1.m_mode<<3) ) ;
|
||||
}
|
||||
|
||||
form4(id) {
|
||||
void form4(int id) {
|
||||
assert ( id_t1(id)==T_INT && id_t2(id)==T_INT );
|
||||
emit1( id_g2(id) | (id_op(id)<<2) | ((mode2.m_mode&3)<<6) ) ;
|
||||
emit1( (mode2.m_mode>>2) | (mode1.m_mode<<3) ) ;
|
||||
}
|
||||
|
||||
form5(id,sval) {
|
||||
void form5(int id, int sval) {
|
||||
assert ( id_t1(id)==T_INT ) ;
|
||||
emit1(0xE) ;
|
||||
emit1( id_g1(id) | (id_op(id)<<2) | ((sval&1)<<7 ) ) ;
|
||||
emit1( (sval>>1) ) ;
|
||||
}
|
||||
|
||||
form7x(id,i_type) {
|
||||
void form7x(int id,int i_type) {
|
||||
assert ( id_t1(id)==T_INT && id_t2(id)==T_INT );
|
||||
emit1(0xCE) ;
|
||||
emit1( i_type | (id_op(id)<<2) | ((mode2.m_mode&3)<<6) ) ;
|
||||
emit1( (mode2.m_mode>>2) | (mode1.m_mode<<3) ) ;
|
||||
}
|
||||
|
||||
form8(id,reg) {
|
||||
void form8(int id,int reg) {
|
||||
assert ( id_t1(id)==T_INT ) ;
|
||||
emit1( 0x2E | ((id_op(id)&3)<<6) ) ;
|
||||
emit1( id_g1(id) | (id_op(id)&04) | (reg<<3) | ((mode2.m_mode&03)<<6) ) ;
|
||||
emit1( (mode2.m_mode>>2) | (mode1.m_mode<<3) ) ;
|
||||
}
|
||||
|
||||
form9(id,i_type,f_type) {
|
||||
void form9(int id,int i_type,int f_type) {
|
||||
emit1(0x3E) ;
|
||||
emit1( i_type | (f_type<<2) | (id_op(id)<<3) | ((mode2.m_mode&03)<<6) ) ;
|
||||
emit1( (mode2.m_mode>>2) | (mode1.m_mode<<3) ) ;
|
||||
}
|
||||
|
||||
form11(id) {
|
||||
void form11(int id) {
|
||||
assert ( id_t1(id)==T_FL && id_t2(id)==T_FL && id_g1(id)==id_g2(id) );
|
||||
emit1(0xBE) ;
|
||||
emit1( id_g1(id) | (id_op(id)<<2) | ((mode2.m_mode&3)<<6) ) ;
|
||||
emit1( (mode2.m_mode>>2) | (mode1.m_mode<<3) ) ;
|
||||
}
|
||||
|
||||
form14(id,reg) {
|
||||
void form14(int id,int reg) {
|
||||
assert ( id_t1(id)==T_INT ) ;
|
||||
emit1(0x1E) ;
|
||||
emit1( id_g1(id) | (id_op(id)<<2) | ((reg&1)<<7 ) ) ;
|
||||
emit1( (reg>>1) | (mode1.m_mode<<3) ) ;
|
||||
}
|
||||
|
||||
frm15_0(id,reg) {
|
||||
void frm15_0(int id,int reg) {
|
||||
assert ( id_t1(id)==T_INT ) ;
|
||||
emit1(0x16 /* + slave<<5 */ ) ;
|
||||
emit1( id_g1(id) | (id_op(id)<<2) | ((reg&1)<<7 ) ) ;
|
||||
emit1( (reg>>1) | (mode1.m_mode<<3) ) ;
|
||||
}
|
||||
|
||||
frm15_1(id,i_type,s_type) {
|
||||
void frm15_1(int id,int i_type,int s_type) {
|
||||
emit1(0x16 /* + slave<<5 */ ) ;
|
||||
emit1( i_type | (s_type<<2) | (id_op(id)<<3) | ((mode2.m_mode&03)<<6) ) ;
|
||||
emit1( (mode2.m_mode>>2) | (mode1.m_mode<<3) ) ;
|
||||
}
|
||||
|
||||
frm15_5(id) {
|
||||
void frm15_5(int id) {
|
||||
assert(id_t1(id)==T_SLAVE&& id_t2(id)==T_SLAVE&& id_g1(id)==id_g2(id) );
|
||||
emit1(0x16 /* + slave<<5 */ ) ;
|
||||
emit1( id_g1(id) | (id_op(id)<<2) | ((mode2.m_mode&3)<<6) ) ;
|
||||
emit1( (mode2.m_mode>>2) | (mode1.m_mode<<3) ) ;
|
||||
}
|
||||
|
||||
gen1(id) {
|
||||
void gen1(int id) {
|
||||
if ( (mode1.m_mode&0x1C)==0x1C ) {
|
||||
emit1(mode1.m_index) ;
|
||||
}
|
||||
|
@ -130,7 +130,7 @@ gen1(id) {
|
|||
}
|
||||
}
|
||||
|
||||
gengen(id) {
|
||||
void gengen(int id) {
|
||||
if ( (mode1.m_mode&0x1C)==0x1C ) {
|
||||
emit1(mode1.m_index) ;
|
||||
}
|
||||
|
@ -163,8 +163,8 @@ gengen(id) {
|
|||
}
|
||||
}
|
||||
|
||||
disp(expr, relpc) register expr_t *expr ; {
|
||||
register sm1, sm2 ;
|
||||
void disp(register expr_t *expr, int relpc) {
|
||||
register int sm1, sm2 ;
|
||||
|
||||
sm1=0 ; sm2=0 ;
|
||||
if (DOTTYP >= 0x2 && DOTTYP<=0x7F &&
|
||||
|
@ -202,7 +202,8 @@ disp(expr, relpc) register expr_t *expr ; {
|
|||
else putdisp(expr->val,4) ;
|
||||
}
|
||||
|
||||
putdisp(val,size) valu_t val ; {
|
||||
void putdisp(valu_t val,int size)
|
||||
{
|
||||
switch ( size ) {
|
||||
case 1 :
|
||||
emit1( ((int)val)&0x7F ) ;
|
||||
|
@ -220,7 +221,8 @@ putdisp(val,size) valu_t val ; {
|
|||
}
|
||||
}
|
||||
|
||||
dot_adjust(expr) register expr_t *expr ; {
|
||||
void dot_adjust(register expr_t *expr)
|
||||
{
|
||||
expr->val -= DOTVAL ;
|
||||
if ( pass==PASS_2 ) {
|
||||
if ( (expr->typ&S_DOT) == 0 && expr->val>0 ) {
|
||||
|
@ -239,7 +241,8 @@ dot_adjust(expr) register expr_t *expr ; {
|
|||
* an immediate value in a field which is too small to fit in.
|
||||
*/
|
||||
|
||||
testsize(type,val) {
|
||||
int testsize(int type,int val)
|
||||
{
|
||||
/* check if value fits in type */
|
||||
switch( type ) {
|
||||
case I_DOUBLE : return fit32(val);
|
||||
|
@ -248,7 +251,8 @@ testsize(type,val) {
|
|||
}
|
||||
}
|
||||
|
||||
imm(i_type,expr) register expr_t *expr ; {
|
||||
void imm(int i_type,register expr_t *expr)
|
||||
{
|
||||
/* emit value of immediate expression , after check on FIT */
|
||||
if (!testsize(i_type,(int)expr->val))
|
||||
warning("immediate operand too large");
|
||||
|
@ -278,8 +282,9 @@ imm(i_type,expr) register expr_t *expr ; {
|
|||
}
|
||||
|
||||
|
||||
reg_list(list,reverse) {
|
||||
register rev_list, i ;
|
||||
int reg_list(int list,int reverse)
|
||||
{
|
||||
register int rev_list, i ;
|
||||
if ( !reverse ) {
|
||||
return list ;
|
||||
}
|
||||
|
@ -291,7 +296,9 @@ reg_list(list,reverse) {
|
|||
}
|
||||
return rev_list ;
|
||||
}
|
||||
cpu_opt(indic) {
|
||||
|
||||
int cpu_opt(int indic)
|
||||
{
|
||||
switch( indic ) {
|
||||
case 'i' : return 1 ;
|
||||
case 'f' : return 2 ;
|
||||
|
@ -303,7 +310,7 @@ cpu_opt(indic) {
|
|||
}
|
||||
}
|
||||
|
||||
string_opt(indic) {
|
||||
int string_opt(int indic) {
|
||||
switch( indic ) {
|
||||
case 'b' : return SO_BACKW ;
|
||||
case 'u' : return SO_UNTIL ;
|
||||
|
|
|
@ -36,4 +36,11 @@ extern expr_t exp_1, exp_2;
|
|||
extern int rel_1, rel_2;
|
||||
extern int im1flag INIT(0);
|
||||
extern int im2flag INIT(0);
|
||||
extern valu_t adjust();
|
||||
|
||||
void op1(int mode);
|
||||
void op2(int mode);
|
||||
void branch(int opc,expr_t exp);
|
||||
void ejump(int opc, expr_t exp);
|
||||
void sob(int reg, expr_t exp);
|
||||
int jump(int opc,int opr);
|
||||
valu_t adjust(expr_t exp);
|
||||
|
|
|
@ -7,149 +7,149 @@
|
|||
/*,
|
||||
* PDP 11 keywords,
|
||||
*/
|
||||
0, REG, 00, "r0",
|
||||
0, REG, 01, "r1",
|
||||
0, REG, 02, "r2",
|
||||
0, REG, 03, "r3",
|
||||
0, REG, 04, "r4",
|
||||
0, REG, 05, "r5",
|
||||
0, REG, 06, "r6",
|
||||
0, REG, 06, "sp",
|
||||
0, REG, 07, "r7",
|
||||
0, REG, 07, "pc",
|
||||
0, FREG, 00, "fr0",
|
||||
0, FREG, 01, "fr1",
|
||||
0, FREG, 02, "fr2",
|
||||
0, FREG, 03, "fr3",
|
||||
0, FRSP, 04, "fr4",
|
||||
0, FRSP, 05, "fr5",
|
||||
0, OP_SO, 05000, "clr",
|
||||
0, OP_SO, 0105000, "clrb",
|
||||
0, OP_SO, 05100, "com",
|
||||
0, OP_SO, 0105100, "comb",
|
||||
0, OP_SO, 005200, "inc",
|
||||
0, OP_SO, 0105200, "incb",
|
||||
0, OP_SO, 005300, "dec",
|
||||
0, OP_SO, 0105300, "decb",
|
||||
0, OP_SO, 005400, "neg",
|
||||
0, OP_SO, 0105400, "negb",
|
||||
0, OP_SO, 005700, "tst",
|
||||
0, OP_SO, 0105700, "tstb",
|
||||
0, OP_SO, 006200, "asr",
|
||||
0, OP_SO, 0106200, "asrb",
|
||||
0, OP_SO, 006300, "asl",
|
||||
0, OP_SO, 0106300, "aslb",
|
||||
0, OP_SO, 006000, "ror",
|
||||
0, OP_SO, 0106000, "rorb",
|
||||
0, OP_SO, 006100, "rol",
|
||||
0, OP_SO, 0106100, "rolb",
|
||||
0, OP_SO, 000300, "swab",
|
||||
0, OP_SO, 005500, "adc",
|
||||
0, OP_SO, 0105500, "adcb",
|
||||
0, OP_SO, 005600, "sbc",
|
||||
0, OP_SO, 0105600, "sbcb",
|
||||
0, OP_SO, 006700, "sxt",
|
||||
0, OP_DO, 010000, "mov",
|
||||
0, OP_DO, 0110000, "movb",
|
||||
0, OP_DO, 020000, "cmp",
|
||||
0, OP_DO, 0120000, "cmpb",
|
||||
0, OP_DO, 060000, "add",
|
||||
0, OP_DO, 0160000, "sub",
|
||||
0, OP_DO, 030000, "bit",
|
||||
0, OP_DO, 0130000, "bitb",
|
||||
0, OP_DO, 040000, "bic",
|
||||
0, OP_DO, 0140000, "bicb",
|
||||
0, OP_DO, 050000, "bis",
|
||||
0, OP_DO, 0150000, "bisb",
|
||||
0, OP_R_SO, 074000, "xor",
|
||||
0, JMP, 0100, "jmp",
|
||||
0, BR, 0400, "br",
|
||||
0, BR, 01000, "bne",
|
||||
0, BR, 01400, "beq",
|
||||
0, BR, 0100000, "bpl",
|
||||
0, BR, 0100400, "bmi",
|
||||
0, BR, 0102000, "bvc",
|
||||
0, BR, 0102400, "bvs",
|
||||
0, BR, 0103000, "bcc",
|
||||
0, BR, 0103400, "bcs",
|
||||
0, BR, 002000, "bge",
|
||||
0, BR, 002400, "blt",
|
||||
0, BR, 003000, "bgt",
|
||||
0, BR, 003400, "ble",
|
||||
0, BR, 0101000, "bhi",
|
||||
0, BR, 0101400, "blos",
|
||||
0, BR, 0103000, "bhis",
|
||||
0, BR, 0103400, "blo",
|
||||
0, EJMP, 0400, "jbr",
|
||||
0, EJMP, 01000, "jne",
|
||||
0, EJMP, 01400, "jeq",
|
||||
0, EJMP, 0100000, "jpl",
|
||||
0, EJMP, 0100400, "jmi",
|
||||
0, EJMP, 0102000, "jvc",
|
||||
0, EJMP, 0102400, "jvs",
|
||||
0, EJMP, 0103000, "jcc",
|
||||
0, EJMP, 0103400, "jcs",
|
||||
0, EJMP, 02000, "jge",
|
||||
0, EJMP, 02400, "jlt",
|
||||
0, EJMP, 03000, "jgt",
|
||||
0, EJMP, 03400, "jle",
|
||||
0, EJMP, 0101000, "jhi",
|
||||
0, EJMP, 0101400, "jlos",
|
||||
0, EJMP, 0103000, "jhis",
|
||||
0, EJMP, 0103400, "jlo",
|
||||
0, JSR, 004000, "jsr",
|
||||
0, RTS, 000200, "rts",
|
||||
0, MARK, 006400, "mark",
|
||||
0, SOB, 077000, "sob",
|
||||
0, SPL, 0230, "spl",
|
||||
0, TRAP, 0104000, "emt",
|
||||
0, TRAP, 0104400, "trap",
|
||||
0, TRAP, 0104400, "sys",
|
||||
0, OP_NO, 03, "bpt",
|
||||
0, OP_NO, 04, "iot",
|
||||
0, OP_NO, 02, "rti",
|
||||
0, OP_NO, 06, "rtt",
|
||||
0, OP_NO, 0, "halt",
|
||||
0, OP_NO, 01, "wait",
|
||||
0, OP_NO, 05, "reset",
|
||||
0, OP_NO, 0170000, "cfcc",
|
||||
0, OP_NO, 0170002, "seti",
|
||||
0, OP_NO, 0170012, "setl",
|
||||
0, OP_NO, 0170001, "setf",
|
||||
0, OP_NO, 0170011, "setd",
|
||||
0, CLEARCC, 0241, "clc",
|
||||
0, CLEARCC, 0242, "clv",
|
||||
0, CLEARCC, 0244, "clz",
|
||||
0, CLEARCC, 0250, "cln",
|
||||
0, SETCC, 0261, "sec",
|
||||
0, SETCC, 0262, "sev",
|
||||
0, SETCC, 0264, "sez",
|
||||
0, SETCC, 0270, "sen",
|
||||
0, OP_SO_R, 070000, "mul",
|
||||
0, OP_SO_R, 071000, "div",
|
||||
0, OP_SO_R, 072000, "ash",
|
||||
0, OP_SO_R, 073000, "ashc",
|
||||
0, MFP, 006500, "mfpi",
|
||||
0, MFP, 0106500, "mfpd",
|
||||
0, MFP, 006600, "mtpi",
|
||||
0, MFP, 0106600, "mtpd",
|
||||
0, FOP_FSO_FR, 0172000, "addf",
|
||||
0, FOP_FSO_FR, 0173000, "subf",
|
||||
0, FOP_FSO_FR, 0171000, "mulf",
|
||||
0, FOP_FSO_FR, 0174400, "divf",
|
||||
0, FOP_FSO_FR, 0173400, "cmpf",
|
||||
0, FOP_FSO_FR, 0171400, "modf",
|
||||
0, FOP_FSO, 0170400, "clrf",
|
||||
0, FOP_FSO, 0170700, "negf",
|
||||
0, FOP_FSO, 0170600, "absf",
|
||||
0, FOP_FSO, 0170500, "tstf",
|
||||
0, FOP_SO, 0170100, "ldfps",
|
||||
0, FOP_SO, 0170200, "stfps",
|
||||
0, FOP_SO, 0170300, "stst",
|
||||
0, MOVF, 0, "movf",
|
||||
0, FOP_SO_FR, 0177000, "movif",
|
||||
0, FOP_SO_FR, 0176400, "movie",
|
||||
0, FOP_FR_SO, 0175400, "movfi",
|
||||
0, FOP_FR_SO, 0175000, "movei",
|
||||
0, FOP_FSO_FR, 0177400, "movof",
|
||||
0, FOP_FR_FSO, 0176000, "movfo",
|
||||
{0, REG, 00, "r0"},
|
||||
{0, REG, 01, "r1"},
|
||||
{0, REG, 02, "r2"},
|
||||
{0, REG, 03, "r3"},
|
||||
{0, REG, 04, "r4"},
|
||||
{0, REG, 05, "r5"},
|
||||
{0, REG, 06, "r6"},
|
||||
{0, REG, 06, "sp"},
|
||||
{0, REG, 07, "r7"},
|
||||
{0, REG, 07, "pc"},
|
||||
{0, FREG, 00, "fr0"},
|
||||
{0, FREG, 01, "fr1"},
|
||||
{0, FREG, 02, "fr2"},
|
||||
{0, FREG, 03, "fr3"},
|
||||
{0, FRSP, 04, "fr4"},
|
||||
{0, FRSP, 05, "fr5"},
|
||||
{0, OP_SO, 05000, "clr"},
|
||||
{0, OP_SO, 0105000, "clrb"},
|
||||
{0, OP_SO, 05100, "com"},
|
||||
{0, OP_SO, 0105100, "comb"},
|
||||
{0, OP_SO, 005200, "inc"},
|
||||
{0, OP_SO, 0105200, "incb"},
|
||||
{0, OP_SO, 005300, "dec"},
|
||||
{0, OP_SO, 0105300, "decb"},
|
||||
{0, OP_SO, 005400, "neg"},
|
||||
{0, OP_SO, 0105400, "negb"},
|
||||
{0, OP_SO, 005700, "tst"},
|
||||
{0, OP_SO, 0105700, "tstb"},
|
||||
{0, OP_SO, 006200, "asr"},
|
||||
{0, OP_SO, 0106200, "asrb"},
|
||||
{0, OP_SO, 006300, "asl"},
|
||||
{0, OP_SO, 0106300, "aslb"},
|
||||
{0, OP_SO, 006000, "ror"},
|
||||
{0, OP_SO, 0106000, "rorb"},
|
||||
{0, OP_SO, 006100, "rol"},
|
||||
{0, OP_SO, 0106100, "rolb"},
|
||||
{0, OP_SO, 000300, "swab"},
|
||||
{0, OP_SO, 005500, "adc"},
|
||||
{0, OP_SO, 0105500, "adcb"},
|
||||
{0, OP_SO, 005600, "sbc"},
|
||||
{0, OP_SO, 0105600, "sbcb"},
|
||||
{0, OP_SO, 006700, "sxt"},
|
||||
{0, OP_DO, 010000, "mov"},
|
||||
{0, OP_DO, 0110000, "movb"},
|
||||
{0, OP_DO, 020000, "cmp"},
|
||||
{0, OP_DO, 0120000, "cmpb"},
|
||||
{0, OP_DO, 060000, "add"},
|
||||
{0, OP_DO, 0160000, "sub"},
|
||||
{0, OP_DO, 030000, "bit"},
|
||||
{0, OP_DO, 0130000, "bitb"},
|
||||
{0, OP_DO, 040000, "bic"},
|
||||
{0, OP_DO, 0140000, "bicb"},
|
||||
{0, OP_DO, 050000, "bis"},
|
||||
{0, OP_DO, 0150000, "bisb"},
|
||||
{0, OP_R_SO, 074000, "xor"},
|
||||
{0, JMP, 0100, "jmp"},
|
||||
{0, BR, 0400, "br"},
|
||||
{0, BR, 01000, "bne"},
|
||||
{0, BR, 01400, "beq"},
|
||||
{0, BR, 0100000, "bpl"},
|
||||
{0, BR, 0100400, "bmi"},
|
||||
{0, BR, 0102000, "bvc"},
|
||||
{0, BR, 0102400, "bvs"},
|
||||
{0, BR, 0103000, "bcc"},
|
||||
{0, BR, 0103400, "bcs"},
|
||||
{0, BR, 002000, "bge"},
|
||||
{0, BR, 002400, "blt"},
|
||||
{0, BR, 003000, "bgt"},
|
||||
{0, BR, 003400, "ble"},
|
||||
{0, BR, 0101000, "bhi"},
|
||||
{0, BR, 0101400, "blos"},
|
||||
{0, BR, 0103000, "bhis"},
|
||||
{0, BR, 0103400, "blo"},
|
||||
{0, EJMP, 0400, "jbr"},
|
||||
{0, EJMP, 01000, "jne"},
|
||||
{0, EJMP, 01400, "jeq"},
|
||||
{0, EJMP, 0100000, "jpl"},
|
||||
{0, EJMP, 0100400, "jmi"},
|
||||
{0, EJMP, 0102000, "jvc"},
|
||||
{0, EJMP, 0102400, "jvs"},
|
||||
{0, EJMP, 0103000, "jcc"},
|
||||
{0, EJMP, 0103400, "jcs"},
|
||||
{0, EJMP, 02000, "jge"},
|
||||
{0, EJMP, 02400, "jlt"},
|
||||
{0, EJMP, 03000, "jgt"},
|
||||
{0, EJMP, 03400, "jle"},
|
||||
{0, EJMP, 0101000, "jhi"},
|
||||
{0, EJMP, 0101400, "jlos"},
|
||||
{0, EJMP, 0103000, "jhis"},
|
||||
{0, EJMP, 0103400, "jlo"},
|
||||
{0, JSR, 004000, "jsr"},
|
||||
{0, RTS, 000200, "rts"},
|
||||
{0, MARK, 006400, "mark"},
|
||||
{0, SOB, 077000, "sob"},
|
||||
{0, SPL, 0230, "spl"},
|
||||
{0, TRAP, 0104000, "emt"},
|
||||
{0, TRAP, 0104400, "trap"},
|
||||
{0, TRAP, 0104400, "sys"},
|
||||
{0, OP_NO, 03, "bpt"},
|
||||
{0, OP_NO, 04, "iot"},
|
||||
{0, OP_NO, 02, "rti"},
|
||||
{0, OP_NO, 06, "rtt"},
|
||||
{0, OP_NO, 0, "halt"},
|
||||
{0, OP_NO, 01, "wait"},
|
||||
{0, OP_NO, 05, "reset"},
|
||||
{0, OP_NO, 0170000, "cfcc"},
|
||||
{0, OP_NO, 0170002, "seti"},
|
||||
{0, OP_NO, 0170012, "setl"},
|
||||
{0, OP_NO, 0170001, "setf"},
|
||||
{0, OP_NO, 0170011, "setd"},
|
||||
{0, CLEARCC, 0241, "clc"},
|
||||
{0, CLEARCC, 0242, "clv"},
|
||||
{0, CLEARCC, 0244, "clz"},
|
||||
{0, CLEARCC, 0250, "cln"},
|
||||
{0, SETCC, 0261, "sec"},
|
||||
{0, SETCC, 0262, "sev"},
|
||||
{0, SETCC, 0264, "sez"},
|
||||
{0, SETCC, 0270, "sen"},
|
||||
{0, OP_SO_R, 070000, "mul"},
|
||||
{0, OP_SO_R, 071000, "div"},
|
||||
{0, OP_SO_R, 072000, "ash"},
|
||||
{0, OP_SO_R, 073000, "ashc"},
|
||||
{0, MFP, 006500, "mfpi"},
|
||||
{0, MFP, 0106500, "mfpd"},
|
||||
{0, MFP, 006600, "mtpi"},
|
||||
{0, MFP, 0106600, "mtpd"},
|
||||
{0, FOP_FSO_FR, 0172000, "addf"},
|
||||
{0, FOP_FSO_FR, 0173000, "subf"},
|
||||
{0, FOP_FSO_FR, 0171000, "mulf"},
|
||||
{0, FOP_FSO_FR, 0174400, "divf"},
|
||||
{0, FOP_FSO_FR, 0173400, "cmpf"},
|
||||
{0, FOP_FSO_FR, 0171400, "modf"},
|
||||
{0, FOP_FSO, 0170400, "clrf"},
|
||||
{0, FOP_FSO, 0170700, "negf"},
|
||||
{0, FOP_FSO, 0170600, "absf"},
|
||||
{0, FOP_FSO, 0170500, "tstf"},
|
||||
{0, FOP_SO, 0170100, "ldfps"},
|
||||
{0, FOP_SO, 0170200, "stfps"},
|
||||
{0, FOP_SO, 0170300, "stst"},
|
||||
{0, MOVF, 0, "movf"},
|
||||
{0, FOP_SO_FR, 0177000, "movif"},
|
||||
{0, FOP_SO_FR, 0176400, "movie"},
|
||||
{0, FOP_FR_SO, 0175400, "movfi"},
|
||||
{0, FOP_FR_SO, 0175000, "movei"},
|
||||
{0, FOP_FSO_FR, 0177400, "movof"},
|
||||
{0, FOP_FR_FSO, 0176000, "movfo"},
|
||||
|
|
|
@ -6,7 +6,8 @@
|
|||
*
|
||||
*/
|
||||
|
||||
op1(mode) {
|
||||
void op1(int mode)
|
||||
{
|
||||
int relpc = 0;
|
||||
if (im1flag) {
|
||||
if (mode == 067 || mode == 077) {
|
||||
|
@ -23,7 +24,8 @@ op1(mode) {
|
|||
}
|
||||
}
|
||||
|
||||
op2(mode) {
|
||||
void op2(int mode)
|
||||
{
|
||||
int relpc = 0;
|
||||
if (im2flag) {
|
||||
if (mode == 067 || mode == 077) {
|
||||
|
@ -40,9 +42,10 @@ op2(mode) {
|
|||
}
|
||||
}
|
||||
|
||||
branch(opc,exp) expr_t exp; {
|
||||
register eval;
|
||||
register sm;
|
||||
void branch(int opc,expr_t exp)
|
||||
{
|
||||
register int eval;
|
||||
register int sm;
|
||||
|
||||
eval = adjust(exp) >> 1;
|
||||
sm = fitb(eval);
|
||||
|
@ -53,8 +56,9 @@ branch(opc,exp) expr_t exp; {
|
|||
emit2(opc | lowb(eval));
|
||||
}
|
||||
|
||||
ejump(opc, exp) expr_t exp; {
|
||||
register sm,eval;
|
||||
void ejump(int opc, expr_t exp)
|
||||
{
|
||||
register int sm,eval;
|
||||
int gain;
|
||||
|
||||
# ifdef THREE_PASS
|
||||
|
@ -82,7 +86,8 @@ ejump(opc, exp) expr_t exp; {
|
|||
# endif
|
||||
}
|
||||
|
||||
sob(reg, exp) expr_t exp; {
|
||||
void sob(int reg, expr_t exp)
|
||||
{
|
||||
if ((exp.typ & ~S_DOT) != DOTTYP) {
|
||||
serror("error in sob-label");
|
||||
}
|
||||
|
@ -91,12 +96,13 @@ sob(reg, exp) expr_t exp; {
|
|||
emit2( OPSOB | (reg << 6) | exp.val);
|
||||
}
|
||||
|
||||
jump(opc,opr) {
|
||||
register val;
|
||||
int jump(int opc,int opr)
|
||||
{
|
||||
register int val;
|
||||
|
||||
# ifdef THREE_PASS
|
||||
if (opr==067) {
|
||||
register sm = 0;
|
||||
register int sm = 0;
|
||||
|
||||
val = adjust(exp_1) >> 1;
|
||||
if ( fitb(val) && (exp_1.typ & ~S_DOT) == DOTTYP) {
|
||||
|
@ -111,9 +117,11 @@ jump(opc,opr) {
|
|||
# endif
|
||||
emit2(opc | opr);
|
||||
op1(opr);
|
||||
return(0);
|
||||
}
|
||||
|
||||
valu_t adjust(exp) expr_t exp; {
|
||||
valu_t adjust(expr_t exp)
|
||||
{
|
||||
valu_t val;
|
||||
|
||||
val = exp.val - DOTVAL - 2;
|
||||
|
|
|
@ -1,7 +1,3 @@
|
|||
#ifndef NORCSID
|
||||
static char rcsid[] = "$Id$";
|
||||
#endif
|
||||
|
||||
/*
|
||||
* (c) copyright 1987 by the Vrije Universiteit, Amsterdam, The Netherlands.
|
||||
* See the copyright notice in the ACK home directory, in the file "Copyright".
|
||||
|
@ -13,10 +9,12 @@ static char rcsid[] = "$Id$";
|
|||
* machine dependent back end routines for the PDP-11
|
||||
*/
|
||||
|
||||
/* #define REGPATCH /* save all registers in markblock */
|
||||
/* #define REGPATCH */ /* save all registers in markblock */
|
||||
|
||||
con_part(sz,w) register sz; word w; {
|
||||
|
||||
|
||||
void con_part(register int sz, word w)
|
||||
{
|
||||
while (part_size % sz)
|
||||
part_size++;
|
||||
if (part_size == TEM_WSIZE)
|
||||
|
@ -33,8 +31,8 @@ con_part(sz,w) register sz; word w; {
|
|||
part_size += sz;
|
||||
}
|
||||
|
||||
con_mult(sz) word sz; {
|
||||
long l, atol();
|
||||
void con_mult(word sz) {
|
||||
long l;
|
||||
|
||||
if (sz != 4)
|
||||
fatal("bad icon/ucon size");
|
||||
|
@ -63,8 +61,8 @@ struct regadm {
|
|||
} regadm[2];
|
||||
int n_regvars;
|
||||
|
||||
regscore(off,size,typ,score,totyp) long off; {
|
||||
|
||||
int regscore(long off,int size,int typ,int score,int totyp)
|
||||
{
|
||||
if (size != 2)
|
||||
return(-1);
|
||||
score -= 1; /* allow for save/restore */
|
||||
|
@ -79,14 +77,14 @@ regscore(off,size,typ,score,totyp) long off; {
|
|||
return(score); /* estimated # of words of profit */
|
||||
}
|
||||
|
||||
i_regsave() {
|
||||
void i_regsave(void) {
|
||||
|
||||
Rstring[0] = 0;
|
||||
n_regvars=0;
|
||||
}
|
||||
|
||||
f_regsave() {
|
||||
register i;
|
||||
void f_regsave(void) {
|
||||
register int i;
|
||||
|
||||
if (n_regvars==0 || lbytes==0) {
|
||||
#ifdef REGPATCH
|
||||
|
@ -113,8 +111,8 @@ f_regsave() {
|
|||
regadm[i].ra_str);
|
||||
}
|
||||
|
||||
regsave(regstr,off,size) char *regstr; long off; {
|
||||
|
||||
void regsave(char *regstr,long off,int size)
|
||||
{
|
||||
fprintf(codefile,"%c Local %ld into %s\n",COMMENTCHAR,off,regstr);
|
||||
/* commented away
|
||||
#ifndef REGPATCH
|
||||
|
@ -131,7 +129,7 @@ end of commented away */
|
|||
n_regvars++;
|
||||
}
|
||||
|
||||
regreturn() {
|
||||
void regreturn(void) {
|
||||
|
||||
#ifdef REGPATCH
|
||||
fprintf(codefile,"jmp eret\n");
|
||||
|
@ -142,7 +140,7 @@ regreturn() {
|
|||
|
||||
#endif
|
||||
|
||||
prolog(nlocals) full nlocals; {
|
||||
void prolog(full nlocals) {
|
||||
|
||||
#ifndef REGVARS
|
||||
#ifdef REGPATCH
|
||||
|
@ -160,8 +158,8 @@ prolog(nlocals) full nlocals; {
|
|||
#endif
|
||||
}
|
||||
|
||||
dlbdlb(as,ls) string as,ls; {
|
||||
|
||||
void dlbdlb(string as,string ls)
|
||||
{
|
||||
if (strlen(as)+strlen(ls)+2<sizeof(labstr)) {
|
||||
strcat(ls,":");
|
||||
strcat(ls,as);
|
||||
|
@ -169,8 +167,9 @@ dlbdlb(as,ls) string as,ls; {
|
|||
fatal("too many consecutive labels");
|
||||
}
|
||||
|
||||
mes(type) word type; {
|
||||
int argt ;
|
||||
void mes(word type)
|
||||
{
|
||||
int argt;
|
||||
|
||||
switch ( (int)type ) {
|
||||
case ms_ext :
|
||||
|
|
Some files were not shown because too many files have changed in this diff Show more
Loading…
Reference in a new issue