Initial commit
674
LICENSE
Executable file
|
@ -0,0 +1,674 @@
|
||||||
|
GNU GENERAL PUBLIC LICENSE
|
||||||
|
Version 3, 29 June 2007
|
||||||
|
|
||||||
|
Copyright (C) 2007 Free Software Foundation, Inc. <http://fsf.org/>
|
||||||
|
Everyone is permitted to copy and distribute verbatim copies
|
||||||
|
of this license document, but changing it is not allowed.
|
||||||
|
|
||||||
|
Preamble
|
||||||
|
|
||||||
|
The GNU General Public License is a free, copyleft license for
|
||||||
|
software and other kinds of works.
|
||||||
|
|
||||||
|
The licenses for most software and other practical works are designed
|
||||||
|
to take away your freedom to share and change the works. By contrast,
|
||||||
|
the GNU General Public License is intended to guarantee your freedom to
|
||||||
|
share and change all versions of a program--to make sure it remains free
|
||||||
|
software for all its users. We, the Free Software Foundation, use the
|
||||||
|
GNU General Public License for most of our software; it applies also to
|
||||||
|
any other work released this way by its authors. You can apply it to
|
||||||
|
your programs, too.
|
||||||
|
|
||||||
|
When we speak of free software, we are referring to freedom, not
|
||||||
|
price. Our General Public Licenses are designed to make sure that you
|
||||||
|
have the freedom to distribute copies of free software (and charge for
|
||||||
|
them if you wish), that you receive source code or can get it if you
|
||||||
|
want it, that you can change the software or use pieces of it in new
|
||||||
|
free programs, and that you know you can do these things.
|
||||||
|
|
||||||
|
To protect your rights, we need to prevent others from denying you
|
||||||
|
these rights or asking you to surrender the rights. Therefore, you have
|
||||||
|
certain responsibilities if you distribute copies of the software, or if
|
||||||
|
you modify it: responsibilities to respect the freedom of others.
|
||||||
|
|
||||||
|
For example, if you distribute copies of such a program, whether
|
||||||
|
gratis or for a fee, you must pass on to the recipients the same
|
||||||
|
freedoms that you received. You must make sure that they, too, receive
|
||||||
|
or can get the source code. And you must show them these terms so they
|
||||||
|
know their rights.
|
||||||
|
|
||||||
|
Developers that use the GNU GPL protect your rights with two steps:
|
||||||
|
(1) assert copyright on the software, and (2) offer you this License
|
||||||
|
giving you legal permission to copy, distribute and/or modify it.
|
||||||
|
|
||||||
|
For the developers' and authors' protection, the GPL clearly explains
|
||||||
|
that there is no warranty for this free software. For both users' and
|
||||||
|
authors' sake, the GPL requires that modified versions be marked as
|
||||||
|
changed, so that their problems will not be attributed erroneously to
|
||||||
|
authors of previous versions.
|
||||||
|
|
||||||
|
Some devices are designed to deny users access to install or run
|
||||||
|
modified versions of the software inside them, although the manufacturer
|
||||||
|
can do so. This is fundamentally incompatible with the aim of
|
||||||
|
protecting users' freedom to change the software. The systematic
|
||||||
|
pattern of such abuse occurs in the area of products for individuals to
|
||||||
|
use, which is precisely where it is most unacceptable. Therefore, we
|
||||||
|
have designed this version of the GPL to prohibit the practice for those
|
||||||
|
products. If such problems arise substantially in other domains, we
|
||||||
|
stand ready to extend this provision to those domains in future versions
|
||||||
|
of the GPL, as needed to protect the freedom of users.
|
||||||
|
|
||||||
|
Finally, every program is threatened constantly by software patents.
|
||||||
|
States should not allow patents to restrict development and use of
|
||||||
|
software on general-purpose computers, but in those that do, we wish to
|
||||||
|
avoid the special danger that patents applied to a free program could
|
||||||
|
make it effectively proprietary. To prevent this, the GPL assures that
|
||||||
|
patents cannot be used to render the program non-free.
|
||||||
|
|
||||||
|
The precise terms and conditions for copying, distribution and
|
||||||
|
modification follow.
|
||||||
|
|
||||||
|
TERMS AND CONDITIONS
|
||||||
|
|
||||||
|
0. Definitions.
|
||||||
|
|
||||||
|
"This License" refers to version 3 of the GNU General Public License.
|
||||||
|
|
||||||
|
"Copyright" also means copyright-like laws that apply to other kinds of
|
||||||
|
works, such as semiconductor masks.
|
||||||
|
|
||||||
|
"The Program" refers to any copyrightable work licensed under this
|
||||||
|
License. Each licensee is addressed as "you". "Licensees" and
|
||||||
|
"recipients" may be individuals or organizations.
|
||||||
|
|
||||||
|
To "modify" a work means to copy from or adapt all or part of the work
|
||||||
|
in a fashion requiring copyright permission, other than the making of an
|
||||||
|
exact copy. The resulting work is called a "modified version" of the
|
||||||
|
earlier work or a work "based on" the earlier work.
|
||||||
|
|
||||||
|
A "covered work" means either the unmodified Program or a work based
|
||||||
|
on the Program.
|
||||||
|
|
||||||
|
To "propagate" a work means to do anything with it that, without
|
||||||
|
permission, would make you directly or secondarily liable for
|
||||||
|
infringement under applicable copyright law, except executing it on a
|
||||||
|
computer or modifying a private copy. Propagation includes copying,
|
||||||
|
distribution (with or without modification), making available to the
|
||||||
|
public, and in some countries other activities as well.
|
||||||
|
|
||||||
|
To "convey" a work means any kind of propagation that enables other
|
||||||
|
parties to make or receive copies. Mere interaction with a user through
|
||||||
|
a computer network, with no transfer of a copy, is not conveying.
|
||||||
|
|
||||||
|
An interactive user interface displays "Appropriate Legal Notices"
|
||||||
|
to the extent that it includes a convenient and prominently visible
|
||||||
|
feature that (1) displays an appropriate copyright notice, and (2)
|
||||||
|
tells the user that there is no warranty for the work (except to the
|
||||||
|
extent that warranties are provided), that licensees may convey the
|
||||||
|
work under this License, and how to view a copy of this License. If
|
||||||
|
the interface presents a list of user commands or options, such as a
|
||||||
|
menu, a prominent item in the list meets this criterion.
|
||||||
|
|
||||||
|
1. Source Code.
|
||||||
|
|
||||||
|
The "source code" for a work means the preferred form of the work
|
||||||
|
for making modifications to it. "Object code" means any non-source
|
||||||
|
form of a work.
|
||||||
|
|
||||||
|
A "Standard Interface" means an interface that either is an official
|
||||||
|
standard defined by a recognized standards body, or, in the case of
|
||||||
|
interfaces specified for a particular programming language, one that
|
||||||
|
is widely used among developers working in that language.
|
||||||
|
|
||||||
|
The "System Libraries" of an executable work include anything, other
|
||||||
|
than the work as a whole, that (a) is included in the normal form of
|
||||||
|
packaging a Major Component, but which is not part of that Major
|
||||||
|
Component, and (b) serves only to enable use of the work with that
|
||||||
|
Major Component, or to implement a Standard Interface for which an
|
||||||
|
implementation is available to the public in source code form. A
|
||||||
|
"Major Component", in this context, means a major essential component
|
||||||
|
(kernel, window system, and so on) of the specific operating system
|
||||||
|
(if any) on which the executable work runs, or a compiler used to
|
||||||
|
produce the work, or an object code interpreter used to run it.
|
||||||
|
|
||||||
|
The "Corresponding Source" for a work in object code form means all
|
||||||
|
the source code needed to generate, install, and (for an executable
|
||||||
|
work) run the object code and to modify the work, including scripts to
|
||||||
|
control those activities. However, it does not include the work's
|
||||||
|
System Libraries, or general-purpose tools or generally available free
|
||||||
|
programs which are used unmodified in performing those activities but
|
||||||
|
which are not part of the work. For example, Corresponding Source
|
||||||
|
includes interface definition files associated with source files for
|
||||||
|
the work, and the source code for shared libraries and dynamically
|
||||||
|
linked subprograms that the work is specifically designed to require,
|
||||||
|
such as by intimate data communication or control flow between those
|
||||||
|
subprograms and other parts of the work.
|
||||||
|
|
||||||
|
The Corresponding Source need not include anything that users
|
||||||
|
can regenerate automatically from other parts of the Corresponding
|
||||||
|
Source.
|
||||||
|
|
||||||
|
The Corresponding Source for a work in source code form is that
|
||||||
|
same work.
|
||||||
|
|
||||||
|
2. Basic Permissions.
|
||||||
|
|
||||||
|
All rights granted under this License are granted for the term of
|
||||||
|
copyright on the Program, and are irrevocable provided the stated
|
||||||
|
conditions are met. This License explicitly affirms your unlimited
|
||||||
|
permission to run the unmodified Program. The output from running a
|
||||||
|
covered work is covered by this License only if the output, given its
|
||||||
|
content, constitutes a covered work. This License acknowledges your
|
||||||
|
rights of fair use or other equivalent, as provided by copyright law.
|
||||||
|
|
||||||
|
You may make, run and propagate covered works that you do not
|
||||||
|
convey, without conditions so long as your license otherwise remains
|
||||||
|
in force. You may convey covered works to others for the sole purpose
|
||||||
|
of having them make modifications exclusively for you, or provide you
|
||||||
|
with facilities for running those works, provided that you comply with
|
||||||
|
the terms of this License in conveying all material for which you do
|
||||||
|
not control copyright. Those thus making or running the covered works
|
||||||
|
for you must do so exclusively on your behalf, under your direction
|
||||||
|
and control, on terms that prohibit them from making any copies of
|
||||||
|
your copyrighted material outside their relationship with you.
|
||||||
|
|
||||||
|
Conveying under any other circumstances is permitted solely under
|
||||||
|
the conditions stated below. Sublicensing is not allowed; section 10
|
||||||
|
makes it unnecessary.
|
||||||
|
|
||||||
|
3. Protecting Users' Legal Rights From Anti-Circumvention Law.
|
||||||
|
|
||||||
|
No covered work shall be deemed part of an effective technological
|
||||||
|
measure under any applicable law fulfilling obligations under article
|
||||||
|
11 of the WIPO copyright treaty adopted on 20 December 1996, or
|
||||||
|
similar laws prohibiting or restricting circumvention of such
|
||||||
|
measures.
|
||||||
|
|
||||||
|
When you convey a covered work, you waive any legal power to forbid
|
||||||
|
circumvention of technological measures to the extent such circumvention
|
||||||
|
is effected by exercising rights under this License with respect to
|
||||||
|
the covered work, and you disclaim any intention to limit operation or
|
||||||
|
modification of the work as a means of enforcing, against the work's
|
||||||
|
users, your or third parties' legal rights to forbid circumvention of
|
||||||
|
technological measures.
|
||||||
|
|
||||||
|
4. Conveying Verbatim Copies.
|
||||||
|
|
||||||
|
You may convey verbatim copies of the Program's source code as you
|
||||||
|
receive it, in any medium, provided that you conspicuously and
|
||||||
|
appropriately publish on each copy an appropriate copyright notice;
|
||||||
|
keep intact all notices stating that this License and any
|
||||||
|
non-permissive terms added in accord with section 7 apply to the code;
|
||||||
|
keep intact all notices of the absence of any warranty; and give all
|
||||||
|
recipients a copy of this License along with the Program.
|
||||||
|
|
||||||
|
You may charge any price or no price for each copy that you convey,
|
||||||
|
and you may offer support or warranty protection for a fee.
|
||||||
|
|
||||||
|
5. Conveying Modified Source Versions.
|
||||||
|
|
||||||
|
You may convey a work based on the Program, or the modifications to
|
||||||
|
produce it from the Program, in the form of source code under the
|
||||||
|
terms of section 4, provided that you also meet all of these conditions:
|
||||||
|
|
||||||
|
a) The work must carry prominent notices stating that you modified
|
||||||
|
it, and giving a relevant date.
|
||||||
|
|
||||||
|
b) The work must carry prominent notices stating that it is
|
||||||
|
released under this License and any conditions added under section
|
||||||
|
7. This requirement modifies the requirement in section 4 to
|
||||||
|
"keep intact all notices".
|
||||||
|
|
||||||
|
c) You must license the entire work, as a whole, under this
|
||||||
|
License to anyone who comes into possession of a copy. This
|
||||||
|
License will therefore apply, along with any applicable section 7
|
||||||
|
additional terms, to the whole of the work, and all its parts,
|
||||||
|
regardless of how they are packaged. This License gives no
|
||||||
|
permission to license the work in any other way, but it does not
|
||||||
|
invalidate such permission if you have separately received it.
|
||||||
|
|
||||||
|
d) If the work has interactive user interfaces, each must display
|
||||||
|
Appropriate Legal Notices; however, if the Program has interactive
|
||||||
|
interfaces that do not display Appropriate Legal Notices, your
|
||||||
|
work need not make them do so.
|
||||||
|
|
||||||
|
A compilation of a covered work with other separate and independent
|
||||||
|
works, which are not by their nature extensions of the covered work,
|
||||||
|
and which are not combined with it such as to form a larger program,
|
||||||
|
in or on a volume of a storage or distribution medium, is called an
|
||||||
|
"aggregate" if the compilation and its resulting copyright are not
|
||||||
|
used to limit the access or legal rights of the compilation's users
|
||||||
|
beyond what the individual works permit. Inclusion of a covered work
|
||||||
|
in an aggregate does not cause this License to apply to the other
|
||||||
|
parts of the aggregate.
|
||||||
|
|
||||||
|
6. Conveying Non-Source Forms.
|
||||||
|
|
||||||
|
You may convey a covered work in object code form under the terms
|
||||||
|
of sections 4 and 5, provided that you also convey the
|
||||||
|
machine-readable Corresponding Source under the terms of this License,
|
||||||
|
in one of these ways:
|
||||||
|
|
||||||
|
a) Convey the object code in, or embodied in, a physical product
|
||||||
|
(including a physical distribution medium), accompanied by the
|
||||||
|
Corresponding Source fixed on a durable physical medium
|
||||||
|
customarily used for software interchange.
|
||||||
|
|
||||||
|
b) Convey the object code in, or embodied in, a physical product
|
||||||
|
(including a physical distribution medium), accompanied by a
|
||||||
|
written offer, valid for at least three years and valid for as
|
||||||
|
long as you offer spare parts or customer support for that product
|
||||||
|
model, to give anyone who possesses the object code either (1) a
|
||||||
|
copy of the Corresponding Source for all the software in the
|
||||||
|
product that is covered by this License, on a durable physical
|
||||||
|
medium customarily used for software interchange, for a price no
|
||||||
|
more than your reasonable cost of physically performing this
|
||||||
|
conveying of source, or (2) access to copy the
|
||||||
|
Corresponding Source from a network server at no charge.
|
||||||
|
|
||||||
|
c) Convey individual copies of the object code with a copy of the
|
||||||
|
written offer to provide the Corresponding Source. This
|
||||||
|
alternative is allowed only occasionally and noncommercially, and
|
||||||
|
only if you received the object code with such an offer, in accord
|
||||||
|
with subsection 6b.
|
||||||
|
|
||||||
|
d) Convey the object code by offering access from a designated
|
||||||
|
place (gratis or for a charge), and offer equivalent access to the
|
||||||
|
Corresponding Source in the same way through the same place at no
|
||||||
|
further charge. You need not require recipients to copy the
|
||||||
|
Corresponding Source along with the object code. If the place to
|
||||||
|
copy the object code is a network server, the Corresponding Source
|
||||||
|
may be on a different server (operated by you or a third party)
|
||||||
|
that supports equivalent copying facilities, provided you maintain
|
||||||
|
clear directions next to the object code saying where to find the
|
||||||
|
Corresponding Source. Regardless of what server hosts the
|
||||||
|
Corresponding Source, you remain obligated to ensure that it is
|
||||||
|
available for as long as needed to satisfy these requirements.
|
||||||
|
|
||||||
|
e) Convey the object code using peer-to-peer transmission, provided
|
||||||
|
you inform other peers where the object code and Corresponding
|
||||||
|
Source of the work are being offered to the general public at no
|
||||||
|
charge under subsection 6d.
|
||||||
|
|
||||||
|
A separable portion of the object code, whose source code is excluded
|
||||||
|
from the Corresponding Source as a System Library, need not be
|
||||||
|
included in conveying the object code work.
|
||||||
|
|
||||||
|
A "User Product" is either (1) a "consumer product", which means any
|
||||||
|
tangible personal property which is normally used for personal, family,
|
||||||
|
or household purposes, or (2) anything designed or sold for incorporation
|
||||||
|
into a dwelling. In determining whether a product is a consumer product,
|
||||||
|
doubtful cases shall be resolved in favor of coverage. For a particular
|
||||||
|
product received by a particular user, "normally used" refers to a
|
||||||
|
typical or common use of that class of product, regardless of the status
|
||||||
|
of the particular user or of the way in which the particular user
|
||||||
|
actually uses, or expects or is expected to use, the product. A product
|
||||||
|
is a consumer product regardless of whether the product has substantial
|
||||||
|
commercial, industrial or non-consumer uses, unless such uses represent
|
||||||
|
the only significant mode of use of the product.
|
||||||
|
|
||||||
|
"Installation Information" for a User Product means any methods,
|
||||||
|
procedures, authorization keys, or other information required to install
|
||||||
|
and execute modified versions of a covered work in that User Product from
|
||||||
|
a modified version of its Corresponding Source. The information must
|
||||||
|
suffice to ensure that the continued functioning of the modified object
|
||||||
|
code is in no case prevented or interfered with solely because
|
||||||
|
modification has been made.
|
||||||
|
|
||||||
|
If you convey an object code work under this section in, or with, or
|
||||||
|
specifically for use in, a User Product, and the conveying occurs as
|
||||||
|
part of a transaction in which the right of possession and use of the
|
||||||
|
User Product is transferred to the recipient in perpetuity or for a
|
||||||
|
fixed term (regardless of how the transaction is characterized), the
|
||||||
|
Corresponding Source conveyed under this section must be accompanied
|
||||||
|
by the Installation Information. But this requirement does not apply
|
||||||
|
if neither you nor any third party retains the ability to install
|
||||||
|
modified object code on the User Product (for example, the work has
|
||||||
|
been installed in ROM).
|
||||||
|
|
||||||
|
The requirement to provide Installation Information does not include a
|
||||||
|
requirement to continue to provide support service, warranty, or updates
|
||||||
|
for a work that has been modified or installed by the recipient, or for
|
||||||
|
the User Product in which it has been modified or installed. Access to a
|
||||||
|
network may be denied when the modification itself materially and
|
||||||
|
adversely affects the operation of the network or violates the rules and
|
||||||
|
protocols for communication across the network.
|
||||||
|
|
||||||
|
Corresponding Source conveyed, and Installation Information provided,
|
||||||
|
in accord with this section must be in a format that is publicly
|
||||||
|
documented (and with an implementation available to the public in
|
||||||
|
source code form), and must require no special password or key for
|
||||||
|
unpacking, reading or copying.
|
||||||
|
|
||||||
|
7. Additional Terms.
|
||||||
|
|
||||||
|
"Additional permissions" are terms that supplement the terms of this
|
||||||
|
License by making exceptions from one or more of its conditions.
|
||||||
|
Additional permissions that are applicable to the entire Program shall
|
||||||
|
be treated as though they were included in this License, to the extent
|
||||||
|
that they are valid under applicable law. If additional permissions
|
||||||
|
apply only to part of the Program, that part may be used separately
|
||||||
|
under those permissions, but the entire Program remains governed by
|
||||||
|
this License without regard to the additional permissions.
|
||||||
|
|
||||||
|
When you convey a copy of a covered work, you may at your option
|
||||||
|
remove any additional permissions from that copy, or from any part of
|
||||||
|
it. (Additional permissions may be written to require their own
|
||||||
|
removal in certain cases when you modify the work.) You may place
|
||||||
|
additional permissions on material, added by you to a covered work,
|
||||||
|
for which you have or can give appropriate copyright permission.
|
||||||
|
|
||||||
|
Notwithstanding any other provision of this License, for material you
|
||||||
|
add to a covered work, you may (if authorized by the copyright holders of
|
||||||
|
that material) supplement the terms of this License with terms:
|
||||||
|
|
||||||
|
a) Disclaiming warranty or limiting liability differently from the
|
||||||
|
terms of sections 15 and 16 of this License; or
|
||||||
|
|
||||||
|
b) Requiring preservation of specified reasonable legal notices or
|
||||||
|
author attributions in that material or in the Appropriate Legal
|
||||||
|
Notices displayed by works containing it; or
|
||||||
|
|
||||||
|
c) Prohibiting misrepresentation of the origin of that material, or
|
||||||
|
requiring that modified versions of such material be marked in
|
||||||
|
reasonable ways as different from the original version; or
|
||||||
|
|
||||||
|
d) Limiting the use for publicity purposes of names of licensors or
|
||||||
|
authors of the material; or
|
||||||
|
|
||||||
|
e) Declining to grant rights under trademark law for use of some
|
||||||
|
trade names, trademarks, or service marks; or
|
||||||
|
|
||||||
|
f) Requiring indemnification of licensors and authors of that
|
||||||
|
material by anyone who conveys the material (or modified versions of
|
||||||
|
it) with contractual assumptions of liability to the recipient, for
|
||||||
|
any liability that these contractual assumptions directly impose on
|
||||||
|
those licensors and authors.
|
||||||
|
|
||||||
|
All other non-permissive additional terms are considered "further
|
||||||
|
restrictions" within the meaning of section 10. If the Program as you
|
||||||
|
received it, or any part of it, contains a notice stating that it is
|
||||||
|
governed by this License along with a term that is a further
|
||||||
|
restriction, you may remove that term. If a license document contains
|
||||||
|
a further restriction but permits relicensing or conveying under this
|
||||||
|
License, you may add to a covered work material governed by the terms
|
||||||
|
of that license document, provided that the further restriction does
|
||||||
|
not survive such relicensing or conveying.
|
||||||
|
|
||||||
|
If you add terms to a covered work in accord with this section, you
|
||||||
|
must place, in the relevant source files, a statement of the
|
||||||
|
additional terms that apply to those files, or a notice indicating
|
||||||
|
where to find the applicable terms.
|
||||||
|
|
||||||
|
Additional terms, permissive or non-permissive, may be stated in the
|
||||||
|
form of a separately written license, or stated as exceptions;
|
||||||
|
the above requirements apply either way.
|
||||||
|
|
||||||
|
8. Termination.
|
||||||
|
|
||||||
|
You may not propagate or modify a covered work except as expressly
|
||||||
|
provided under this License. Any attempt otherwise to propagate or
|
||||||
|
modify it is void, and will automatically terminate your rights under
|
||||||
|
this License (including any patent licenses granted under the third
|
||||||
|
paragraph of section 11).
|
||||||
|
|
||||||
|
However, if you cease all violation of this License, then your
|
||||||
|
license from a particular copyright holder is reinstated (a)
|
||||||
|
provisionally, unless and until the copyright holder explicitly and
|
||||||
|
finally terminates your license, and (b) permanently, if the copyright
|
||||||
|
holder fails to notify you of the violation by some reasonable means
|
||||||
|
prior to 60 days after the cessation.
|
||||||
|
|
||||||
|
Moreover, your license from a particular copyright holder is
|
||||||
|
reinstated permanently if the copyright holder notifies you of the
|
||||||
|
violation by some reasonable means, this is the first time you have
|
||||||
|
received notice of violation of this License (for any work) from that
|
||||||
|
copyright holder, and you cure the violation prior to 30 days after
|
||||||
|
your receipt of the notice.
|
||||||
|
|
||||||
|
Termination of your rights under this section does not terminate the
|
||||||
|
licenses of parties who have received copies or rights from you under
|
||||||
|
this License. If your rights have been terminated and not permanently
|
||||||
|
reinstated, you do not qualify to receive new licenses for the same
|
||||||
|
material under section 10.
|
||||||
|
|
||||||
|
9. Acceptance Not Required for Having Copies.
|
||||||
|
|
||||||
|
You are not required to accept this License in order to receive or
|
||||||
|
run a copy of the Program. Ancillary propagation of a covered work
|
||||||
|
occurring solely as a consequence of using peer-to-peer transmission
|
||||||
|
to receive a copy likewise does not require acceptance. However,
|
||||||
|
nothing other than this License grants you permission to propagate or
|
||||||
|
modify any covered work. These actions infringe copyright if you do
|
||||||
|
not accept this License. Therefore, by modifying or propagating a
|
||||||
|
covered work, you indicate your acceptance of this License to do so.
|
||||||
|
|
||||||
|
10. Automatic Licensing of Downstream Recipients.
|
||||||
|
|
||||||
|
Each time you convey a covered work, the recipient automatically
|
||||||
|
receives a license from the original licensors, to run, modify and
|
||||||
|
propagate that work, subject to this License. You are not responsible
|
||||||
|
for enforcing compliance by third parties with this License.
|
||||||
|
|
||||||
|
An "entity transaction" is a transaction transferring control of an
|
||||||
|
organization, or substantially all assets of one, or subdividing an
|
||||||
|
organization, or merging organizations. If propagation of a covered
|
||||||
|
work results from an entity transaction, each party to that
|
||||||
|
transaction who receives a copy of the work also receives whatever
|
||||||
|
licenses to the work the party's predecessor in interest had or could
|
||||||
|
give under the previous paragraph, plus a right to possession of the
|
||||||
|
Corresponding Source of the work from the predecessor in interest, if
|
||||||
|
the predecessor has it or can get it with reasonable efforts.
|
||||||
|
|
||||||
|
You may not impose any further restrictions on the exercise of the
|
||||||
|
rights granted or affirmed under this License. For example, you may
|
||||||
|
not impose a license fee, royalty, or other charge for exercise of
|
||||||
|
rights granted under this License, and you may not initiate litigation
|
||||||
|
(including a cross-claim or counterclaim in a lawsuit) alleging that
|
||||||
|
any patent claim is infringed by making, using, selling, offering for
|
||||||
|
sale, or importing the Program or any portion of it.
|
||||||
|
|
||||||
|
11. Patents.
|
||||||
|
|
||||||
|
A "contributor" is a copyright holder who authorizes use under this
|
||||||
|
License of the Program or a work on which the Program is based. The
|
||||||
|
work thus licensed is called the contributor's "contributor version".
|
||||||
|
|
||||||
|
A contributor's "essential patent claims" are all patent claims
|
||||||
|
owned or controlled by the contributor, whether already acquired or
|
||||||
|
hereafter acquired, that would be infringed by some manner, permitted
|
||||||
|
by this License, of making, using, or selling its contributor version,
|
||||||
|
but do not include claims that would be infringed only as a
|
||||||
|
consequence of further modification of the contributor version. For
|
||||||
|
purposes of this definition, "control" includes the right to grant
|
||||||
|
patent sublicenses in a manner consistent with the requirements of
|
||||||
|
this License.
|
||||||
|
|
||||||
|
Each contributor grants you a non-exclusive, worldwide, royalty-free
|
||||||
|
patent license under the contributor's essential patent claims, to
|
||||||
|
make, use, sell, offer for sale, import and otherwise run, modify and
|
||||||
|
propagate the contents of its contributor version.
|
||||||
|
|
||||||
|
In the following three paragraphs, a "patent license" is any express
|
||||||
|
agreement or commitment, however denominated, not to enforce a patent
|
||||||
|
(such as an express permission to practice a patent or covenant not to
|
||||||
|
sue for patent infringement). To "grant" such a patent license to a
|
||||||
|
party means to make such an agreement or commitment not to enforce a
|
||||||
|
patent against the party.
|
||||||
|
|
||||||
|
If you convey a covered work, knowingly relying on a patent license,
|
||||||
|
and the Corresponding Source of the work is not available for anyone
|
||||||
|
to copy, free of charge and under the terms of this License, through a
|
||||||
|
publicly available network server or other readily accessible means,
|
||||||
|
then you must either (1) cause the Corresponding Source to be so
|
||||||
|
available, or (2) arrange to deprive yourself of the benefit of the
|
||||||
|
patent license for this particular work, or (3) arrange, in a manner
|
||||||
|
consistent with the requirements of this License, to extend the patent
|
||||||
|
license to downstream recipients. "Knowingly relying" means you have
|
||||||
|
actual knowledge that, but for the patent license, your conveying the
|
||||||
|
covered work in a country, or your recipient's use of the covered work
|
||||||
|
in a country, would infringe one or more identifiable patents in that
|
||||||
|
country that you have reason to believe are valid.
|
||||||
|
|
||||||
|
If, pursuant to or in connection with a single transaction or
|
||||||
|
arrangement, you convey, or propagate by procuring conveyance of, a
|
||||||
|
covered work, and grant a patent license to some of the parties
|
||||||
|
receiving the covered work authorizing them to use, propagate, modify
|
||||||
|
or convey a specific copy of the covered work, then the patent license
|
||||||
|
you grant is automatically extended to all recipients of the covered
|
||||||
|
work and works based on it.
|
||||||
|
|
||||||
|
A patent license is "discriminatory" if it does not include within
|
||||||
|
the scope of its coverage, prohibits the exercise of, or is
|
||||||
|
conditioned on the non-exercise of one or more of the rights that are
|
||||||
|
specifically granted under this License. You may not convey a covered
|
||||||
|
work if you are a party to an arrangement with a third party that is
|
||||||
|
in the business of distributing software, under which you make payment
|
||||||
|
to the third party based on the extent of your activity of conveying
|
||||||
|
the work, and under which the third party grants, to any of the
|
||||||
|
parties who would receive the covered work from you, a discriminatory
|
||||||
|
patent license (a) in connection with copies of the covered work
|
||||||
|
conveyed by you (or copies made from those copies), or (b) primarily
|
||||||
|
for and in connection with specific products or compilations that
|
||||||
|
contain the covered work, unless you entered into that arrangement,
|
||||||
|
or that patent license was granted, prior to 28 March 2007.
|
||||||
|
|
||||||
|
Nothing in this License shall be construed as excluding or limiting
|
||||||
|
any implied license or other defenses to infringement that may
|
||||||
|
otherwise be available to you under applicable patent law.
|
||||||
|
|
||||||
|
12. No Surrender of Others' Freedom.
|
||||||
|
|
||||||
|
If conditions are imposed on you (whether by court order, agreement or
|
||||||
|
otherwise) that contradict the conditions of this License, they do not
|
||||||
|
excuse you from the conditions of this License. If you cannot convey a
|
||||||
|
covered work so as to satisfy simultaneously your obligations under this
|
||||||
|
License and any other pertinent obligations, then as a consequence you may
|
||||||
|
not convey it at all. For example, if you agree to terms that obligate you
|
||||||
|
to collect a royalty for further conveying from those to whom you convey
|
||||||
|
the Program, the only way you could satisfy both those terms and this
|
||||||
|
License would be to refrain entirely from conveying the Program.
|
||||||
|
|
||||||
|
13. Use with the GNU Affero General Public License.
|
||||||
|
|
||||||
|
Notwithstanding any other provision of this License, you have
|
||||||
|
permission to link or combine any covered work with a work licensed
|
||||||
|
under version 3 of the GNU Affero General Public License into a single
|
||||||
|
combined work, and to convey the resulting work. The terms of this
|
||||||
|
License will continue to apply to the part which is the covered work,
|
||||||
|
but the special requirements of the GNU Affero General Public License,
|
||||||
|
section 13, concerning interaction through a network will apply to the
|
||||||
|
combination as such.
|
||||||
|
|
||||||
|
14. Revised Versions of this License.
|
||||||
|
|
||||||
|
The Free Software Foundation may publish revised and/or new versions of
|
||||||
|
the GNU General Public License from time to time. Such new versions will
|
||||||
|
be similar in spirit to the present version, but may differ in detail to
|
||||||
|
address new problems or concerns.
|
||||||
|
|
||||||
|
Each version is given a distinguishing version number. If the
|
||||||
|
Program specifies that a certain numbered version of the GNU General
|
||||||
|
Public License "or any later version" applies to it, you have the
|
||||||
|
option of following the terms and conditions either of that numbered
|
||||||
|
version or of any later version published by the Free Software
|
||||||
|
Foundation. If the Program does not specify a version number of the
|
||||||
|
GNU General Public License, you may choose any version ever published
|
||||||
|
by the Free Software Foundation.
|
||||||
|
|
||||||
|
If the Program specifies that a proxy can decide which future
|
||||||
|
versions of the GNU General Public License can be used, that proxy's
|
||||||
|
public statement of acceptance of a version permanently authorizes you
|
||||||
|
to choose that version for the Program.
|
||||||
|
|
||||||
|
Later license versions may give you additional or different
|
||||||
|
permissions. However, no additional obligations are imposed on any
|
||||||
|
author or copyright holder as a result of your choosing to follow a
|
||||||
|
later version.
|
||||||
|
|
||||||
|
15. Disclaimer of Warranty.
|
||||||
|
|
||||||
|
THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY
|
||||||
|
APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT
|
||||||
|
HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY
|
||||||
|
OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,
|
||||||
|
THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
||||||
|
PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM
|
||||||
|
IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF
|
||||||
|
ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
|
||||||
|
|
||||||
|
16. Limitation of Liability.
|
||||||
|
|
||||||
|
IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
|
||||||
|
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS
|
||||||
|
THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY
|
||||||
|
GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE
|
||||||
|
USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF
|
||||||
|
DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD
|
||||||
|
PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),
|
||||||
|
EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF
|
||||||
|
SUCH DAMAGES.
|
||||||
|
|
||||||
|
17. Interpretation of Sections 15 and 16.
|
||||||
|
|
||||||
|
If the disclaimer of warranty and limitation of liability provided
|
||||||
|
above cannot be given local legal effect according to their terms,
|
||||||
|
reviewing courts shall apply local law that most closely approximates
|
||||||
|
an absolute waiver of all civil liability in connection with the
|
||||||
|
Program, unless a warranty or assumption of liability accompanies a
|
||||||
|
copy of the Program in return for a fee.
|
||||||
|
|
||||||
|
END OF TERMS AND CONDITIONS
|
||||||
|
|
||||||
|
How to Apply These Terms to Your New Programs
|
||||||
|
|
||||||
|
If you develop a new program, and you want it to be of the greatest
|
||||||
|
possible use to the public, the best way to achieve this is to make it
|
||||||
|
free software which everyone can redistribute and change under these terms.
|
||||||
|
|
||||||
|
To do so, attach the following notices to the program. It is safest
|
||||||
|
to attach them to the start of each source file to most effectively
|
||||||
|
state the exclusion of warranty; and each file should have at least
|
||||||
|
the "copyright" line and a pointer to where the full notice is found.
|
||||||
|
|
||||||
|
<one line to give the program's name and a brief idea of what it does.>
|
||||||
|
Copyright (C) <year> <name of author>
|
||||||
|
|
||||||
|
This program is free software: you can redistribute it and/or modify
|
||||||
|
it under the terms of the GNU General Public License as published by
|
||||||
|
the Free Software Foundation, either version 3 of the License, or
|
||||||
|
(at your option) any later version.
|
||||||
|
|
||||||
|
This program is distributed in the hope that it will be useful,
|
||||||
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
GNU General Public License for more details.
|
||||||
|
|
||||||
|
You should have received a copy of the GNU General Public License
|
||||||
|
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
|
Also add information on how to contact you by electronic and paper mail.
|
||||||
|
|
||||||
|
If the program does terminal interaction, make it output a short
|
||||||
|
notice like this when it starts in an interactive mode:
|
||||||
|
|
||||||
|
<program> Copyright (C) <year> <name of author>
|
||||||
|
This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
|
||||||
|
This is free software, and you are welcome to redistribute it
|
||||||
|
under certain conditions; type `show c' for details.
|
||||||
|
|
||||||
|
The hypothetical commands `show w' and `show c' should show the appropriate
|
||||||
|
parts of the General Public License. Of course, your program's commands
|
||||||
|
might be different; for a GUI interface, you would use an "about box".
|
||||||
|
|
||||||
|
You should also get your employer (if you work as a programmer) or school,
|
||||||
|
if any, to sign a "copyright disclaimer" for the program, if necessary.
|
||||||
|
For more information on this, and how to apply and follow the GNU GPL, see
|
||||||
|
<http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
|
The GNU General Public License does not permit incorporating your program
|
||||||
|
into proprietary programs. If your program is a subroutine library, you
|
||||||
|
may consider it more useful to permit linking proprietary applications with
|
||||||
|
the library. If this is what you want to do, use the GNU Lesser General
|
||||||
|
Public License instead of this License. But first, please read
|
||||||
|
<http://www.gnu.org/philosophy/why-not-lgpl.html>.
|
31
data/prog.scc
Executable file
|
@ -0,0 +1,31 @@
|
||||||
|
# INITIALISE VARIABLES
|
||||||
|
SET REGA 4
|
||||||
|
SET REGB 610
|
||||||
|
SET REGC 0
|
||||||
|
# JUMP TO END IF A == 0
|
||||||
|
SET REGX REGA
|
||||||
|
JMP 28
|
||||||
|
# ELSE, HALVE A
|
||||||
|
SHR REGA 1
|
||||||
|
# DOUBLE B
|
||||||
|
SHL REGB 1
|
||||||
|
# CHECK IF A IS ODD
|
||||||
|
SET REGX REGA
|
||||||
|
AND REGX 1
|
||||||
|
# IF IT'S EVEN, CHECK IF A == 1
|
||||||
|
JMP 20
|
||||||
|
# ELSE, ADD B TO THE RESULT
|
||||||
|
ADD REGC REGB
|
||||||
|
# CHECK IF A == 1
|
||||||
|
SET REGX REGA
|
||||||
|
# JMP JUMPS ON A 0, NOT A 1
|
||||||
|
SUB REGX 1
|
||||||
|
# IF IT IS, JUMP TO THE END OF THE LOOP
|
||||||
|
JMP 28
|
||||||
|
# ELSE, JUMP TO THE BEGINNING OF THE LOOP
|
||||||
|
SET REGX 0
|
||||||
|
JMP 8
|
||||||
|
# PRINTS THE RESULT
|
||||||
|
PRT REGC
|
||||||
|
# EXITS THE PROGRAM
|
||||||
|
NOP
|
2303
doc/config
Executable file
BIN
doc/html/bc_s.png
Executable file
After (image error) Size: 676 B |
BIN
doc/html/bdwn.png
Executable file
After (image error) Size: 147 B |
BIN
doc/html/closed.png
Executable file
After (image error) Size: 132 B |
104
doc/html/dir_b2f33c71d4aa5e7af42a1ca61ff5af1b.html
Executable file
|
@ -0,0 +1,104 @@
|
||||||
|
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
||||||
|
<html xmlns="http://www.w3.org/1999/xhtml">
|
||||||
|
<head>
|
||||||
|
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
|
||||||
|
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
|
||||||
|
<meta name="generator" content="Doxygen 1.8.6"/>
|
||||||
|
<title>SCC.150 Assembler Emulator: /home/rumperuu/Documents/University/University Work/SCC.150 Digital Systems/Coursework/unr-C/SCC.150 Assembler Emulator/source Directory Reference</title>
|
||||||
|
<link href="tabs.css" rel="stylesheet" type="text/css"/>
|
||||||
|
<script type="text/javascript" src="jquery.js"></script>
|
||||||
|
<script type="text/javascript" src="dynsections.js"></script>
|
||||||
|
<link href="search/search.css" rel="stylesheet" type="text/css"/>
|
||||||
|
<script type="text/javascript" src="search/search.js"></script>
|
||||||
|
<script type="text/javascript">
|
||||||
|
$(document).ready(function() { searchBox.OnSelectItem(0); });
|
||||||
|
</script>
|
||||||
|
<link href="doxygen.css" rel="stylesheet" type="text/css" />
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
|
||||||
|
<div id="titlearea">
|
||||||
|
<table cellspacing="0" cellpadding="0">
|
||||||
|
<tbody>
|
||||||
|
<tr style="height: 56px;">
|
||||||
|
<td style="padding-left: 0.5em;">
|
||||||
|
<div id="projectname">SCC.150 Assembler Emulator
|
||||||
|
</div>
|
||||||
|
<div id="projectbrief">A compiler for a simple assembler language</div>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
</tbody>
|
||||||
|
</table>
|
||||||
|
</div>
|
||||||
|
<!-- end header part -->
|
||||||
|
<!-- Generated by Doxygen 1.8.6 -->
|
||||||
|
<script type="text/javascript">
|
||||||
|
var searchBox = new SearchBox("searchBox", "search",false,'Search');
|
||||||
|
</script>
|
||||||
|
<div id="navrow1" class="tabs">
|
||||||
|
<ul class="tablist">
|
||||||
|
<li><a href="index.html"><span>Main Page</span></a></li>
|
||||||
|
<li><a href="files.html"><span>Files</span></a></li>
|
||||||
|
<li>
|
||||||
|
<div id="MSearchBox" class="MSearchBoxInactive">
|
||||||
|
<span class="left">
|
||||||
|
<img id="MSearchSelect" src="search/mag_sel.png"
|
||||||
|
onmouseover="return searchBox.OnSearchSelectShow()"
|
||||||
|
onmouseout="return searchBox.OnSearchSelectHide()"
|
||||||
|
alt=""/>
|
||||||
|
<input type="text" id="MSearchField" value="Search" accesskey="S"
|
||||||
|
onfocus="searchBox.OnSearchFieldFocus(true)"
|
||||||
|
onblur="searchBox.OnSearchFieldFocus(false)"
|
||||||
|
onkeyup="searchBox.OnSearchFieldChange(event)"/>
|
||||||
|
</span><span class="right">
|
||||||
|
<a id="MSearchClose" href="javascript:searchBox.CloseResultsWindow()"><img id="MSearchCloseImg" border="0" src="search/close.png" alt=""/></a>
|
||||||
|
</span>
|
||||||
|
</div>
|
||||||
|
</li>
|
||||||
|
</ul>
|
||||||
|
</div>
|
||||||
|
<!-- window showing the filter options -->
|
||||||
|
<div id="MSearchSelectWindow"
|
||||||
|
onmouseover="return searchBox.OnSearchSelectShow()"
|
||||||
|
onmouseout="return searchBox.OnSearchSelectHide()"
|
||||||
|
onkeydown="return searchBox.OnSearchSelectKey(event)">
|
||||||
|
<a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(0)"><span class="SelectionMark"> </span>All</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(1)"><span class="SelectionMark"> </span>Files</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(2)"><span class="SelectionMark"> </span>Functions</a></div>
|
||||||
|
|
||||||
|
<!-- iframe showing the search results (closed by default) -->
|
||||||
|
<div id="MSearchResultsWindow">
|
||||||
|
<iframe src="javascript:void(0)" frameborder="0"
|
||||||
|
name="MSearchResults" id="MSearchResults">
|
||||||
|
</iframe>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div id="nav-path" class="navpath">
|
||||||
|
<ul>
|
||||||
|
<li class="navelem"><a class="el" href="dir_b2f33c71d4aa5e7af42a1ca61ff5af1b.html">source</a></li> </ul>
|
||||||
|
</div>
|
||||||
|
</div><!-- top -->
|
||||||
|
<div class="header">
|
||||||
|
<div class="headertitle">
|
||||||
|
<div class="title">source Directory Reference</div> </div>
|
||||||
|
</div><!--header-->
|
||||||
|
<div class="contents">
|
||||||
|
<table class="memberdecls">
|
||||||
|
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="files"></a>
|
||||||
|
Files</h2></td></tr>
|
||||||
|
<tr class="memitem:emulator_8c"><td class="memItemLeft" align="right" valign="top">file  </td><td class="memItemRight" valign="bottom"><a class="el" href="emulator_8c.html">emulator.c</a></td></tr>
|
||||||
|
<tr class="separator:"><td class="memSeparator" colspan="2"> </td></tr>
|
||||||
|
<tr class="memitem:emulator_8h"><td class="memItemLeft" align="right" valign="top">file  </td><td class="memItemRight" valign="bottom"><a class="el" href="emulator_8h.html">emulator.h</a> <a href="emulator_8h_source.html">[code]</a></td></tr>
|
||||||
|
<tr class="separator:"><td class="memSeparator" colspan="2"> </td></tr>
|
||||||
|
<tr class="memitem:mystring_8c"><td class="memItemLeft" align="right" valign="top">file  </td><td class="memItemRight" valign="bottom"><a class="el" href="mystring_8c.html">mystring.c</a></td></tr>
|
||||||
|
<tr class="separator:"><td class="memSeparator" colspan="2"> </td></tr>
|
||||||
|
<tr class="memitem:mystring_8h"><td class="memItemLeft" align="right" valign="top">file  </td><td class="memItemRight" valign="bottom"><a class="el" href="mystring_8h.html">mystring.h</a> <a href="mystring_8h_source.html">[code]</a></td></tr>
|
||||||
|
<tr class="separator:"><td class="memSeparator" colspan="2"> </td></tr>
|
||||||
|
</table>
|
||||||
|
</div><!-- contents -->
|
||||||
|
<!-- start footer part -->
|
||||||
|
<hr class="footer"/><address class="footer"><small>
|
||||||
|
Generated on Tue May 19 2015 20:34:54 for SCC.150 Assembler Emulator by  <a href="http://www.doxygen.org/index.html">
|
||||||
|
<img class="footer" src="doxygen.png" alt="doxygen"/>
|
||||||
|
</a> 1.8.6
|
||||||
|
</small></address>
|
||||||
|
</body>
|
||||||
|
</html>
|
1366
doc/html/doxygen.css
Executable file
BIN
doc/html/doxygen.png
Executable file
After (image error) Size: 3.7 KiB |
97
doc/html/dynsections.js
Executable file
|
@ -0,0 +1,97 @@
|
||||||
|
function toggleVisibility(linkObj)
|
||||||
|
{
|
||||||
|
var base = $(linkObj).attr('id');
|
||||||
|
var summary = $('#'+base+'-summary');
|
||||||
|
var content = $('#'+base+'-content');
|
||||||
|
var trigger = $('#'+base+'-trigger');
|
||||||
|
var src=$(trigger).attr('src');
|
||||||
|
if (content.is(':visible')===true) {
|
||||||
|
content.hide();
|
||||||
|
summary.show();
|
||||||
|
$(linkObj).addClass('closed').removeClass('opened');
|
||||||
|
$(trigger).attr('src',src.substring(0,src.length-8)+'closed.png');
|
||||||
|
} else {
|
||||||
|
content.show();
|
||||||
|
summary.hide();
|
||||||
|
$(linkObj).removeClass('closed').addClass('opened');
|
||||||
|
$(trigger).attr('src',src.substring(0,src.length-10)+'open.png');
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
function updateStripes()
|
||||||
|
{
|
||||||
|
$('table.directory tr').
|
||||||
|
removeClass('even').filter(':visible:even').addClass('even');
|
||||||
|
}
|
||||||
|
function toggleLevel(level)
|
||||||
|
{
|
||||||
|
$('table.directory tr').each(function(){
|
||||||
|
var l = this.id.split('_').length-1;
|
||||||
|
var i = $('#img'+this.id.substring(3));
|
||||||
|
var a = $('#arr'+this.id.substring(3));
|
||||||
|
if (l<level+1) {
|
||||||
|
i.attr('src','ftv2folderopen.png');
|
||||||
|
a.attr('src','ftv2mnode.png');
|
||||||
|
$(this).show();
|
||||||
|
} else if (l==level+1) {
|
||||||
|
i.attr('src','ftv2folderclosed.png');
|
||||||
|
a.attr('src','ftv2pnode.png');
|
||||||
|
$(this).show();
|
||||||
|
} else {
|
||||||
|
$(this).hide();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
updateStripes();
|
||||||
|
}
|
||||||
|
|
||||||
|
function toggleFolder(id)
|
||||||
|
{
|
||||||
|
//The clicked row
|
||||||
|
var currentRow = $('#row_'+id);
|
||||||
|
var currentRowImages = currentRow.find("img");
|
||||||
|
|
||||||
|
//All rows after the clicked row
|
||||||
|
var rows = currentRow.nextAll("tr");
|
||||||
|
|
||||||
|
//Only match elements AFTER this one (can't hide elements before)
|
||||||
|
var childRows = rows.filter(function() {
|
||||||
|
var re = new RegExp('^row_'+id+'\\d+_$', "i"); //only one sub
|
||||||
|
return this.id.match(re);
|
||||||
|
});
|
||||||
|
|
||||||
|
//First row is visible we are HIDING
|
||||||
|
if (childRows.filter(':first').is(':visible')===true) {
|
||||||
|
currentRowImages.filter("[id^=arr]").attr('src', 'ftv2pnode.png');
|
||||||
|
currentRowImages.filter("[id^=img]").attr('src', 'ftv2folderclosed.png');
|
||||||
|
rows.filter("[id^=row_"+id+"]").hide();
|
||||||
|
} else { //We are SHOWING
|
||||||
|
//All sub images
|
||||||
|
var childImages = childRows.find("img");
|
||||||
|
var childImg = childImages.filter("[id^=img]");
|
||||||
|
var childArr = childImages.filter("[id^=arr]");
|
||||||
|
|
||||||
|
currentRow.find("[id^=arr]").attr('src', 'ftv2mnode.png'); //open row
|
||||||
|
currentRow.find("[id^=img]").attr('src', 'ftv2folderopen.png'); //open row
|
||||||
|
childImg.attr('src','ftv2folderclosed.png'); //children closed
|
||||||
|
childArr.attr('src','ftv2pnode.png'); //children closed
|
||||||
|
childRows.show(); //show all children
|
||||||
|
}
|
||||||
|
updateStripes();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
function toggleInherit(id)
|
||||||
|
{
|
||||||
|
var rows = $('tr.inherit.'+id);
|
||||||
|
var img = $('tr.inherit_header.'+id+' img');
|
||||||
|
var src = $(img).attr('src');
|
||||||
|
if (rows.filter(':first').is(':visible')===true) {
|
||||||
|
rows.css('display','none');
|
||||||
|
$(img).attr('src',src.substring(0,src.length-8)+'closed.png');
|
||||||
|
} else {
|
||||||
|
rows.css('display','table-row'); // using show() causes jump in firefox
|
||||||
|
$(img).attr('src',src.substring(0,src.length-10)+'open.png');
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
820
doc/html/emulator_8c.html
Executable file
|
@ -0,0 +1,820 @@
|
||||||
|
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
||||||
|
<html xmlns="http://www.w3.org/1999/xhtml">
|
||||||
|
<head>
|
||||||
|
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
|
||||||
|
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
|
||||||
|
<meta name="generator" content="Doxygen 1.8.6"/>
|
||||||
|
<title>SCC.150 Assembler Emulator: /home/rumperuu/Documents/University/University Work/SCC.150 Digital Systems/Coursework/unr-C/SCC.150 Assembler Emulator/source/emulator.c File Reference</title>
|
||||||
|
<link href="tabs.css" rel="stylesheet" type="text/css"/>
|
||||||
|
<script type="text/javascript" src="jquery.js"></script>
|
||||||
|
<script type="text/javascript" src="dynsections.js"></script>
|
||||||
|
<link href="search/search.css" rel="stylesheet" type="text/css"/>
|
||||||
|
<script type="text/javascript" src="search/search.js"></script>
|
||||||
|
<script type="text/javascript">
|
||||||
|
$(document).ready(function() { searchBox.OnSelectItem(0); });
|
||||||
|
</script>
|
||||||
|
<link href="doxygen.css" rel="stylesheet" type="text/css" />
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
|
||||||
|
<div id="titlearea">
|
||||||
|
<table cellspacing="0" cellpadding="0">
|
||||||
|
<tbody>
|
||||||
|
<tr style="height: 56px;">
|
||||||
|
<td style="padding-left: 0.5em;">
|
||||||
|
<div id="projectname">SCC.150 Assembler Emulator
|
||||||
|
</div>
|
||||||
|
<div id="projectbrief">A compiler for a simple assembler language</div>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
</tbody>
|
||||||
|
</table>
|
||||||
|
</div>
|
||||||
|
<!-- end header part -->
|
||||||
|
<!-- Generated by Doxygen 1.8.6 -->
|
||||||
|
<script type="text/javascript">
|
||||||
|
var searchBox = new SearchBox("searchBox", "search",false,'Search');
|
||||||
|
</script>
|
||||||
|
<div id="navrow1" class="tabs">
|
||||||
|
<ul class="tablist">
|
||||||
|
<li><a href="index.html"><span>Main Page</span></a></li>
|
||||||
|
<li class="current"><a href="files.html"><span>Files</span></a></li>
|
||||||
|
<li>
|
||||||
|
<div id="MSearchBox" class="MSearchBoxInactive">
|
||||||
|
<span class="left">
|
||||||
|
<img id="MSearchSelect" src="search/mag_sel.png"
|
||||||
|
onmouseover="return searchBox.OnSearchSelectShow()"
|
||||||
|
onmouseout="return searchBox.OnSearchSelectHide()"
|
||||||
|
alt=""/>
|
||||||
|
<input type="text" id="MSearchField" value="Search" accesskey="S"
|
||||||
|
onfocus="searchBox.OnSearchFieldFocus(true)"
|
||||||
|
onblur="searchBox.OnSearchFieldFocus(false)"
|
||||||
|
onkeyup="searchBox.OnSearchFieldChange(event)"/>
|
||||||
|
</span><span class="right">
|
||||||
|
<a id="MSearchClose" href="javascript:searchBox.CloseResultsWindow()"><img id="MSearchCloseImg" border="0" src="search/close.png" alt=""/></a>
|
||||||
|
</span>
|
||||||
|
</div>
|
||||||
|
</li>
|
||||||
|
</ul>
|
||||||
|
</div>
|
||||||
|
<div id="navrow2" class="tabs2">
|
||||||
|
<ul class="tablist">
|
||||||
|
<li><a href="files.html"><span>File List</span></a></li>
|
||||||
|
<li><a href="globals.html"><span>Globals</span></a></li>
|
||||||
|
</ul>
|
||||||
|
</div>
|
||||||
|
<!-- window showing the filter options -->
|
||||||
|
<div id="MSearchSelectWindow"
|
||||||
|
onmouseover="return searchBox.OnSearchSelectShow()"
|
||||||
|
onmouseout="return searchBox.OnSearchSelectHide()"
|
||||||
|
onkeydown="return searchBox.OnSearchSelectKey(event)">
|
||||||
|
<a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(0)"><span class="SelectionMark"> </span>All</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(1)"><span class="SelectionMark"> </span>Files</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(2)"><span class="SelectionMark"> </span>Functions</a></div>
|
||||||
|
|
||||||
|
<!-- iframe showing the search results (closed by default) -->
|
||||||
|
<div id="MSearchResultsWindow">
|
||||||
|
<iframe src="javascript:void(0)" frameborder="0"
|
||||||
|
name="MSearchResults" id="MSearchResults">
|
||||||
|
</iframe>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div id="nav-path" class="navpath">
|
||||||
|
<ul>
|
||||||
|
<li class="navelem"><a class="el" href="dir_b2f33c71d4aa5e7af42a1ca61ff5af1b.html">source</a></li> </ul>
|
||||||
|
</div>
|
||||||
|
</div><!-- top -->
|
||||||
|
<div class="header">
|
||||||
|
<div class="summary">
|
||||||
|
<a href="#typedef-members">Typedefs</a> |
|
||||||
|
<a href="#func-members">Functions</a> |
|
||||||
|
<a href="#var-members">Variables</a> </div>
|
||||||
|
<div class="headertitle">
|
||||||
|
<div class="title">emulator.c File Reference</div> </div>
|
||||||
|
</div><!--header-->
|
||||||
|
<div class="contents">
|
||||||
|
<div class="textblock"><code>#include "<a class="el" href="emulator_8h_source.html">emulator.h</a>"</code><br/>
|
||||||
|
<code>#include "<a class="el" href="mystring_8h_source.html">mystring.h</a>"</code><br/>
|
||||||
|
</div><table class="memberdecls">
|
||||||
|
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="typedef-members"></a>
|
||||||
|
Typedefs</h2></td></tr>
|
||||||
|
<tr class="memitem:ac2948fb0a8bb3d65787563e11508c25d"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="ac2948fb0a8bb3d65787563e11508c25d"></a>
|
||||||
|
typedef int(* </td><td class="memItemRight" valign="bottom"><b>opcode_function</b> )(char *, char *, char *)</td></tr>
|
||||||
|
<tr class="separator:ac2948fb0a8bb3d65787563e11508c25d"><td class="memSeparator" colspan="2"> </td></tr>
|
||||||
|
</table><table class="memberdecls">
|
||||||
|
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="func-members"></a>
|
||||||
|
Functions</h2></td></tr>
|
||||||
|
<tr class="memitem:a00e5e1b7c08d6368342756805800133b"><td class="memItemLeft" align="right" valign="top">int </td><td class="memItemRight" valign="bottom"><a class="el" href="emulator_8c.html#a00e5e1b7c08d6368342756805800133b">opcodeNOP</a> (char *opcode, char *arg1, char *arg2)</td></tr>
|
||||||
|
<tr class="separator:a00e5e1b7c08d6368342756805800133b"><td class="memSeparator" colspan="2"> </td></tr>
|
||||||
|
<tr class="memitem:a5d6aac425624196dcd0d278760270d00"><td class="memItemLeft" align="right" valign="top">int </td><td class="memItemRight" valign="bottom"><a class="el" href="emulator_8c.html#a5d6aac425624196dcd0d278760270d00">opcodeSET</a> (char *opcode, char *arg1, char *arg2)</td></tr>
|
||||||
|
<tr class="separator:a5d6aac425624196dcd0d278760270d00"><td class="memSeparator" colspan="2"> </td></tr>
|
||||||
|
<tr class="memitem:a434bd1e8b4e45503586891e565138b84"><td class="memItemLeft" align="right" valign="top">int </td><td class="memItemRight" valign="bottom"><a class="el" href="emulator_8c.html#a434bd1e8b4e45503586891e565138b84">opcodeAND</a> (char *opcode, char *arg1, char *arg2)</td></tr>
|
||||||
|
<tr class="separator:a434bd1e8b4e45503586891e565138b84"><td class="memSeparator" colspan="2"> </td></tr>
|
||||||
|
<tr class="memitem:a54c12a24203abe192fe4f727ea9ffe60"><td class="memItemLeft" align="right" valign="top">int </td><td class="memItemRight" valign="bottom"><a class="el" href="emulator_8c.html#a54c12a24203abe192fe4f727ea9ffe60">opcodeOR</a> (char *opcode, char *arg1, char *arg2)</td></tr>
|
||||||
|
<tr class="separator:a54c12a24203abe192fe4f727ea9ffe60"><td class="memSeparator" colspan="2"> </td></tr>
|
||||||
|
<tr class="memitem:a501fe22548fd568d37522ba76ff2c1e7"><td class="memItemLeft" align="right" valign="top">int </td><td class="memItemRight" valign="bottom"><a class="el" href="emulator_8c.html#a501fe22548fd568d37522ba76ff2c1e7">opcodeADD</a> (char *opcode, char *arg1, char *arg2)</td></tr>
|
||||||
|
<tr class="separator:a501fe22548fd568d37522ba76ff2c1e7"><td class="memSeparator" colspan="2"> </td></tr>
|
||||||
|
<tr class="memitem:a3ead6beddb4488ab700a81968e30e11c"><td class="memItemLeft" align="right" valign="top">int </td><td class="memItemRight" valign="bottom"><a class="el" href="emulator_8c.html#a3ead6beddb4488ab700a81968e30e11c">opcodeSUB</a> (char *opcode, char *arg1, char *arg2)</td></tr>
|
||||||
|
<tr class="separator:a3ead6beddb4488ab700a81968e30e11c"><td class="memSeparator" colspan="2"> </td></tr>
|
||||||
|
<tr class="memitem:a3cdb2ee632bc1b19d885c26b044d76ae"><td class="memItemLeft" align="right" valign="top">int </td><td class="memItemRight" valign="bottom"><a class="el" href="emulator_8c.html#a3cdb2ee632bc1b19d885c26b044d76ae">opcodeSHL</a> (char *opcode, char *arg1, char *arg2)</td></tr>
|
||||||
|
<tr class="separator:a3cdb2ee632bc1b19d885c26b044d76ae"><td class="memSeparator" colspan="2"> </td></tr>
|
||||||
|
<tr class="memitem:a6f1fa1ff65a606afddb458fcd64449cf"><td class="memItemLeft" align="right" valign="top">int </td><td class="memItemRight" valign="bottom"><a class="el" href="emulator_8c.html#a6f1fa1ff65a606afddb458fcd64449cf">opcodeSHR</a> (char *opcode, char *arg1, char *arg2)</td></tr>
|
||||||
|
<tr class="separator:a6f1fa1ff65a606afddb458fcd64449cf"><td class="memSeparator" colspan="2"> </td></tr>
|
||||||
|
<tr class="memitem:a734105640ec0f0c1e6dc8c5384b2d1d0"><td class="memItemLeft" align="right" valign="top">int </td><td class="memItemRight" valign="bottom"><a class="el" href="emulator_8c.html#a734105640ec0f0c1e6dc8c5384b2d1d0">opcodeJMP</a> (char *opcode, char *arg1, char *arg2)</td></tr>
|
||||||
|
<tr class="separator:a734105640ec0f0c1e6dc8c5384b2d1d0"><td class="memSeparator" colspan="2"> </td></tr>
|
||||||
|
<tr class="memitem:aeb406b3428b5429249ab2c7e3d7bcc3c"><td class="memItemLeft" align="right" valign="top">int </td><td class="memItemRight" valign="bottom"><a class="el" href="emulator_8c.html#aeb406b3428b5429249ab2c7e3d7bcc3c">opcodePRT</a> (char *opcode, char *arg1, char *arg2)</td></tr>
|
||||||
|
<tr class="separator:aeb406b3428b5429249ab2c7e3d7bcc3c"><td class="memSeparator" colspan="2"> </td></tr>
|
||||||
|
<tr class="memitem:ae7178313a4254c62afc060814ebca038"><td class="memItemLeft" align="right" valign="top">int </td><td class="memItemRight" valign="bottom"><a class="el" href="emulator_8c.html#ae7178313a4254c62afc060814ebca038">getArg2</a> (char *arg2)</td></tr>
|
||||||
|
<tr class="separator:ae7178313a4254c62afc060814ebca038"><td class="memSeparator" colspan="2"> </td></tr>
|
||||||
|
<tr class="memitem:a40c9c476ef53a0c955d3e633b54d2bd2"><td class="memItemLeft" align="right" valign="top">bool </td><td class="memItemRight" valign="bottom"><a class="el" href="emulator_8c.html#a40c9c476ef53a0c955d3e633b54d2bd2">isValid</a> (char *opcode, char *arg1, char *arg2)</td></tr>
|
||||||
|
<tr class="separator:a40c9c476ef53a0c955d3e633b54d2bd2"><td class="memSeparator" colspan="2"> </td></tr>
|
||||||
|
<tr class="memitem:a6b5c26779c71916073e7b8f9debea56d"><td class="memItemLeft" align="right" valign="top">int </td><td class="memItemRight" valign="bottom"><a class="el" href="emulator_8c.html#a6b5c26779c71916073e7b8f9debea56d">execInstruction</a> (char *instruction)</td></tr>
|
||||||
|
<tr class="separator:a6b5c26779c71916073e7b8f9debea56d"><td class="memSeparator" colspan="2"> </td></tr>
|
||||||
|
<tr class="memitem:a2bbc98d3653ad65ad12757dfa7bdfdd4"><td class="memItemLeft" align="right" valign="top">int </td><td class="memItemRight" valign="bottom"><a class="el" href="emulator_8c.html#a2bbc98d3653ad65ad12757dfa7bdfdd4">execProgram</a> ()</td></tr>
|
||||||
|
<tr class="separator:a2bbc98d3653ad65ad12757dfa7bdfdd4"><td class="memSeparator" colspan="2"> </td></tr>
|
||||||
|
<tr class="memitem:a3d30edda62d5695ffaa3b62121d4bf98"><td class="memItemLeft" align="right" valign="top">int </td><td class="memItemRight" valign="bottom"><a class="el" href="emulator_8c.html#a3d30edda62d5695ffaa3b62121d4bf98">loadProgram</a> ()</td></tr>
|
||||||
|
<tr class="separator:a3d30edda62d5695ffaa3b62121d4bf98"><td class="memSeparator" colspan="2"> </td></tr>
|
||||||
|
<tr class="memitem:ae66f6b31b5ad750f1fe042a706a4e3d4"><td class="memItemLeft" align="right" valign="top">int </td><td class="memItemRight" valign="bottom"><a class="el" href="emulator_8c.html#ae66f6b31b5ad750f1fe042a706a4e3d4">main</a> ()</td></tr>
|
||||||
|
<tr class="separator:ae66f6b31b5ad750f1fe042a706a4e3d4"><td class="memSeparator" colspan="2"> </td></tr>
|
||||||
|
</table><table class="memberdecls">
|
||||||
|
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="var-members"></a>
|
||||||
|
Variables</h2></td></tr>
|
||||||
|
<tr class="memitem:afb239207f953e9750ae152379fd9aaa0"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="afb239207f953e9750ae152379fd9aaa0"></a>
|
||||||
|
char </td><td class="memItemRight" valign="bottom"><b>prog</b> [MAX_PROG_LEN][MAX_LINE_LEN]</td></tr>
|
||||||
|
<tr class="separator:afb239207f953e9750ae152379fd9aaa0"><td class="memSeparator" colspan="2"> </td></tr>
|
||||||
|
<tr class="memitem:ac67bfbb027e06757e87c73fbf8dedd00"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="ac67bfbb027e06757e87c73fbf8dedd00"></a>
|
||||||
|
int </td><td class="memItemRight" valign="bottom"><b>progLen</b> = 0</td></tr>
|
||||||
|
<tr class="separator:ac67bfbb027e06757e87c73fbf8dedd00"><td class="memSeparator" colspan="2"> </td></tr>
|
||||||
|
<tr class="memitem:a87f7ce345bef7ff2dae769a749cffc3f"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a87f7ce345bef7ff2dae769a749cffc3f"></a>
|
||||||
|
unsigned int </td><td class="memItemRight" valign="bottom"><b>programRuns</b> = 0</td></tr>
|
||||||
|
<tr class="separator:a87f7ce345bef7ff2dae769a749cffc3f"><td class="memSeparator" colspan="2"> </td></tr>
|
||||||
|
<tr class="memitem:a2bac6f420cd6061ac537bbe7540b48d1"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a2bac6f420cd6061ac537bbe7540b48d1"></a>
|
||||||
|
unsigned int </td><td class="memItemRight" valign="bottom"><b>REGA</b> = 0</td></tr>
|
||||||
|
<tr class="separator:a2bac6f420cd6061ac537bbe7540b48d1"><td class="memSeparator" colspan="2"> </td></tr>
|
||||||
|
<tr class="memitem:a49f79d24966cadf4755a0bb549062928"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a49f79d24966cadf4755a0bb549062928"></a>
|
||||||
|
unsigned int </td><td class="memItemRight" valign="bottom"><b>REGB</b> = 0</td></tr>
|
||||||
|
<tr class="separator:a49f79d24966cadf4755a0bb549062928"><td class="memSeparator" colspan="2"> </td></tr>
|
||||||
|
<tr class="memitem:a8ee0a1731db5dbccb1a2dd187e1f8c2e"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a8ee0a1731db5dbccb1a2dd187e1f8c2e"></a>
|
||||||
|
unsigned int </td><td class="memItemRight" valign="bottom"><b>REGC</b> = 0</td></tr>
|
||||||
|
<tr class="separator:a8ee0a1731db5dbccb1a2dd187e1f8c2e"><td class="memSeparator" colspan="2"> </td></tr>
|
||||||
|
<tr class="memitem:a34801f98db7e647723fb1ee69a1026c5"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a34801f98db7e647723fb1ee69a1026c5"></a>
|
||||||
|
unsigned int </td><td class="memItemRight" valign="bottom"><b>REGX</b> = 0</td></tr>
|
||||||
|
<tr class="separator:a34801f98db7e647723fb1ee69a1026c5"><td class="memSeparator" colspan="2"> </td></tr>
|
||||||
|
<tr class="memitem:aeacb67c0cb64e281ca501c717f673174"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="aeacb67c0cb64e281ca501c717f673174"></a>
|
||||||
|
unsigned int </td><td class="memItemRight" valign="bottom"><b>INSP</b> = 0</td></tr>
|
||||||
|
<tr class="separator:aeacb67c0cb64e281ca501c717f673174"><td class="memSeparator" colspan="2"> </td></tr>
|
||||||
|
<tr class="memitem:a6f0c4cd9d2558ffac4c14be6ab9f9a7a"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a6f0c4cd9d2558ffac4c14be6ab9f9a7a"></a>
|
||||||
|
const char * </td><td class="memItemRight" valign="bottom"><b>register_str</b> [] = {"REGA", "REGB", "REGC", "REGX"}</td></tr>
|
||||||
|
<tr class="separator:a6f0c4cd9d2558ffac4c14be6ab9f9a7a"><td class="memSeparator" colspan="2"> </td></tr>
|
||||||
|
<tr class="memitem:a50bb3c6ef84bb338f7185fb9ded09fe7"><td class="memItemLeft" align="right" valign="top">const char * </td><td class="memItemRight" valign="bottom"><b>opcodeStr</b> []</td></tr>
|
||||||
|
<tr class="separator:a50bb3c6ef84bb338f7185fb9ded09fe7"><td class="memSeparator" colspan="2"> </td></tr>
|
||||||
|
<tr class="memitem:a2280840a3ebd422797c95a65e3e272e4"><td class="memItemLeft" align="right" valign="top">opcode_function </td><td class="memItemRight" valign="bottom"><b>opcodeFunc</b> []</td></tr>
|
||||||
|
<tr class="separator:a2280840a3ebd422797c95a65e3e272e4"><td class="memSeparator" colspan="2"> </td></tr>
|
||||||
|
</table>
|
||||||
|
<a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2>
|
||||||
|
<div class="textblock"><dl class="section author"><dt>Author</dt><dd>Ben Goldsworthy (rumps) <a href="#" onclick="location.href='mai'+'lto:'+'bgo'+'ld'+'swo'+'rt'+'hy9'+'6@'+'gma'+'il'+'.co'+'m'; return false;">bgold<span style="display: none;">.nosp@m.</span>swor<span style="display: none;">.nosp@m.</span>thy96<span style="display: none;">.nosp@m.</span>@gma<span style="display: none;">.nosp@m.</span>il.co<span style="display: none;">.nosp@m.</span>m</a> </dd></dl>
|
||||||
|
<dl class="section version"><dt>Version</dt><dd>1.0</dd></dl>
|
||||||
|
<h1><a class="anchor" id="LICENSE"></a>
|
||||||
|
LICENSE</h1>
|
||||||
|
<p>This file is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.</p>
|
||||||
|
<p>This file is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.</p>
|
||||||
|
<p>You should have received a copy of the GNU General Public License along with this program. If not, see <a href="http://www.gnu.org/licenses/">http://www.gnu.org/licenses/</a>.</p>
|
||||||
|
<h1><a class="anchor" id="DESCRIPTION"></a>
|
||||||
|
DESCRIPTION</h1>
|
||||||
|
<p>This program emulates programs written in the SCC.150 Assembler language. The language is a very simple assembly language that comprises of only ten opcodes:</p>
|
||||||
|
<p><code>NOP</code> or 'No OPeration', which performs no task</p>
|
||||||
|
<p><code>SET ARG1 ARG2</code>, which puts the value in <code>ARG2</code> into the register indicated in <code>ARG1</code></p>
|
||||||
|
<p><code>AND ARG1 ARG2</code>, which performs a bitwise AND operation on the values in <code>ARG1</code> and <code>ARG2</code></p>
|
||||||
|
<p><code>OR ARG1 ARG2</code>, which performs a bitwise OR operation on the values in <code>ARG1</code> and <code>ARG2</code></p>
|
||||||
|
<p><code>ADD ARG1 ARG2</code>, which performs an addition operation on the values in <code>ARG1</code> and <code>ARG2</code></p>
|
||||||
|
<p><code>SUB ARG1 ARG2</code>, which performs a subtraction operation on the values in <code>ARG1</code> and <code>ARG2</code></p>
|
||||||
|
<p><code>SHL ARG1 ARG2</code>, which performs a bitwise shift left on the value in <code>ARG1</code>, to the number indicated in <code>ARG2</code></p>
|
||||||
|
<p><code>SHR ARG1 ARG2</code>, which performs a bitwise shift right on the value in <code>ARG1</code>, to the number indicated in <code>ARG2</code></p>
|
||||||
|
<p><code>JMP ARG1</code>, which jumps to the line indicated by <code>ARG1</code> if the value in <code>REGX</code> is 0</p>
|
||||||
|
<p><code>PRT ARG1</code>, which prints the value in <code>ARG1</code></p>
|
||||||
|
<p>Five registers are used: <code>REGA</code>, <code>REGB</code>, <code>REGC</code>, <code>REGX</code> and <code>INSP</code>, or 'INStruction Pointer'.</p>
|
||||||
|
<p>Comments in the language are indicated by the line beginning with a '#'. </p>
|
||||||
|
</div><h2 class="groupheader">Function Documentation</h2>
|
||||||
|
<a class="anchor" id="a6b5c26779c71916073e7b8f9debea56d"></a>
|
||||||
|
<div class="memitem">
|
||||||
|
<div class="memproto">
|
||||||
|
<table class="memname">
|
||||||
|
<tr>
|
||||||
|
<td class="memname">int execInstruction </td>
|
||||||
|
<td>(</td>
|
||||||
|
<td class="paramtype">char * </td>
|
||||||
|
<td class="paramname"><em>instruction</em></td><td>)</td>
|
||||||
|
<td></td>
|
||||||
|
</tr>
|
||||||
|
</table>
|
||||||
|
</div><div class="memdoc">
|
||||||
|
<p>Executes an instruction.</p>
|
||||||
|
<p>Tests the validity of an instruction (and whether or not it's a comment), and if the line passes, calls the appropriate function.</p>
|
||||||
|
<dl class="params"><dt>Parameters</dt><dd>
|
||||||
|
<table class="params">
|
||||||
|
<tr><td class="paramname">instruction</td><td>the instruction to test </td></tr>
|
||||||
|
</table>
|
||||||
|
</dd>
|
||||||
|
</dl>
|
||||||
|
<dl class="section return"><dt>Returns</dt><dd>0 on success, -1 on failure </dd></dl>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<a class="anchor" id="a2bbc98d3653ad65ad12757dfa7bdfdd4"></a>
|
||||||
|
<div class="memitem">
|
||||||
|
<div class="memproto">
|
||||||
|
<table class="memname">
|
||||||
|
<tr>
|
||||||
|
<td class="memname">int execProgram </td>
|
||||||
|
<td>(</td>
|
||||||
|
<td class="paramname"></td><td>)</td>
|
||||||
|
<td></td>
|
||||||
|
</tr>
|
||||||
|
</table>
|
||||||
|
</div><div class="memdoc">
|
||||||
|
<p>Executes an the program.</p>
|
||||||
|
<p>Runs <code>execInstruction</code> on each line of the program in turn.</p>
|
||||||
|
<dl class="section return"><dt>Returns</dt><dd>0 on success, -1 on failure </dd></dl>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<a class="anchor" id="ae7178313a4254c62afc060814ebca038"></a>
|
||||||
|
<div class="memitem">
|
||||||
|
<div class="memproto">
|
||||||
|
<table class="memname">
|
||||||
|
<tr>
|
||||||
|
<td class="memname">int getArg2 </td>
|
||||||
|
<td>(</td>
|
||||||
|
<td class="paramtype">char * </td>
|
||||||
|
<td class="paramname"><em>arg2</em></td><td>)</td>
|
||||||
|
<td></td>
|
||||||
|
</tr>
|
||||||
|
</table>
|
||||||
|
</div><div class="memdoc">
|
||||||
|
<p>A function to return the value in the second argument of an instruction.</p>
|
||||||
|
<p>Returns either the value in the indicated register or, as the instruction is parsed as a string, the integer value given. <code><a class="el" href="mystring_8c.html#a70913f883a62585fb8fe025aa1e56749">mystrncmp()</a></code> is used over <code><a class="el" href="mystring_8c.html#a3dab99f21a63ee803be3e9344efda0a0">mystrcmp()</a></code> because there tends to be dodgy C string magic tacked on to the end of the args.</p>
|
||||||
|
<dl class="params"><dt>Parameters</dt><dd>
|
||||||
|
<table class="params">
|
||||||
|
<tr><td class="paramname">arg2</td><td>the value to parse </td></tr>
|
||||||
|
</table>
|
||||||
|
</dd>
|
||||||
|
</dl>
|
||||||
|
<dl class="section return"><dt>Returns</dt><dd>an integer </dd></dl>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<a class="anchor" id="a40c9c476ef53a0c955d3e633b54d2bd2"></a>
|
||||||
|
<div class="memitem">
|
||||||
|
<div class="memproto">
|
||||||
|
<table class="memname">
|
||||||
|
<tr>
|
||||||
|
<td class="memname">bool isValid </td>
|
||||||
|
<td>(</td>
|
||||||
|
<td class="paramtype">char * </td>
|
||||||
|
<td class="paramname"><em>opcode</em>, </td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td class="paramkey"></td>
|
||||||
|
<td></td>
|
||||||
|
<td class="paramtype">char * </td>
|
||||||
|
<td class="paramname"><em>arg1</em>, </td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td class="paramkey"></td>
|
||||||
|
<td></td>
|
||||||
|
<td class="paramtype">char * </td>
|
||||||
|
<td class="paramname"><em>arg2</em> </td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td></td>
|
||||||
|
<td>)</td>
|
||||||
|
<td></td><td></td>
|
||||||
|
</tr>
|
||||||
|
</table>
|
||||||
|
</div><div class="memdoc">
|
||||||
|
<p>Tests if an instruction is valid.</p>
|
||||||
|
<p>Tests that the opcode is valid and that the registers are also.</p>
|
||||||
|
<dl class="params"><dt>Parameters</dt><dd>
|
||||||
|
<table class="params">
|
||||||
|
<tr><td class="paramname">opcode</td><td>the opcode </td></tr>
|
||||||
|
<tr><td class="paramname">arg1</td><td>the first argument </td></tr>
|
||||||
|
<tr><td class="paramname">arg2</td><td>the second argument (not applicable for <code>PRT</code>) </td></tr>
|
||||||
|
</table>
|
||||||
|
</dd>
|
||||||
|
</dl>
|
||||||
|
<dl class="section return"><dt>Returns</dt><dd><code>true</code> if the string is valid, <code>false</code> if it is not </dd></dl>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<a class="anchor" id="a3d30edda62d5695ffaa3b62121d4bf98"></a>
|
||||||
|
<div class="memitem">
|
||||||
|
<div class="memproto">
|
||||||
|
<table class="memname">
|
||||||
|
<tr>
|
||||||
|
<td class="memname">int loadProgram </td>
|
||||||
|
<td>(</td>
|
||||||
|
<td class="paramname"></td><td>)</td>
|
||||||
|
<td></td>
|
||||||
|
</tr>
|
||||||
|
</table>
|
||||||
|
</div><div class="memdoc">
|
||||||
|
<p>Loads a program.</p>
|
||||||
|
<p>Loads the program file and reads each line into an array.</p>
|
||||||
|
<dl class="section return"><dt>Returns</dt><dd>0 on success, -1 on failure </dd></dl>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<a class="anchor" id="ae66f6b31b5ad750f1fe042a706a4e3d4"></a>
|
||||||
|
<div class="memitem">
|
||||||
|
<div class="memproto">
|
||||||
|
<table class="memname">
|
||||||
|
<tr>
|
||||||
|
<td class="memname">int main </td>
|
||||||
|
<td>(</td>
|
||||||
|
<td class="paramname"></td><td>)</td>
|
||||||
|
<td></td>
|
||||||
|
</tr>
|
||||||
|
</table>
|
||||||
|
</div><div class="memdoc">
|
||||||
|
<p>Runs the program.</p>
|
||||||
|
<dl class="section return"><dt>Returns</dt><dd>0 on success, -1 on failure </dd></dl>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<a class="anchor" id="a501fe22548fd568d37522ba76ff2c1e7"></a>
|
||||||
|
<div class="memitem">
|
||||||
|
<div class="memproto">
|
||||||
|
<table class="memname">
|
||||||
|
<tr>
|
||||||
|
<td class="memname">int opcodeADD </td>
|
||||||
|
<td>(</td>
|
||||||
|
<td class="paramtype">char * </td>
|
||||||
|
<td class="paramname"><em>opcode</em>, </td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td class="paramkey"></td>
|
||||||
|
<td></td>
|
||||||
|
<td class="paramtype">char * </td>
|
||||||
|
<td class="paramname"><em>arg1</em>, </td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td class="paramkey"></td>
|
||||||
|
<td></td>
|
||||||
|
<td class="paramtype">char * </td>
|
||||||
|
<td class="paramname"><em>arg2</em> </td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td></td>
|
||||||
|
<td>)</td>
|
||||||
|
<td></td><td></td>
|
||||||
|
</tr>
|
||||||
|
</table>
|
||||||
|
</div><div class="memdoc">
|
||||||
|
<p>A function to handle the <code>ADD</code> opcode</p>
|
||||||
|
<p>Performs addition on the values in <code>arg1</code> and <code>arg2</code>, storing the result in <code>arg1</code>.</p>
|
||||||
|
<dl class="params"><dt>Parameters</dt><dd>
|
||||||
|
<table class="params">
|
||||||
|
<tr><td class="paramname">opcode</td><td>the opcode </td></tr>
|
||||||
|
<tr><td class="paramname">arg1</td><td>the first argument </td></tr>
|
||||||
|
<tr><td class="paramname">arg2</td><td>the second argument </td></tr>
|
||||||
|
</table>
|
||||||
|
</dd>
|
||||||
|
</dl>
|
||||||
|
<dl class="section return"><dt>Returns</dt><dd>0 on success </dd></dl>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<a class="anchor" id="a434bd1e8b4e45503586891e565138b84"></a>
|
||||||
|
<div class="memitem">
|
||||||
|
<div class="memproto">
|
||||||
|
<table class="memname">
|
||||||
|
<tr>
|
||||||
|
<td class="memname">int opcodeAND </td>
|
||||||
|
<td>(</td>
|
||||||
|
<td class="paramtype">char * </td>
|
||||||
|
<td class="paramname"><em>opcode</em>, </td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td class="paramkey"></td>
|
||||||
|
<td></td>
|
||||||
|
<td class="paramtype">char * </td>
|
||||||
|
<td class="paramname"><em>arg1</em>, </td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td class="paramkey"></td>
|
||||||
|
<td></td>
|
||||||
|
<td class="paramtype">char * </td>
|
||||||
|
<td class="paramname"><em>arg2</em> </td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td></td>
|
||||||
|
<td>)</td>
|
||||||
|
<td></td><td></td>
|
||||||
|
</tr>
|
||||||
|
</table>
|
||||||
|
</div><div class="memdoc">
|
||||||
|
<p>A function to handle the <code>AND</code> opcode</p>
|
||||||
|
<p>Performs a bitwise AND on the values in <code>arg1</code> and <code>arg2</code>, storing the result in <code>arg1</code>.</p>
|
||||||
|
<dl class="params"><dt>Parameters</dt><dd>
|
||||||
|
<table class="params">
|
||||||
|
<tr><td class="paramname">opcode</td><td>the opcode </td></tr>
|
||||||
|
<tr><td class="paramname">arg1</td><td>the first argument </td></tr>
|
||||||
|
<tr><td class="paramname">arg2</td><td>the second argument </td></tr>
|
||||||
|
</table>
|
||||||
|
</dd>
|
||||||
|
</dl>
|
||||||
|
<dl class="section return"><dt>Returns</dt><dd>0 on success </dd></dl>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<a class="anchor" id="a734105640ec0f0c1e6dc8c5384b2d1d0"></a>
|
||||||
|
<div class="memitem">
|
||||||
|
<div class="memproto">
|
||||||
|
<table class="memname">
|
||||||
|
<tr>
|
||||||
|
<td class="memname">int opcodeJMP </td>
|
||||||
|
<td>(</td>
|
||||||
|
<td class="paramtype">char * </td>
|
||||||
|
<td class="paramname"><em>opcode</em>, </td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td class="paramkey"></td>
|
||||||
|
<td></td>
|
||||||
|
<td class="paramtype">char * </td>
|
||||||
|
<td class="paramname"><em>arg1</em>, </td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td class="paramkey"></td>
|
||||||
|
<td></td>
|
||||||
|
<td class="paramtype">char * </td>
|
||||||
|
<td class="paramname"><em>arg2</em> </td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td></td>
|
||||||
|
<td>)</td>
|
||||||
|
<td></td><td></td>
|
||||||
|
</tr>
|
||||||
|
</table>
|
||||||
|
</div><div class="memdoc">
|
||||||
|
<p>A function to handle the <code>JMP</code> opcode</p>
|
||||||
|
<p>If <code>REGX</code> contains 0, jumps to the line indicated by <code>arg1</code>.</p>
|
||||||
|
<dl class="params"><dt>Parameters</dt><dd>
|
||||||
|
<table class="params">
|
||||||
|
<tr><td class="paramname">opcode</td><td>the opcode </td></tr>
|
||||||
|
<tr><td class="paramname">arg1</td><td>the first argument </td></tr>
|
||||||
|
<tr><td class="paramname">arg2</td><td>the second argument (not applicable for <code>JMP</code>) </td></tr>
|
||||||
|
</table>
|
||||||
|
</dd>
|
||||||
|
</dl>
|
||||||
|
<dl class="section return"><dt>Returns</dt><dd>0 on success </dd></dl>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<a class="anchor" id="a00e5e1b7c08d6368342756805800133b"></a>
|
||||||
|
<div class="memitem">
|
||||||
|
<div class="memproto">
|
||||||
|
<table class="memname">
|
||||||
|
<tr>
|
||||||
|
<td class="memname">int opcodeNOP </td>
|
||||||
|
<td>(</td>
|
||||||
|
<td class="paramtype">char * </td>
|
||||||
|
<td class="paramname"><em>opcode</em>, </td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td class="paramkey"></td>
|
||||||
|
<td></td>
|
||||||
|
<td class="paramtype">char * </td>
|
||||||
|
<td class="paramname"><em>arg1</em>, </td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td class="paramkey"></td>
|
||||||
|
<td></td>
|
||||||
|
<td class="paramtype">char * </td>
|
||||||
|
<td class="paramname"><em>arg2</em> </td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td></td>
|
||||||
|
<td>)</td>
|
||||||
|
<td></td><td></td>
|
||||||
|
</tr>
|
||||||
|
</table>
|
||||||
|
</div><div class="memdoc">
|
||||||
|
<p>A function to handle the <code>NOP</code> opcode</p>
|
||||||
|
<p>Increments the instruction pointer <code>INSP</code>.</p>
|
||||||
|
<dl class="params"><dt>Parameters</dt><dd>
|
||||||
|
<table class="params">
|
||||||
|
<tr><td class="paramname">opcode</td><td>the opcode </td></tr>
|
||||||
|
<tr><td class="paramname">arg1</td><td>the first argument (not applicable for <code>NOP</code>) </td></tr>
|
||||||
|
<tr><td class="paramname">arg2</td><td>the second argument (not applicable for <code>NOP</code>) </td></tr>
|
||||||
|
</table>
|
||||||
|
</dd>
|
||||||
|
</dl>
|
||||||
|
<dl class="section return"><dt>Returns</dt><dd>0 on success </dd></dl>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<a class="anchor" id="a54c12a24203abe192fe4f727ea9ffe60"></a>
|
||||||
|
<div class="memitem">
|
||||||
|
<div class="memproto">
|
||||||
|
<table class="memname">
|
||||||
|
<tr>
|
||||||
|
<td class="memname">int opcodeOR </td>
|
||||||
|
<td>(</td>
|
||||||
|
<td class="paramtype">char * </td>
|
||||||
|
<td class="paramname"><em>opcode</em>, </td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td class="paramkey"></td>
|
||||||
|
<td></td>
|
||||||
|
<td class="paramtype">char * </td>
|
||||||
|
<td class="paramname"><em>arg1</em>, </td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td class="paramkey"></td>
|
||||||
|
<td></td>
|
||||||
|
<td class="paramtype">char * </td>
|
||||||
|
<td class="paramname"><em>arg2</em> </td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td></td>
|
||||||
|
<td>)</td>
|
||||||
|
<td></td><td></td>
|
||||||
|
</tr>
|
||||||
|
</table>
|
||||||
|
</div><div class="memdoc">
|
||||||
|
<p>A function to handle the <code>OR</code> opcode</p>
|
||||||
|
<p>Performs a bitwise OR on the values in <code>arg1</code> and <code>arg2</code>, storing the result in <code>arg1</code>.</p>
|
||||||
|
<dl class="params"><dt>Parameters</dt><dd>
|
||||||
|
<table class="params">
|
||||||
|
<tr><td class="paramname">opcode</td><td>the opcode </td></tr>
|
||||||
|
<tr><td class="paramname">arg1</td><td>the first argument </td></tr>
|
||||||
|
<tr><td class="paramname">arg2</td><td>the second argument </td></tr>
|
||||||
|
</table>
|
||||||
|
</dd>
|
||||||
|
</dl>
|
||||||
|
<dl class="section return"><dt>Returns</dt><dd>0 on success </dd></dl>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<a class="anchor" id="aeb406b3428b5429249ab2c7e3d7bcc3c"></a>
|
||||||
|
<div class="memitem">
|
||||||
|
<div class="memproto">
|
||||||
|
<table class="memname">
|
||||||
|
<tr>
|
||||||
|
<td class="memname">int opcodePRT </td>
|
||||||
|
<td>(</td>
|
||||||
|
<td class="paramtype">char * </td>
|
||||||
|
<td class="paramname"><em>opcode</em>, </td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td class="paramkey"></td>
|
||||||
|
<td></td>
|
||||||
|
<td class="paramtype">char * </td>
|
||||||
|
<td class="paramname"><em>arg1</em>, </td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td class="paramkey"></td>
|
||||||
|
<td></td>
|
||||||
|
<td class="paramtype">char * </td>
|
||||||
|
<td class="paramname"><em>arg2</em> </td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td></td>
|
||||||
|
<td>)</td>
|
||||||
|
<td></td><td></td>
|
||||||
|
</tr>
|
||||||
|
</table>
|
||||||
|
</div><div class="memdoc">
|
||||||
|
<p>A function to handle the <code>PRT</code> opcode</p>
|
||||||
|
<p>Prints the value in the register indicated in <code>arg1</code>, or the integer value specified.</p>
|
||||||
|
<dl class="params"><dt>Parameters</dt><dd>
|
||||||
|
<table class="params">
|
||||||
|
<tr><td class="paramname">opcode</td><td>the opcode </td></tr>
|
||||||
|
<tr><td class="paramname">arg1</td><td>the first argument </td></tr>
|
||||||
|
<tr><td class="paramname">arg2</td><td>the second argument (not applicable for <code>PRT</code>) </td></tr>
|
||||||
|
</table>
|
||||||
|
</dd>
|
||||||
|
</dl>
|
||||||
|
<dl class="section return"><dt>Returns</dt><dd>0 on success </dd></dl>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<a class="anchor" id="a5d6aac425624196dcd0d278760270d00"></a>
|
||||||
|
<div class="memitem">
|
||||||
|
<div class="memproto">
|
||||||
|
<table class="memname">
|
||||||
|
<tr>
|
||||||
|
<td class="memname">int opcodeSET </td>
|
||||||
|
<td>(</td>
|
||||||
|
<td class="paramtype">char * </td>
|
||||||
|
<td class="paramname"><em>opcode</em>, </td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td class="paramkey"></td>
|
||||||
|
<td></td>
|
||||||
|
<td class="paramtype">char * </td>
|
||||||
|
<td class="paramname"><em>arg1</em>, </td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td class="paramkey"></td>
|
||||||
|
<td></td>
|
||||||
|
<td class="paramtype">char * </td>
|
||||||
|
<td class="paramname"><em>arg2</em> </td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td></td>
|
||||||
|
<td>)</td>
|
||||||
|
<td></td><td></td>
|
||||||
|
</tr>
|
||||||
|
</table>
|
||||||
|
</div><div class="memdoc">
|
||||||
|
<p>A function to handle the <code>SET</code> opcode</p>
|
||||||
|
<p>Gets the value of either the register or integer set in <code>arg2</code> and places it in the register indicated by <code>arg1</code>.</p>
|
||||||
|
<dl class="params"><dt>Parameters</dt><dd>
|
||||||
|
<table class="params">
|
||||||
|
<tr><td class="paramname">opcode</td><td>the opcode </td></tr>
|
||||||
|
<tr><td class="paramname">arg1</td><td>the first argument </td></tr>
|
||||||
|
<tr><td class="paramname">arg2</td><td>the second argument </td></tr>
|
||||||
|
</table>
|
||||||
|
</dd>
|
||||||
|
</dl>
|
||||||
|
<dl class="section return"><dt>Returns</dt><dd>0 on success </dd></dl>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<a class="anchor" id="a3cdb2ee632bc1b19d885c26b044d76ae"></a>
|
||||||
|
<div class="memitem">
|
||||||
|
<div class="memproto">
|
||||||
|
<table class="memname">
|
||||||
|
<tr>
|
||||||
|
<td class="memname">int opcodeSHL </td>
|
||||||
|
<td>(</td>
|
||||||
|
<td class="paramtype">char * </td>
|
||||||
|
<td class="paramname"><em>opcode</em>, </td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td class="paramkey"></td>
|
||||||
|
<td></td>
|
||||||
|
<td class="paramtype">char * </td>
|
||||||
|
<td class="paramname"><em>arg1</em>, </td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td class="paramkey"></td>
|
||||||
|
<td></td>
|
||||||
|
<td class="paramtype">char * </td>
|
||||||
|
<td class="paramname"><em>arg2</em> </td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td></td>
|
||||||
|
<td>)</td>
|
||||||
|
<td></td><td></td>
|
||||||
|
</tr>
|
||||||
|
</table>
|
||||||
|
</div><div class="memdoc">
|
||||||
|
<p>A function to handle the <code>SHL</code> opcode</p>
|
||||||
|
<p>Performs a bitwise shift left on the value in <code>arg1</code>, storing the result in <code>arg1</code>. The number of shifts is specified in <code>arg2</code>.</p>
|
||||||
|
<dl class="params"><dt>Parameters</dt><dd>
|
||||||
|
<table class="params">
|
||||||
|
<tr><td class="paramname">opcode</td><td>the opcode </td></tr>
|
||||||
|
<tr><td class="paramname">arg1</td><td>the first argument </td></tr>
|
||||||
|
<tr><td class="paramname">arg2</td><td>the second argument </td></tr>
|
||||||
|
</table>
|
||||||
|
</dd>
|
||||||
|
</dl>
|
||||||
|
<dl class="section return"><dt>Returns</dt><dd>0 on success </dd></dl>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<a class="anchor" id="a6f1fa1ff65a606afddb458fcd64449cf"></a>
|
||||||
|
<div class="memitem">
|
||||||
|
<div class="memproto">
|
||||||
|
<table class="memname">
|
||||||
|
<tr>
|
||||||
|
<td class="memname">int opcodeSHR </td>
|
||||||
|
<td>(</td>
|
||||||
|
<td class="paramtype">char * </td>
|
||||||
|
<td class="paramname"><em>opcode</em>, </td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td class="paramkey"></td>
|
||||||
|
<td></td>
|
||||||
|
<td class="paramtype">char * </td>
|
||||||
|
<td class="paramname"><em>arg1</em>, </td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td class="paramkey"></td>
|
||||||
|
<td></td>
|
||||||
|
<td class="paramtype">char * </td>
|
||||||
|
<td class="paramname"><em>arg2</em> </td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td></td>
|
||||||
|
<td>)</td>
|
||||||
|
<td></td><td></td>
|
||||||
|
</tr>
|
||||||
|
</table>
|
||||||
|
</div><div class="memdoc">
|
||||||
|
<p>A function to handle the <code>SHR</code> opcode</p>
|
||||||
|
<p>Performs a bitwise shift right on the value in <code>arg1</code>, storing the result in <code>arg1</code>. The number of shifts is specified in <code>arg2</code>.</p>
|
||||||
|
<dl class="params"><dt>Parameters</dt><dd>
|
||||||
|
<table class="params">
|
||||||
|
<tr><td class="paramname">opcode</td><td>the opcode </td></tr>
|
||||||
|
<tr><td class="paramname">arg1</td><td>the first argument </td></tr>
|
||||||
|
<tr><td class="paramname">arg2</td><td>the second argument </td></tr>
|
||||||
|
</table>
|
||||||
|
</dd>
|
||||||
|
</dl>
|
||||||
|
<dl class="section return"><dt>Returns</dt><dd>0 on success </dd></dl>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<a class="anchor" id="a3ead6beddb4488ab700a81968e30e11c"></a>
|
||||||
|
<div class="memitem">
|
||||||
|
<div class="memproto">
|
||||||
|
<table class="memname">
|
||||||
|
<tr>
|
||||||
|
<td class="memname">int opcodeSUB </td>
|
||||||
|
<td>(</td>
|
||||||
|
<td class="paramtype">char * </td>
|
||||||
|
<td class="paramname"><em>opcode</em>, </td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td class="paramkey"></td>
|
||||||
|
<td></td>
|
||||||
|
<td class="paramtype">char * </td>
|
||||||
|
<td class="paramname"><em>arg1</em>, </td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td class="paramkey"></td>
|
||||||
|
<td></td>
|
||||||
|
<td class="paramtype">char * </td>
|
||||||
|
<td class="paramname"><em>arg2</em> </td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td></td>
|
||||||
|
<td>)</td>
|
||||||
|
<td></td><td></td>
|
||||||
|
</tr>
|
||||||
|
</table>
|
||||||
|
</div><div class="memdoc">
|
||||||
|
<p>A function to handle the <code>SUB</code> opcode</p>
|
||||||
|
<p>Subtracts the value in <code>arg2</code> from the value in <code>arg1</code>, storing the result in <code>arg1</code>.</p>
|
||||||
|
<dl class="params"><dt>Parameters</dt><dd>
|
||||||
|
<table class="params">
|
||||||
|
<tr><td class="paramname">opcode</td><td>the opcode </td></tr>
|
||||||
|
<tr><td class="paramname">arg1</td><td>the first argument </td></tr>
|
||||||
|
<tr><td class="paramname">arg2</td><td>the second argument </td></tr>
|
||||||
|
</table>
|
||||||
|
</dd>
|
||||||
|
</dl>
|
||||||
|
<dl class="section return"><dt>Returns</dt><dd>0 on success </dd></dl>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<h2 class="groupheader">Variable Documentation</h2>
|
||||||
|
<a class="anchor" id="a2280840a3ebd422797c95a65e3e272e4"></a>
|
||||||
|
<div class="memitem">
|
||||||
|
<div class="memproto">
|
||||||
|
<table class="memname">
|
||||||
|
<tr>
|
||||||
|
<td class="memname">opcode_function opcodeFunc[]</td>
|
||||||
|
</tr>
|
||||||
|
</table>
|
||||||
|
</div><div class="memdoc">
|
||||||
|
<b>Initial value:</b><div class="fragment"><div class="line">= {&<a class="code" href="emulator_8c.html#a00e5e1b7c08d6368342756805800133b">opcodeNOP</a>, &<a class="code" href="emulator_8c.html#a5d6aac425624196dcd0d278760270d00">opcodeSET</a>, &<a class="code" href="emulator_8c.html#a434bd1e8b4e45503586891e565138b84">opcodeAND</a>, &<a class="code" href="emulator_8c.html#a54c12a24203abe192fe4f727ea9ffe60">opcodeOR</a>,</div>
|
||||||
|
<div class="line"> &<a class="code" href="emulator_8c.html#a501fe22548fd568d37522ba76ff2c1e7">opcodeADD</a>, &<a class="code" href="emulator_8c.html#a3ead6beddb4488ab700a81968e30e11c">opcodeSUB</a>, &<a class="code" href="emulator_8c.html#a3cdb2ee632bc1b19d885c26b044d76ae">opcodeSHL</a>, &<a class="code" href="emulator_8c.html#a6f1fa1ff65a606afddb458fcd64449cf">opcodeSHR</a>,</div>
|
||||||
|
<div class="line"> &<a class="code" href="emulator_8c.html#a734105640ec0f0c1e6dc8c5384b2d1d0">opcodeJMP</a>, &<a class="code" href="emulator_8c.html#aeb406b3428b5429249ab2c7e3d7bcc3c">opcodePRT</a>}</div>
|
||||||
|
<div class="ttc" id="emulator_8c_html_a734105640ec0f0c1e6dc8c5384b2d1d0"><div class="ttname"><a href="emulator_8c.html#a734105640ec0f0c1e6dc8c5384b2d1d0">opcodeJMP</a></div><div class="ttdeci">int opcodeJMP(char *opcode, char *arg1, char *arg2)</div><div class="ttdef"><b>Definition:</b> emulator.c:291</div></div>
|
||||||
|
<div class="ttc" id="emulator_8c_html_a54c12a24203abe192fe4f727ea9ffe60"><div class="ttname"><a href="emulator_8c.html#a54c12a24203abe192fe4f727ea9ffe60">opcodeOR</a></div><div class="ttdeci">int opcodeOR(char *opcode, char *arg1, char *arg2)</div><div class="ttdef"><b>Definition:</b> emulator.c:172</div></div>
|
||||||
|
<div class="ttc" id="emulator_8c_html_a6f1fa1ff65a606afddb458fcd64449cf"><div class="ttname"><a href="emulator_8c.html#a6f1fa1ff65a606afddb458fcd64449cf">opcodeSHR</a></div><div class="ttdeci">int opcodeSHR(char *opcode, char *arg1, char *arg2)</div><div class="ttdef"><b>Definition:</b> emulator.c:268</div></div>
|
||||||
|
<div class="ttc" id="emulator_8c_html_a3ead6beddb4488ab700a81968e30e11c"><div class="ttname"><a href="emulator_8c.html#a3ead6beddb4488ab700a81968e30e11c">opcodeSUB</a></div><div class="ttdeci">int opcodeSUB(char *opcode, char *arg1, char *arg2)</div><div class="ttdef"><b>Definition:</b> emulator.c:220</div></div>
|
||||||
|
<div class="ttc" id="emulator_8c_html_aeb406b3428b5429249ab2c7e3d7bcc3c"><div class="ttname"><a href="emulator_8c.html#aeb406b3428b5429249ab2c7e3d7bcc3c">opcodePRT</a></div><div class="ttdeci">int opcodePRT(char *opcode, char *arg1, char *arg2)</div><div class="ttdef"><b>Definition:</b> emulator.c:311</div></div>
|
||||||
|
<div class="ttc" id="emulator_8c_html_a434bd1e8b4e45503586891e565138b84"><div class="ttname"><a href="emulator_8c.html#a434bd1e8b4e45503586891e565138b84">opcodeAND</a></div><div class="ttdeci">int opcodeAND(char *opcode, char *arg1, char *arg2)</div><div class="ttdef"><b>Definition:</b> emulator.c:148</div></div>
|
||||||
|
<div class="ttc" id="emulator_8c_html_a501fe22548fd568d37522ba76ff2c1e7"><div class="ttname"><a href="emulator_8c.html#a501fe22548fd568d37522ba76ff2c1e7">opcodeADD</a></div><div class="ttdeci">int opcodeADD(char *opcode, char *arg1, char *arg2)</div><div class="ttdef"><b>Definition:</b> emulator.c:196</div></div>
|
||||||
|
<div class="ttc" id="emulator_8c_html_a5d6aac425624196dcd0d278760270d00"><div class="ttname"><a href="emulator_8c.html#a5d6aac425624196dcd0d278760270d00">opcodeSET</a></div><div class="ttdeci">int opcodeSET(char *opcode, char *arg1, char *arg2)</div><div class="ttdef"><b>Definition:</b> emulator.c:124</div></div>
|
||||||
|
<div class="ttc" id="emulator_8c_html_a00e5e1b7c08d6368342756805800133b"><div class="ttname"><a href="emulator_8c.html#a00e5e1b7c08d6368342756805800133b">opcodeNOP</a></div><div class="ttdeci">int opcodeNOP(char *opcode, char *arg1, char *arg2)</div><div class="ttdef"><b>Definition:</b> emulator.c:107</div></div>
|
||||||
|
<div class="ttc" id="emulator_8c_html_a3cdb2ee632bc1b19d885c26b044d76ae"><div class="ttname"><a href="emulator_8c.html#a3cdb2ee632bc1b19d885c26b044d76ae">opcodeSHL</a></div><div class="ttdeci">int opcodeSHL(char *opcode, char *arg1, char *arg2)</div><div class="ttdef"><b>Definition:</b> emulator.c:244</div></div>
|
||||||
|
</div><!-- fragment -->
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<a class="anchor" id="a50bb3c6ef84bb338f7185fb9ded09fe7"></a>
|
||||||
|
<div class="memitem">
|
||||||
|
<div class="memproto">
|
||||||
|
<table class="memname">
|
||||||
|
<tr>
|
||||||
|
<td class="memname">const char* opcodeStr[]</td>
|
||||||
|
</tr>
|
||||||
|
</table>
|
||||||
|
</div><div class="memdoc">
|
||||||
|
<b>Initial value:</b><div class="fragment"><div class="line">= {<span class="stringliteral">"NOP"</span>, <span class="stringliteral">"SET"</span>, <span class="stringliteral">"AND"</span>, <span class="stringliteral">"OR"</span>, <span class="stringliteral">"ADD"</span>,</div>
|
||||||
|
<div class="line"> <span class="stringliteral">"SUB"</span>, <span class="stringliteral">"SHL"</span>, <span class="stringliteral">"SHR"</span>, <span class="stringliteral">"JMP"</span>, <span class="stringliteral">"PRT"</span>}</div>
|
||||||
|
</div><!-- fragment -->
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div><!-- contents -->
|
||||||
|
<!-- start footer part -->
|
||||||
|
<hr class="footer"/><address class="footer"><small>
|
||||||
|
Generated on Tue May 19 2015 20:34:54 for SCC.150 Assembler Emulator by  <a href="http://www.doxygen.org/index.html">
|
||||||
|
<img class="footer" src="doxygen.png" alt="doxygen"/>
|
||||||
|
</a> 1.8.6
|
||||||
|
</small></address>
|
||||||
|
</body>
|
||||||
|
</html>
|
741
doc/html/emulator_8h.html
Executable file
|
@ -0,0 +1,741 @@
|
||||||
|
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
||||||
|
<html xmlns="http://www.w3.org/1999/xhtml">
|
||||||
|
<head>
|
||||||
|
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
|
||||||
|
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
|
||||||
|
<meta name="generator" content="Doxygen 1.8.6"/>
|
||||||
|
<title>SCC.150 Assembler Emulator: /home/rumperuu/Documents/University/University Work/SCC.150 Digital Systems/Coursework/unr-C/SCC.150 Assembler Emulator/source/emulator.h File Reference</title>
|
||||||
|
<link href="tabs.css" rel="stylesheet" type="text/css"/>
|
||||||
|
<script type="text/javascript" src="jquery.js"></script>
|
||||||
|
<script type="text/javascript" src="dynsections.js"></script>
|
||||||
|
<link href="search/search.css" rel="stylesheet" type="text/css"/>
|
||||||
|
<script type="text/javascript" src="search/search.js"></script>
|
||||||
|
<script type="text/javascript">
|
||||||
|
$(document).ready(function() { searchBox.OnSelectItem(0); });
|
||||||
|
</script>
|
||||||
|
<link href="doxygen.css" rel="stylesheet" type="text/css" />
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
|
||||||
|
<div id="titlearea">
|
||||||
|
<table cellspacing="0" cellpadding="0">
|
||||||
|
<tbody>
|
||||||
|
<tr style="height: 56px;">
|
||||||
|
<td style="padding-left: 0.5em;">
|
||||||
|
<div id="projectname">SCC.150 Assembler Emulator
|
||||||
|
</div>
|
||||||
|
<div id="projectbrief">A compiler for a simple assembler language</div>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
</tbody>
|
||||||
|
</table>
|
||||||
|
</div>
|
||||||
|
<!-- end header part -->
|
||||||
|
<!-- Generated by Doxygen 1.8.6 -->
|
||||||
|
<script type="text/javascript">
|
||||||
|
var searchBox = new SearchBox("searchBox", "search",false,'Search');
|
||||||
|
</script>
|
||||||
|
<div id="navrow1" class="tabs">
|
||||||
|
<ul class="tablist">
|
||||||
|
<li><a href="index.html"><span>Main Page</span></a></li>
|
||||||
|
<li class="current"><a href="files.html"><span>Files</span></a></li>
|
||||||
|
<li>
|
||||||
|
<div id="MSearchBox" class="MSearchBoxInactive">
|
||||||
|
<span class="left">
|
||||||
|
<img id="MSearchSelect" src="search/mag_sel.png"
|
||||||
|
onmouseover="return searchBox.OnSearchSelectShow()"
|
||||||
|
onmouseout="return searchBox.OnSearchSelectHide()"
|
||||||
|
alt=""/>
|
||||||
|
<input type="text" id="MSearchField" value="Search" accesskey="S"
|
||||||
|
onfocus="searchBox.OnSearchFieldFocus(true)"
|
||||||
|
onblur="searchBox.OnSearchFieldFocus(false)"
|
||||||
|
onkeyup="searchBox.OnSearchFieldChange(event)"/>
|
||||||
|
</span><span class="right">
|
||||||
|
<a id="MSearchClose" href="javascript:searchBox.CloseResultsWindow()"><img id="MSearchCloseImg" border="0" src="search/close.png" alt=""/></a>
|
||||||
|
</span>
|
||||||
|
</div>
|
||||||
|
</li>
|
||||||
|
</ul>
|
||||||
|
</div>
|
||||||
|
<div id="navrow2" class="tabs2">
|
||||||
|
<ul class="tablist">
|
||||||
|
<li><a href="files.html"><span>File List</span></a></li>
|
||||||
|
<li><a href="globals.html"><span>Globals</span></a></li>
|
||||||
|
</ul>
|
||||||
|
</div>
|
||||||
|
<!-- window showing the filter options -->
|
||||||
|
<div id="MSearchSelectWindow"
|
||||||
|
onmouseover="return searchBox.OnSearchSelectShow()"
|
||||||
|
onmouseout="return searchBox.OnSearchSelectHide()"
|
||||||
|
onkeydown="return searchBox.OnSearchSelectKey(event)">
|
||||||
|
<a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(0)"><span class="SelectionMark"> </span>All</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(1)"><span class="SelectionMark"> </span>Files</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(2)"><span class="SelectionMark"> </span>Functions</a></div>
|
||||||
|
|
||||||
|
<!-- iframe showing the search results (closed by default) -->
|
||||||
|
<div id="MSearchResultsWindow">
|
||||||
|
<iframe src="javascript:void(0)" frameborder="0"
|
||||||
|
name="MSearchResults" id="MSearchResults">
|
||||||
|
</iframe>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div id="nav-path" class="navpath">
|
||||||
|
<ul>
|
||||||
|
<li class="navelem"><a class="el" href="dir_b2f33c71d4aa5e7af42a1ca61ff5af1b.html">source</a></li> </ul>
|
||||||
|
</div>
|
||||||
|
</div><!-- top -->
|
||||||
|
<div class="header">
|
||||||
|
<div class="summary">
|
||||||
|
<a href="#define-members">Macros</a> |
|
||||||
|
<a href="#func-members">Functions</a> </div>
|
||||||
|
<div class="headertitle">
|
||||||
|
<div class="title">emulator.h File Reference</div> </div>
|
||||||
|
</div><!--header-->
|
||||||
|
<div class="contents">
|
||||||
|
<div class="textblock"><code>#include <stdio.h></code><br/>
|
||||||
|
<code>#include <stdlib.h></code><br/>
|
||||||
|
<code>#include <stdbool.h></code><br/>
|
||||||
|
</div>
|
||||||
|
<p><a href="emulator_8h_source.html">Go to the source code of this file.</a></p>
|
||||||
|
<table class="memberdecls">
|
||||||
|
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="define-members"></a>
|
||||||
|
Macros</h2></td></tr>
|
||||||
|
<tr class="memitem:aad2f1b717992001ef1934f168b316e70"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="aad2f1b717992001ef1934f168b316e70"></a>
|
||||||
|
#define </td><td class="memItemRight" valign="bottom"><b>MAX_PROG_LEN</b>   99</td></tr>
|
||||||
|
<tr class="separator:aad2f1b717992001ef1934f168b316e70"><td class="memSeparator" colspan="2"> </td></tr>
|
||||||
|
<tr class="memitem:a09a3b394b8602092d58347b791158062"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a09a3b394b8602092d58347b791158062"></a>
|
||||||
|
#define </td><td class="memItemRight" valign="bottom"><b>MAX_LINE_LEN</b>   80</td></tr>
|
||||||
|
<tr class="separator:a09a3b394b8602092d58347b791158062"><td class="memSeparator" colspan="2"> </td></tr>
|
||||||
|
<tr class="memitem:aa7be7b66f5e5c14463a0f09790fbfbd5"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="aa7be7b66f5e5c14463a0f09790fbfbd5"></a>
|
||||||
|
#define </td><td class="memItemRight" valign="bottom"><b>MAX_OPCODE</b>   10</td></tr>
|
||||||
|
<tr class="separator:aa7be7b66f5e5c14463a0f09790fbfbd5"><td class="memSeparator" colspan="2"> </td></tr>
|
||||||
|
<tr class="memitem:af79ab75f761ab93113eeca724d809ce4"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="af79ab75f761ab93113eeca724d809ce4"></a>
|
||||||
|
#define </td><td class="memItemRight" valign="bottom"><b>MAX_REGISTER</b>   4</td></tr>
|
||||||
|
<tr class="separator:af79ab75f761ab93113eeca724d809ce4"><td class="memSeparator" colspan="2"> </td></tr>
|
||||||
|
<tr class="memitem:a1b05dbe077d74072fcaa03bf2940af64"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a1b05dbe077d74072fcaa03bf2940af64"></a>
|
||||||
|
#define </td><td class="memItemRight" valign="bottom"><b>OPCODE_LENGTH</b>   3</td></tr>
|
||||||
|
<tr class="separator:a1b05dbe077d74072fcaa03bf2940af64"><td class="memSeparator" colspan="2"> </td></tr>
|
||||||
|
<tr class="memitem:a25f40fb7595d797ba48b360ceb962387"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a25f40fb7595d797ba48b360ceb962387"></a>
|
||||||
|
#define </td><td class="memItemRight" valign="bottom"><b>ARG_LENGTH</b>   4</td></tr>
|
||||||
|
<tr class="separator:a25f40fb7595d797ba48b360ceb962387"><td class="memSeparator" colspan="2"> </td></tr>
|
||||||
|
<tr class="memitem:abb0ffe51f3d9eb582eca011b61ba76fb"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="abb0ffe51f3d9eb582eca011b61ba76fb"></a>
|
||||||
|
#define </td><td class="memItemRight" valign="bottom"><b>OPCODE</b>   0</td></tr>
|
||||||
|
<tr class="separator:abb0ffe51f3d9eb582eca011b61ba76fb"><td class="memSeparator" colspan="2"> </td></tr>
|
||||||
|
<tr class="memitem:a6e9f80720a3b58c16d87ad9fed8147f3"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a6e9f80720a3b58c16d87ad9fed8147f3"></a>
|
||||||
|
#define </td><td class="memItemRight" valign="bottom"><b>ARG1</b>   1</td></tr>
|
||||||
|
<tr class="separator:a6e9f80720a3b58c16d87ad9fed8147f3"><td class="memSeparator" colspan="2"> </td></tr>
|
||||||
|
<tr class="memitem:a0f928d4a2f0889f390fdd9efab797dad"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a0f928d4a2f0889f390fdd9efab797dad"></a>
|
||||||
|
#define </td><td class="memItemRight" valign="bottom"><b>ARG2</b>   2</td></tr>
|
||||||
|
<tr class="separator:a0f928d4a2f0889f390fdd9efab797dad"><td class="memSeparator" colspan="2"> </td></tr>
|
||||||
|
</table><table class="memberdecls">
|
||||||
|
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="func-members"></a>
|
||||||
|
Functions</h2></td></tr>
|
||||||
|
<tr class="memitem:a00e5e1b7c08d6368342756805800133b"><td class="memItemLeft" align="right" valign="top">int </td><td class="memItemRight" valign="bottom"><a class="el" href="emulator_8h.html#a00e5e1b7c08d6368342756805800133b">opcodeNOP</a> (char *opcode, char *arg1, char *arg2)</td></tr>
|
||||||
|
<tr class="separator:a00e5e1b7c08d6368342756805800133b"><td class="memSeparator" colspan="2"> </td></tr>
|
||||||
|
<tr class="memitem:a5d6aac425624196dcd0d278760270d00"><td class="memItemLeft" align="right" valign="top">int </td><td class="memItemRight" valign="bottom"><a class="el" href="emulator_8h.html#a5d6aac425624196dcd0d278760270d00">opcodeSET</a> (char *opcode, char *arg1, char *arg2)</td></tr>
|
||||||
|
<tr class="separator:a5d6aac425624196dcd0d278760270d00"><td class="memSeparator" colspan="2"> </td></tr>
|
||||||
|
<tr class="memitem:a434bd1e8b4e45503586891e565138b84"><td class="memItemLeft" align="right" valign="top">int </td><td class="memItemRight" valign="bottom"><a class="el" href="emulator_8h.html#a434bd1e8b4e45503586891e565138b84">opcodeAND</a> (char *opcode, char *arg1, char *arg2)</td></tr>
|
||||||
|
<tr class="separator:a434bd1e8b4e45503586891e565138b84"><td class="memSeparator" colspan="2"> </td></tr>
|
||||||
|
<tr class="memitem:a54c12a24203abe192fe4f727ea9ffe60"><td class="memItemLeft" align="right" valign="top">int </td><td class="memItemRight" valign="bottom"><a class="el" href="emulator_8h.html#a54c12a24203abe192fe4f727ea9ffe60">opcodeOR</a> (char *opcode, char *arg1, char *arg2)</td></tr>
|
||||||
|
<tr class="separator:a54c12a24203abe192fe4f727ea9ffe60"><td class="memSeparator" colspan="2"> </td></tr>
|
||||||
|
<tr class="memitem:a501fe22548fd568d37522ba76ff2c1e7"><td class="memItemLeft" align="right" valign="top">int </td><td class="memItemRight" valign="bottom"><a class="el" href="emulator_8h.html#a501fe22548fd568d37522ba76ff2c1e7">opcodeADD</a> (char *opcode, char *arg1, char *arg2)</td></tr>
|
||||||
|
<tr class="separator:a501fe22548fd568d37522ba76ff2c1e7"><td class="memSeparator" colspan="2"> </td></tr>
|
||||||
|
<tr class="memitem:a3ead6beddb4488ab700a81968e30e11c"><td class="memItemLeft" align="right" valign="top">int </td><td class="memItemRight" valign="bottom"><a class="el" href="emulator_8h.html#a3ead6beddb4488ab700a81968e30e11c">opcodeSUB</a> (char *opcode, char *arg1, char *arg2)</td></tr>
|
||||||
|
<tr class="separator:a3ead6beddb4488ab700a81968e30e11c"><td class="memSeparator" colspan="2"> </td></tr>
|
||||||
|
<tr class="memitem:a3cdb2ee632bc1b19d885c26b044d76ae"><td class="memItemLeft" align="right" valign="top">int </td><td class="memItemRight" valign="bottom"><a class="el" href="emulator_8h.html#a3cdb2ee632bc1b19d885c26b044d76ae">opcodeSHL</a> (char *opcode, char *arg1, char *arg2)</td></tr>
|
||||||
|
<tr class="separator:a3cdb2ee632bc1b19d885c26b044d76ae"><td class="memSeparator" colspan="2"> </td></tr>
|
||||||
|
<tr class="memitem:a6f1fa1ff65a606afddb458fcd64449cf"><td class="memItemLeft" align="right" valign="top">int </td><td class="memItemRight" valign="bottom"><a class="el" href="emulator_8h.html#a6f1fa1ff65a606afddb458fcd64449cf">opcodeSHR</a> (char *opcode, char *arg1, char *arg2)</td></tr>
|
||||||
|
<tr class="separator:a6f1fa1ff65a606afddb458fcd64449cf"><td class="memSeparator" colspan="2"> </td></tr>
|
||||||
|
<tr class="memitem:a734105640ec0f0c1e6dc8c5384b2d1d0"><td class="memItemLeft" align="right" valign="top">int </td><td class="memItemRight" valign="bottom"><a class="el" href="emulator_8h.html#a734105640ec0f0c1e6dc8c5384b2d1d0">opcodeJMP</a> (char *opcode, char *arg1, char *arg2)</td></tr>
|
||||||
|
<tr class="separator:a734105640ec0f0c1e6dc8c5384b2d1d0"><td class="memSeparator" colspan="2"> </td></tr>
|
||||||
|
<tr class="memitem:aeb406b3428b5429249ab2c7e3d7bcc3c"><td class="memItemLeft" align="right" valign="top">int </td><td class="memItemRight" valign="bottom"><a class="el" href="emulator_8h.html#aeb406b3428b5429249ab2c7e3d7bcc3c">opcodePRT</a> (char *opcode, char *arg1, char *arg2)</td></tr>
|
||||||
|
<tr class="separator:aeb406b3428b5429249ab2c7e3d7bcc3c"><td class="memSeparator" colspan="2"> </td></tr>
|
||||||
|
<tr class="memitem:ae7178313a4254c62afc060814ebca038"><td class="memItemLeft" align="right" valign="top">int </td><td class="memItemRight" valign="bottom"><a class="el" href="emulator_8h.html#ae7178313a4254c62afc060814ebca038">getArg2</a> (char *arg2)</td></tr>
|
||||||
|
<tr class="separator:ae7178313a4254c62afc060814ebca038"><td class="memSeparator" colspan="2"> </td></tr>
|
||||||
|
<tr class="memitem:a40c9c476ef53a0c955d3e633b54d2bd2"><td class="memItemLeft" align="right" valign="top">bool </td><td class="memItemRight" valign="bottom"><a class="el" href="emulator_8h.html#a40c9c476ef53a0c955d3e633b54d2bd2">isValid</a> (char *opcode, char *arg1, char *arg2)</td></tr>
|
||||||
|
<tr class="separator:a40c9c476ef53a0c955d3e633b54d2bd2"><td class="memSeparator" colspan="2"> </td></tr>
|
||||||
|
<tr class="memitem:a6b5c26779c71916073e7b8f9debea56d"><td class="memItemLeft" align="right" valign="top">int </td><td class="memItemRight" valign="bottom"><a class="el" href="emulator_8h.html#a6b5c26779c71916073e7b8f9debea56d">execInstruction</a> (char *instruction)</td></tr>
|
||||||
|
<tr class="separator:a6b5c26779c71916073e7b8f9debea56d"><td class="memSeparator" colspan="2"> </td></tr>
|
||||||
|
<tr class="memitem:a2bbc98d3653ad65ad12757dfa7bdfdd4"><td class="memItemLeft" align="right" valign="top">int </td><td class="memItemRight" valign="bottom"><a class="el" href="emulator_8h.html#a2bbc98d3653ad65ad12757dfa7bdfdd4">execProgram</a> ()</td></tr>
|
||||||
|
<tr class="separator:a2bbc98d3653ad65ad12757dfa7bdfdd4"><td class="memSeparator" colspan="2"> </td></tr>
|
||||||
|
<tr class="memitem:a3d30edda62d5695ffaa3b62121d4bf98"><td class="memItemLeft" align="right" valign="top">int </td><td class="memItemRight" valign="bottom"><a class="el" href="emulator_8h.html#a3d30edda62d5695ffaa3b62121d4bf98">loadProgram</a> ()</td></tr>
|
||||||
|
<tr class="separator:a3d30edda62d5695ffaa3b62121d4bf98"><td class="memSeparator" colspan="2"> </td></tr>
|
||||||
|
</table>
|
||||||
|
<a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2>
|
||||||
|
<div class="textblock"><dl class="section author"><dt>Author</dt><dd>Ben Goldsworthy (rumps) <a href="#" onclick="location.href='mai'+'lto:'+'bgo'+'ld'+'swo'+'rt'+'hy9'+'6@'+'gma'+'il'+'.co'+'m'; return false;">bgold<span style="display: none;">.nosp@m.</span>swor<span style="display: none;">.nosp@m.</span>thy96<span style="display: none;">.nosp@m.</span>@gma<span style="display: none;">.nosp@m.</span>il.co<span style="display: none;">.nosp@m.</span>m</a> </dd></dl>
|
||||||
|
<dl class="section version"><dt>Version</dt><dd>1.0</dd></dl>
|
||||||
|
<h1><a class="anchor" id="LICENSE"></a>
|
||||||
|
LICENSE</h1>
|
||||||
|
<p>This file is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.</p>
|
||||||
|
<p>This file is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.</p>
|
||||||
|
<p>You should have received a copy of the GNU General Public License along with this program. If not, see <a href="http://www.gnu.org/licenses/">http://www.gnu.org/licenses/</a>.</p>
|
||||||
|
<h1><a class="anchor" id="DESCRIPTION"></a>
|
||||||
|
DESCRIPTION</h1>
|
||||||
|
<p>Header file for <code><a class="el" href="emulator_8c.html">emulator.c</a></code>. </p>
|
||||||
|
</div><h2 class="groupheader">Function Documentation</h2>
|
||||||
|
<a class="anchor" id="a6b5c26779c71916073e7b8f9debea56d"></a>
|
||||||
|
<div class="memitem">
|
||||||
|
<div class="memproto">
|
||||||
|
<table class="memname">
|
||||||
|
<tr>
|
||||||
|
<td class="memname">int execInstruction </td>
|
||||||
|
<td>(</td>
|
||||||
|
<td class="paramtype">char * </td>
|
||||||
|
<td class="paramname"><em>instruction</em></td><td>)</td>
|
||||||
|
<td></td>
|
||||||
|
</tr>
|
||||||
|
</table>
|
||||||
|
</div><div class="memdoc">
|
||||||
|
<p>Executes an instruction.</p>
|
||||||
|
<p>Tests the validity of an instruction (and whether or not it's a comment), and if the line passes, calls the appropriate function.</p>
|
||||||
|
<dl class="params"><dt>Parameters</dt><dd>
|
||||||
|
<table class="params">
|
||||||
|
<tr><td class="paramname">instruction</td><td>the instruction to test </td></tr>
|
||||||
|
</table>
|
||||||
|
</dd>
|
||||||
|
</dl>
|
||||||
|
<dl class="section return"><dt>Returns</dt><dd>0 on success, -1 on failure </dd></dl>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<a class="anchor" id="a2bbc98d3653ad65ad12757dfa7bdfdd4"></a>
|
||||||
|
<div class="memitem">
|
||||||
|
<div class="memproto">
|
||||||
|
<table class="memname">
|
||||||
|
<tr>
|
||||||
|
<td class="memname">int execProgram </td>
|
||||||
|
<td>(</td>
|
||||||
|
<td class="paramname"></td><td>)</td>
|
||||||
|
<td></td>
|
||||||
|
</tr>
|
||||||
|
</table>
|
||||||
|
</div><div class="memdoc">
|
||||||
|
<p>Executes an the program.</p>
|
||||||
|
<p>Runs <code>execInstruction</code> on each line of the program in turn.</p>
|
||||||
|
<dl class="section return"><dt>Returns</dt><dd>0 on success, -1 on failure </dd></dl>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<a class="anchor" id="ae7178313a4254c62afc060814ebca038"></a>
|
||||||
|
<div class="memitem">
|
||||||
|
<div class="memproto">
|
||||||
|
<table class="memname">
|
||||||
|
<tr>
|
||||||
|
<td class="memname">int getArg2 </td>
|
||||||
|
<td>(</td>
|
||||||
|
<td class="paramtype">char * </td>
|
||||||
|
<td class="paramname"><em>arg2</em></td><td>)</td>
|
||||||
|
<td></td>
|
||||||
|
</tr>
|
||||||
|
</table>
|
||||||
|
</div><div class="memdoc">
|
||||||
|
<p>A function to return the value in the second argument of an instruction.</p>
|
||||||
|
<p>Returns either the value in the indicated register or, as the instruction is parsed as a string, the integer value given. <code><a class="el" href="mystring_8c.html#a70913f883a62585fb8fe025aa1e56749">mystrncmp()</a></code> is used over <code><a class="el" href="mystring_8c.html#a3dab99f21a63ee803be3e9344efda0a0">mystrcmp()</a></code> because there tends to be dodgy C string magic tacked on to the end of the args.</p>
|
||||||
|
<dl class="params"><dt>Parameters</dt><dd>
|
||||||
|
<table class="params">
|
||||||
|
<tr><td class="paramname">arg2</td><td>the value to parse </td></tr>
|
||||||
|
</table>
|
||||||
|
</dd>
|
||||||
|
</dl>
|
||||||
|
<dl class="section return"><dt>Returns</dt><dd>an integer </dd></dl>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<a class="anchor" id="a40c9c476ef53a0c955d3e633b54d2bd2"></a>
|
||||||
|
<div class="memitem">
|
||||||
|
<div class="memproto">
|
||||||
|
<table class="memname">
|
||||||
|
<tr>
|
||||||
|
<td class="memname">bool isValid </td>
|
||||||
|
<td>(</td>
|
||||||
|
<td class="paramtype">char * </td>
|
||||||
|
<td class="paramname"><em>opcode</em>, </td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td class="paramkey"></td>
|
||||||
|
<td></td>
|
||||||
|
<td class="paramtype">char * </td>
|
||||||
|
<td class="paramname"><em>arg1</em>, </td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td class="paramkey"></td>
|
||||||
|
<td></td>
|
||||||
|
<td class="paramtype">char * </td>
|
||||||
|
<td class="paramname"><em>arg2</em> </td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td></td>
|
||||||
|
<td>)</td>
|
||||||
|
<td></td><td></td>
|
||||||
|
</tr>
|
||||||
|
</table>
|
||||||
|
</div><div class="memdoc">
|
||||||
|
<p>Tests if an instruction is valid.</p>
|
||||||
|
<p>Tests that the opcode is valid and that the registers are also.</p>
|
||||||
|
<dl class="params"><dt>Parameters</dt><dd>
|
||||||
|
<table class="params">
|
||||||
|
<tr><td class="paramname">opcode</td><td>the opcode </td></tr>
|
||||||
|
<tr><td class="paramname">arg1</td><td>the first argument </td></tr>
|
||||||
|
<tr><td class="paramname">arg2</td><td>the second argument (not applicable for <code>PRT</code>) </td></tr>
|
||||||
|
</table>
|
||||||
|
</dd>
|
||||||
|
</dl>
|
||||||
|
<dl class="section return"><dt>Returns</dt><dd><code>true</code> if the string is valid, <code>false</code> if it is not </dd></dl>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<a class="anchor" id="a3d30edda62d5695ffaa3b62121d4bf98"></a>
|
||||||
|
<div class="memitem">
|
||||||
|
<div class="memproto">
|
||||||
|
<table class="memname">
|
||||||
|
<tr>
|
||||||
|
<td class="memname">int loadProgram </td>
|
||||||
|
<td>(</td>
|
||||||
|
<td class="paramname"></td><td>)</td>
|
||||||
|
<td></td>
|
||||||
|
</tr>
|
||||||
|
</table>
|
||||||
|
</div><div class="memdoc">
|
||||||
|
<p>Loads a program.</p>
|
||||||
|
<p>Loads the program file and reads each line into an array.</p>
|
||||||
|
<dl class="section return"><dt>Returns</dt><dd>0 on success, -1 on failure </dd></dl>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<a class="anchor" id="a501fe22548fd568d37522ba76ff2c1e7"></a>
|
||||||
|
<div class="memitem">
|
||||||
|
<div class="memproto">
|
||||||
|
<table class="memname">
|
||||||
|
<tr>
|
||||||
|
<td class="memname">int opcodeADD </td>
|
||||||
|
<td>(</td>
|
||||||
|
<td class="paramtype">char * </td>
|
||||||
|
<td class="paramname"><em>opcode</em>, </td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td class="paramkey"></td>
|
||||||
|
<td></td>
|
||||||
|
<td class="paramtype">char * </td>
|
||||||
|
<td class="paramname"><em>arg1</em>, </td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td class="paramkey"></td>
|
||||||
|
<td></td>
|
||||||
|
<td class="paramtype">char * </td>
|
||||||
|
<td class="paramname"><em>arg2</em> </td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td></td>
|
||||||
|
<td>)</td>
|
||||||
|
<td></td><td></td>
|
||||||
|
</tr>
|
||||||
|
</table>
|
||||||
|
</div><div class="memdoc">
|
||||||
|
<p>A function to handle the <code>ADD</code> opcode</p>
|
||||||
|
<p>Performs addition on the values in <code>arg1</code> and <code>arg2</code>, storing the result in <code>arg1</code>.</p>
|
||||||
|
<dl class="params"><dt>Parameters</dt><dd>
|
||||||
|
<table class="params">
|
||||||
|
<tr><td class="paramname">opcode</td><td>the opcode </td></tr>
|
||||||
|
<tr><td class="paramname">arg1</td><td>the first argument </td></tr>
|
||||||
|
<tr><td class="paramname">arg2</td><td>the second argument </td></tr>
|
||||||
|
</table>
|
||||||
|
</dd>
|
||||||
|
</dl>
|
||||||
|
<dl class="section return"><dt>Returns</dt><dd>0 on success </dd></dl>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<a class="anchor" id="a434bd1e8b4e45503586891e565138b84"></a>
|
||||||
|
<div class="memitem">
|
||||||
|
<div class="memproto">
|
||||||
|
<table class="memname">
|
||||||
|
<tr>
|
||||||
|
<td class="memname">int opcodeAND </td>
|
||||||
|
<td>(</td>
|
||||||
|
<td class="paramtype">char * </td>
|
||||||
|
<td class="paramname"><em>opcode</em>, </td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td class="paramkey"></td>
|
||||||
|
<td></td>
|
||||||
|
<td class="paramtype">char * </td>
|
||||||
|
<td class="paramname"><em>arg1</em>, </td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td class="paramkey"></td>
|
||||||
|
<td></td>
|
||||||
|
<td class="paramtype">char * </td>
|
||||||
|
<td class="paramname"><em>arg2</em> </td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td></td>
|
||||||
|
<td>)</td>
|
||||||
|
<td></td><td></td>
|
||||||
|
</tr>
|
||||||
|
</table>
|
||||||
|
</div><div class="memdoc">
|
||||||
|
<p>A function to handle the <code>AND</code> opcode</p>
|
||||||
|
<p>Performs a bitwise AND on the values in <code>arg1</code> and <code>arg2</code>, storing the result in <code>arg1</code>.</p>
|
||||||
|
<dl class="params"><dt>Parameters</dt><dd>
|
||||||
|
<table class="params">
|
||||||
|
<tr><td class="paramname">opcode</td><td>the opcode </td></tr>
|
||||||
|
<tr><td class="paramname">arg1</td><td>the first argument </td></tr>
|
||||||
|
<tr><td class="paramname">arg2</td><td>the second argument </td></tr>
|
||||||
|
</table>
|
||||||
|
</dd>
|
||||||
|
</dl>
|
||||||
|
<dl class="section return"><dt>Returns</dt><dd>0 on success </dd></dl>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<a class="anchor" id="a734105640ec0f0c1e6dc8c5384b2d1d0"></a>
|
||||||
|
<div class="memitem">
|
||||||
|
<div class="memproto">
|
||||||
|
<table class="memname">
|
||||||
|
<tr>
|
||||||
|
<td class="memname">int opcodeJMP </td>
|
||||||
|
<td>(</td>
|
||||||
|
<td class="paramtype">char * </td>
|
||||||
|
<td class="paramname"><em>opcode</em>, </td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td class="paramkey"></td>
|
||||||
|
<td></td>
|
||||||
|
<td class="paramtype">char * </td>
|
||||||
|
<td class="paramname"><em>arg1</em>, </td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td class="paramkey"></td>
|
||||||
|
<td></td>
|
||||||
|
<td class="paramtype">char * </td>
|
||||||
|
<td class="paramname"><em>arg2</em> </td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td></td>
|
||||||
|
<td>)</td>
|
||||||
|
<td></td><td></td>
|
||||||
|
</tr>
|
||||||
|
</table>
|
||||||
|
</div><div class="memdoc">
|
||||||
|
<p>A function to handle the <code>JMP</code> opcode</p>
|
||||||
|
<p>If <code>REGX</code> contains 0, jumps to the line indicated by <code>arg1</code>.</p>
|
||||||
|
<dl class="params"><dt>Parameters</dt><dd>
|
||||||
|
<table class="params">
|
||||||
|
<tr><td class="paramname">opcode</td><td>the opcode </td></tr>
|
||||||
|
<tr><td class="paramname">arg1</td><td>the first argument </td></tr>
|
||||||
|
<tr><td class="paramname">arg2</td><td>the second argument (not applicable for <code>JMP</code>) </td></tr>
|
||||||
|
</table>
|
||||||
|
</dd>
|
||||||
|
</dl>
|
||||||
|
<dl class="section return"><dt>Returns</dt><dd>0 on success </dd></dl>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<a class="anchor" id="a00e5e1b7c08d6368342756805800133b"></a>
|
||||||
|
<div class="memitem">
|
||||||
|
<div class="memproto">
|
||||||
|
<table class="memname">
|
||||||
|
<tr>
|
||||||
|
<td class="memname">int opcodeNOP </td>
|
||||||
|
<td>(</td>
|
||||||
|
<td class="paramtype">char * </td>
|
||||||
|
<td class="paramname"><em>opcode</em>, </td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td class="paramkey"></td>
|
||||||
|
<td></td>
|
||||||
|
<td class="paramtype">char * </td>
|
||||||
|
<td class="paramname"><em>arg1</em>, </td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td class="paramkey"></td>
|
||||||
|
<td></td>
|
||||||
|
<td class="paramtype">char * </td>
|
||||||
|
<td class="paramname"><em>arg2</em> </td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td></td>
|
||||||
|
<td>)</td>
|
||||||
|
<td></td><td></td>
|
||||||
|
</tr>
|
||||||
|
</table>
|
||||||
|
</div><div class="memdoc">
|
||||||
|
<p>A function to handle the <code>NOP</code> opcode</p>
|
||||||
|
<p>Increments the instruction pointer <code>INSP</code>.</p>
|
||||||
|
<dl class="params"><dt>Parameters</dt><dd>
|
||||||
|
<table class="params">
|
||||||
|
<tr><td class="paramname">opcode</td><td>the opcode </td></tr>
|
||||||
|
<tr><td class="paramname">arg1</td><td>the first argument (not applicable for <code>NOP</code>) </td></tr>
|
||||||
|
<tr><td class="paramname">arg2</td><td>the second argument (not applicable for <code>NOP</code>) </td></tr>
|
||||||
|
</table>
|
||||||
|
</dd>
|
||||||
|
</dl>
|
||||||
|
<dl class="section return"><dt>Returns</dt><dd>0 on success </dd></dl>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<a class="anchor" id="a54c12a24203abe192fe4f727ea9ffe60"></a>
|
||||||
|
<div class="memitem">
|
||||||
|
<div class="memproto">
|
||||||
|
<table class="memname">
|
||||||
|
<tr>
|
||||||
|
<td class="memname">int opcodeOR </td>
|
||||||
|
<td>(</td>
|
||||||
|
<td class="paramtype">char * </td>
|
||||||
|
<td class="paramname"><em>opcode</em>, </td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td class="paramkey"></td>
|
||||||
|
<td></td>
|
||||||
|
<td class="paramtype">char * </td>
|
||||||
|
<td class="paramname"><em>arg1</em>, </td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td class="paramkey"></td>
|
||||||
|
<td></td>
|
||||||
|
<td class="paramtype">char * </td>
|
||||||
|
<td class="paramname"><em>arg2</em> </td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td></td>
|
||||||
|
<td>)</td>
|
||||||
|
<td></td><td></td>
|
||||||
|
</tr>
|
||||||
|
</table>
|
||||||
|
</div><div class="memdoc">
|
||||||
|
<p>A function to handle the <code>OR</code> opcode</p>
|
||||||
|
<p>Performs a bitwise OR on the values in <code>arg1</code> and <code>arg2</code>, storing the result in <code>arg1</code>.</p>
|
||||||
|
<dl class="params"><dt>Parameters</dt><dd>
|
||||||
|
<table class="params">
|
||||||
|
<tr><td class="paramname">opcode</td><td>the opcode </td></tr>
|
||||||
|
<tr><td class="paramname">arg1</td><td>the first argument </td></tr>
|
||||||
|
<tr><td class="paramname">arg2</td><td>the second argument </td></tr>
|
||||||
|
</table>
|
||||||
|
</dd>
|
||||||
|
</dl>
|
||||||
|
<dl class="section return"><dt>Returns</dt><dd>0 on success </dd></dl>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<a class="anchor" id="aeb406b3428b5429249ab2c7e3d7bcc3c"></a>
|
||||||
|
<div class="memitem">
|
||||||
|
<div class="memproto">
|
||||||
|
<table class="memname">
|
||||||
|
<tr>
|
||||||
|
<td class="memname">int opcodePRT </td>
|
||||||
|
<td>(</td>
|
||||||
|
<td class="paramtype">char * </td>
|
||||||
|
<td class="paramname"><em>opcode</em>, </td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td class="paramkey"></td>
|
||||||
|
<td></td>
|
||||||
|
<td class="paramtype">char * </td>
|
||||||
|
<td class="paramname"><em>arg1</em>, </td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td class="paramkey"></td>
|
||||||
|
<td></td>
|
||||||
|
<td class="paramtype">char * </td>
|
||||||
|
<td class="paramname"><em>arg2</em> </td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td></td>
|
||||||
|
<td>)</td>
|
||||||
|
<td></td><td></td>
|
||||||
|
</tr>
|
||||||
|
</table>
|
||||||
|
</div><div class="memdoc">
|
||||||
|
<p>A function to handle the <code>PRT</code> opcode</p>
|
||||||
|
<p>Prints the value in the register indicated in <code>arg1</code>, or the integer value specified.</p>
|
||||||
|
<dl class="params"><dt>Parameters</dt><dd>
|
||||||
|
<table class="params">
|
||||||
|
<tr><td class="paramname">opcode</td><td>the opcode </td></tr>
|
||||||
|
<tr><td class="paramname">arg1</td><td>the first argument </td></tr>
|
||||||
|
<tr><td class="paramname">arg2</td><td>the second argument (not applicable for <code>PRT</code>) </td></tr>
|
||||||
|
</table>
|
||||||
|
</dd>
|
||||||
|
</dl>
|
||||||
|
<dl class="section return"><dt>Returns</dt><dd>0 on success </dd></dl>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<a class="anchor" id="a5d6aac425624196dcd0d278760270d00"></a>
|
||||||
|
<div class="memitem">
|
||||||
|
<div class="memproto">
|
||||||
|
<table class="memname">
|
||||||
|
<tr>
|
||||||
|
<td class="memname">int opcodeSET </td>
|
||||||
|
<td>(</td>
|
||||||
|
<td class="paramtype">char * </td>
|
||||||
|
<td class="paramname"><em>opcode</em>, </td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td class="paramkey"></td>
|
||||||
|
<td></td>
|
||||||
|
<td class="paramtype">char * </td>
|
||||||
|
<td class="paramname"><em>arg1</em>, </td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td class="paramkey"></td>
|
||||||
|
<td></td>
|
||||||
|
<td class="paramtype">char * </td>
|
||||||
|
<td class="paramname"><em>arg2</em> </td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td></td>
|
||||||
|
<td>)</td>
|
||||||
|
<td></td><td></td>
|
||||||
|
</tr>
|
||||||
|
</table>
|
||||||
|
</div><div class="memdoc">
|
||||||
|
<p>A function to handle the <code>SET</code> opcode</p>
|
||||||
|
<p>Gets the value of either the register or integer set in <code>arg2</code> and places it in the register indicated by <code>arg1</code>.</p>
|
||||||
|
<dl class="params"><dt>Parameters</dt><dd>
|
||||||
|
<table class="params">
|
||||||
|
<tr><td class="paramname">opcode</td><td>the opcode </td></tr>
|
||||||
|
<tr><td class="paramname">arg1</td><td>the first argument </td></tr>
|
||||||
|
<tr><td class="paramname">arg2</td><td>the second argument </td></tr>
|
||||||
|
</table>
|
||||||
|
</dd>
|
||||||
|
</dl>
|
||||||
|
<dl class="section return"><dt>Returns</dt><dd>0 on success </dd></dl>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<a class="anchor" id="a3cdb2ee632bc1b19d885c26b044d76ae"></a>
|
||||||
|
<div class="memitem">
|
||||||
|
<div class="memproto">
|
||||||
|
<table class="memname">
|
||||||
|
<tr>
|
||||||
|
<td class="memname">int opcodeSHL </td>
|
||||||
|
<td>(</td>
|
||||||
|
<td class="paramtype">char * </td>
|
||||||
|
<td class="paramname"><em>opcode</em>, </td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td class="paramkey"></td>
|
||||||
|
<td></td>
|
||||||
|
<td class="paramtype">char * </td>
|
||||||
|
<td class="paramname"><em>arg1</em>, </td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td class="paramkey"></td>
|
||||||
|
<td></td>
|
||||||
|
<td class="paramtype">char * </td>
|
||||||
|
<td class="paramname"><em>arg2</em> </td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td></td>
|
||||||
|
<td>)</td>
|
||||||
|
<td></td><td></td>
|
||||||
|
</tr>
|
||||||
|
</table>
|
||||||
|
</div><div class="memdoc">
|
||||||
|
<p>A function to handle the <code>SHL</code> opcode</p>
|
||||||
|
<p>Performs a bitwise shift left on the value in <code>arg1</code>, storing the result in <code>arg1</code>. The number of shifts is specified in <code>arg2</code>.</p>
|
||||||
|
<dl class="params"><dt>Parameters</dt><dd>
|
||||||
|
<table class="params">
|
||||||
|
<tr><td class="paramname">opcode</td><td>the opcode </td></tr>
|
||||||
|
<tr><td class="paramname">arg1</td><td>the first argument </td></tr>
|
||||||
|
<tr><td class="paramname">arg2</td><td>the second argument </td></tr>
|
||||||
|
</table>
|
||||||
|
</dd>
|
||||||
|
</dl>
|
||||||
|
<dl class="section return"><dt>Returns</dt><dd>0 on success </dd></dl>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<a class="anchor" id="a6f1fa1ff65a606afddb458fcd64449cf"></a>
|
||||||
|
<div class="memitem">
|
||||||
|
<div class="memproto">
|
||||||
|
<table class="memname">
|
||||||
|
<tr>
|
||||||
|
<td class="memname">int opcodeSHR </td>
|
||||||
|
<td>(</td>
|
||||||
|
<td class="paramtype">char * </td>
|
||||||
|
<td class="paramname"><em>opcode</em>, </td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td class="paramkey"></td>
|
||||||
|
<td></td>
|
||||||
|
<td class="paramtype">char * </td>
|
||||||
|
<td class="paramname"><em>arg1</em>, </td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td class="paramkey"></td>
|
||||||
|
<td></td>
|
||||||
|
<td class="paramtype">char * </td>
|
||||||
|
<td class="paramname"><em>arg2</em> </td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td></td>
|
||||||
|
<td>)</td>
|
||||||
|
<td></td><td></td>
|
||||||
|
</tr>
|
||||||
|
</table>
|
||||||
|
</div><div class="memdoc">
|
||||||
|
<p>A function to handle the <code>SHR</code> opcode</p>
|
||||||
|
<p>Performs a bitwise shift right on the value in <code>arg1</code>, storing the result in <code>arg1</code>. The number of shifts is specified in <code>arg2</code>.</p>
|
||||||
|
<dl class="params"><dt>Parameters</dt><dd>
|
||||||
|
<table class="params">
|
||||||
|
<tr><td class="paramname">opcode</td><td>the opcode </td></tr>
|
||||||
|
<tr><td class="paramname">arg1</td><td>the first argument </td></tr>
|
||||||
|
<tr><td class="paramname">arg2</td><td>the second argument </td></tr>
|
||||||
|
</table>
|
||||||
|
</dd>
|
||||||
|
</dl>
|
||||||
|
<dl class="section return"><dt>Returns</dt><dd>0 on success </dd></dl>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<a class="anchor" id="a3ead6beddb4488ab700a81968e30e11c"></a>
|
||||||
|
<div class="memitem">
|
||||||
|
<div class="memproto">
|
||||||
|
<table class="memname">
|
||||||
|
<tr>
|
||||||
|
<td class="memname">int opcodeSUB </td>
|
||||||
|
<td>(</td>
|
||||||
|
<td class="paramtype">char * </td>
|
||||||
|
<td class="paramname"><em>opcode</em>, </td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td class="paramkey"></td>
|
||||||
|
<td></td>
|
||||||
|
<td class="paramtype">char * </td>
|
||||||
|
<td class="paramname"><em>arg1</em>, </td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td class="paramkey"></td>
|
||||||
|
<td></td>
|
||||||
|
<td class="paramtype">char * </td>
|
||||||
|
<td class="paramname"><em>arg2</em> </td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td></td>
|
||||||
|
<td>)</td>
|
||||||
|
<td></td><td></td>
|
||||||
|
</tr>
|
||||||
|
</table>
|
||||||
|
</div><div class="memdoc">
|
||||||
|
<p>A function to handle the <code>SUB</code> opcode</p>
|
||||||
|
<p>Subtracts the value in <code>arg2</code> from the value in <code>arg1</code>, storing the result in <code>arg1</code>.</p>
|
||||||
|
<dl class="params"><dt>Parameters</dt><dd>
|
||||||
|
<table class="params">
|
||||||
|
<tr><td class="paramname">opcode</td><td>the opcode </td></tr>
|
||||||
|
<tr><td class="paramname">arg1</td><td>the first argument </td></tr>
|
||||||
|
<tr><td class="paramname">arg2</td><td>the second argument </td></tr>
|
||||||
|
</table>
|
||||||
|
</dd>
|
||||||
|
</dl>
|
||||||
|
<dl class="section return"><dt>Returns</dt><dd>0 on success </dd></dl>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div><!-- contents -->
|
||||||
|
<!-- start footer part -->
|
||||||
|
<hr class="footer"/><address class="footer"><small>
|
||||||
|
Generated on Tue May 19 2015 20:34:54 for SCC.150 Assembler Emulator by  <a href="http://www.doxygen.org/index.html">
|
||||||
|
<img class="footer" src="doxygen.png" alt="doxygen"/>
|
||||||
|
</a> 1.8.6
|
||||||
|
</small></address>
|
||||||
|
</body>
|
||||||
|
</html>
|
154
doc/html/emulator_8h_source.html
Executable file
|
@ -0,0 +1,154 @@
|
||||||
|
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
||||||
|
<html xmlns="http://www.w3.org/1999/xhtml">
|
||||||
|
<head>
|
||||||
|
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
|
||||||
|
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
|
||||||
|
<meta name="generator" content="Doxygen 1.8.6"/>
|
||||||
|
<title>SCC.150 Assembler Emulator: /home/rumperuu/Documents/University/University Work/SCC.150 Digital Systems/Coursework/unr-C/SCC.150 Assembler Emulator/source/emulator.h Source File</title>
|
||||||
|
<link href="tabs.css" rel="stylesheet" type="text/css"/>
|
||||||
|
<script type="text/javascript" src="jquery.js"></script>
|
||||||
|
<script type="text/javascript" src="dynsections.js"></script>
|
||||||
|
<link href="search/search.css" rel="stylesheet" type="text/css"/>
|
||||||
|
<script type="text/javascript" src="search/search.js"></script>
|
||||||
|
<script type="text/javascript">
|
||||||
|
$(document).ready(function() { searchBox.OnSelectItem(0); });
|
||||||
|
</script>
|
||||||
|
<link href="doxygen.css" rel="stylesheet" type="text/css" />
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
|
||||||
|
<div id="titlearea">
|
||||||
|
<table cellspacing="0" cellpadding="0">
|
||||||
|
<tbody>
|
||||||
|
<tr style="height: 56px;">
|
||||||
|
<td style="padding-left: 0.5em;">
|
||||||
|
<div id="projectname">SCC.150 Assembler Emulator
|
||||||
|
</div>
|
||||||
|
<div id="projectbrief">A compiler for a simple assembler language</div>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
</tbody>
|
||||||
|
</table>
|
||||||
|
</div>
|
||||||
|
<!-- end header part -->
|
||||||
|
<!-- Generated by Doxygen 1.8.6 -->
|
||||||
|
<script type="text/javascript">
|
||||||
|
var searchBox = new SearchBox("searchBox", "search",false,'Search');
|
||||||
|
</script>
|
||||||
|
<div id="navrow1" class="tabs">
|
||||||
|
<ul class="tablist">
|
||||||
|
<li><a href="index.html"><span>Main Page</span></a></li>
|
||||||
|
<li class="current"><a href="files.html"><span>Files</span></a></li>
|
||||||
|
<li>
|
||||||
|
<div id="MSearchBox" class="MSearchBoxInactive">
|
||||||
|
<span class="left">
|
||||||
|
<img id="MSearchSelect" src="search/mag_sel.png"
|
||||||
|
onmouseover="return searchBox.OnSearchSelectShow()"
|
||||||
|
onmouseout="return searchBox.OnSearchSelectHide()"
|
||||||
|
alt=""/>
|
||||||
|
<input type="text" id="MSearchField" value="Search" accesskey="S"
|
||||||
|
onfocus="searchBox.OnSearchFieldFocus(true)"
|
||||||
|
onblur="searchBox.OnSearchFieldFocus(false)"
|
||||||
|
onkeyup="searchBox.OnSearchFieldChange(event)"/>
|
||||||
|
</span><span class="right">
|
||||||
|
<a id="MSearchClose" href="javascript:searchBox.CloseResultsWindow()"><img id="MSearchCloseImg" border="0" src="search/close.png" alt=""/></a>
|
||||||
|
</span>
|
||||||
|
</div>
|
||||||
|
</li>
|
||||||
|
</ul>
|
||||||
|
</div>
|
||||||
|
<div id="navrow2" class="tabs2">
|
||||||
|
<ul class="tablist">
|
||||||
|
<li><a href="files.html"><span>File List</span></a></li>
|
||||||
|
<li><a href="globals.html"><span>Globals</span></a></li>
|
||||||
|
</ul>
|
||||||
|
</div>
|
||||||
|
<!-- window showing the filter options -->
|
||||||
|
<div id="MSearchSelectWindow"
|
||||||
|
onmouseover="return searchBox.OnSearchSelectShow()"
|
||||||
|
onmouseout="return searchBox.OnSearchSelectHide()"
|
||||||
|
onkeydown="return searchBox.OnSearchSelectKey(event)">
|
||||||
|
<a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(0)"><span class="SelectionMark"> </span>All</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(1)"><span class="SelectionMark"> </span>Files</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(2)"><span class="SelectionMark"> </span>Functions</a></div>
|
||||||
|
|
||||||
|
<!-- iframe showing the search results (closed by default) -->
|
||||||
|
<div id="MSearchResultsWindow">
|
||||||
|
<iframe src="javascript:void(0)" frameborder="0"
|
||||||
|
name="MSearchResults" id="MSearchResults">
|
||||||
|
</iframe>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div id="nav-path" class="navpath">
|
||||||
|
<ul>
|
||||||
|
<li class="navelem"><a class="el" href="dir_b2f33c71d4aa5e7af42a1ca61ff5af1b.html">source</a></li> </ul>
|
||||||
|
</div>
|
||||||
|
</div><!-- top -->
|
||||||
|
<div class="header">
|
||||||
|
<div class="headertitle">
|
||||||
|
<div class="title">emulator.h</div> </div>
|
||||||
|
</div><!--header-->
|
||||||
|
<div class="contents">
|
||||||
|
<a href="emulator_8h.html">Go to the documentation of this file.</a><div class="fragment"><div class="line"><a name="l00001"></a><span class="lineno"> 1</span> <span class="preprocessor">#ifndef EMULATOR_H_</span></div>
|
||||||
|
<div class="line"><a name="l00002"></a><span class="lineno"> 2</span> <span class="preprocessor"></span><span class="preprocessor">#define EMULATOR_H_</span></div>
|
||||||
|
<div class="line"><a name="l00003"></a><span class="lineno"> 3</span> <span class="preprocessor"></span></div>
|
||||||
|
<div class="line"><a name="l00029"></a><span class="lineno"> 29</span> <span class="preprocessor">#include <stdio.h></span> <span class="comment">// used for printf()</span></div>
|
||||||
|
<div class="line"><a name="l00030"></a><span class="lineno"> 30</span> <span class="preprocessor">#include <stdlib.h></span> <span class="comment">// used for atoi()</span></div>
|
||||||
|
<div class="line"><a name="l00031"></a><span class="lineno"> 31</span> <span class="preprocessor">#include <stdbool.h></span> <span class="comment">// used for bool data type</span></div>
|
||||||
|
<div class="line"><a name="l00032"></a><span class="lineno"> 32</span> </div>
|
||||||
|
<div class="line"><a name="l00033"></a><span class="lineno"> 33</span> <span class="preprocessor">#define MAX_PROG_LEN 99 // The maximum length (in lines) a program can have</span></div>
|
||||||
|
<div class="line"><a name="l00034"></a><span class="lineno"> 34</span> <span class="preprocessor"></span><span class="preprocessor">#define MAX_LINE_LEN 80 // The maximum length of a program line (in characters)</span></div>
|
||||||
|
<div class="line"><a name="l00035"></a><span class="lineno"> 35</span> <span class="preprocessor"></span><span class="preprocessor">#define MAX_OPCODE 10 // The maximum number of opcodes that are supported</span></div>
|
||||||
|
<div class="line"><a name="l00036"></a><span class="lineno"> 36</span> <span class="preprocessor"></span><span class="preprocessor">#define MAX_REGISTER 4 // The maximum number of registers (minus INSP)</span></div>
|
||||||
|
<div class="line"><a name="l00037"></a><span class="lineno"> 37</span> <span class="preprocessor"></span><span class="preprocessor">#define OPCODE_LENGTH 3 // The maximum length of an opcode</span></div>
|
||||||
|
<div class="line"><a name="l00038"></a><span class="lineno"> 38</span> <span class="preprocessor"></span><span class="preprocessor">#define ARG_LENGTH 4 // The maximum length of an arg</span></div>
|
||||||
|
<div class="line"><a name="l00039"></a><span class="lineno"> 39</span> <span class="preprocessor"></span><span class="preprocessor">#define OPCODE 0 // Used for parsing instruction segments</span></div>
|
||||||
|
<div class="line"><a name="l00040"></a><span class="lineno"> 40</span> <span class="preprocessor"></span><span class="preprocessor">#define ARG1 1</span></div>
|
||||||
|
<div class="line"><a name="l00041"></a><span class="lineno"> 41</span> <span class="preprocessor"></span><span class="preprocessor">#define ARG2 2</span></div>
|
||||||
|
<div class="line"><a name="l00042"></a><span class="lineno"> 42</span> <span class="preprocessor"></span></div>
|
||||||
|
<div class="line"><a name="l00043"></a><span class="lineno"> 43</span> <span class="comment">// Opcode handling functions</span></div>
|
||||||
|
<div class="line"><a name="l00044"></a><span class="lineno"> 44</span> <span class="keywordtype">int</span> <a class="code" href="emulator_8h.html#a00e5e1b7c08d6368342756805800133b">opcodeNOP</a>(<span class="keywordtype">char</span>* opcode, <span class="keywordtype">char</span>* arg1, <span class="keywordtype">char</span>* arg2);</div>
|
||||||
|
<div class="line"><a name="l00045"></a><span class="lineno"> 45</span> <span class="keywordtype">int</span> <a class="code" href="emulator_8h.html#a5d6aac425624196dcd0d278760270d00">opcodeSET</a>(<span class="keywordtype">char</span>* opcode, <span class="keywordtype">char</span>* arg1, <span class="keywordtype">char</span>* arg2);</div>
|
||||||
|
<div class="line"><a name="l00046"></a><span class="lineno"> 46</span> <span class="keywordtype">int</span> <a class="code" href="emulator_8h.html#a434bd1e8b4e45503586891e565138b84">opcodeAND</a>(<span class="keywordtype">char</span>* opcode, <span class="keywordtype">char</span>* arg1, <span class="keywordtype">char</span>* arg2);</div>
|
||||||
|
<div class="line"><a name="l00047"></a><span class="lineno"> 47</span> <span class="keywordtype">int</span> <a class="code" href="emulator_8h.html#a54c12a24203abe192fe4f727ea9ffe60">opcodeOR</a>(<span class="keywordtype">char</span>* opcode, <span class="keywordtype">char</span>* arg1, <span class="keywordtype">char</span>* arg2);</div>
|
||||||
|
<div class="line"><a name="l00048"></a><span class="lineno"> 48</span> <span class="keywordtype">int</span> <a class="code" href="emulator_8h.html#a501fe22548fd568d37522ba76ff2c1e7">opcodeADD</a>(<span class="keywordtype">char</span>* opcode, <span class="keywordtype">char</span>* arg1, <span class="keywordtype">char</span>* arg2);</div>
|
||||||
|
<div class="line"><a name="l00049"></a><span class="lineno"> 49</span> <span class="keywordtype">int</span> <a class="code" href="emulator_8h.html#a3ead6beddb4488ab700a81968e30e11c">opcodeSUB</a>(<span class="keywordtype">char</span>* opcode, <span class="keywordtype">char</span>* arg1, <span class="keywordtype">char</span>* arg2);</div>
|
||||||
|
<div class="line"><a name="l00050"></a><span class="lineno"> 50</span> <span class="keywordtype">int</span> <a class="code" href="emulator_8h.html#a3cdb2ee632bc1b19d885c26b044d76ae">opcodeSHL</a>(<span class="keywordtype">char</span>* opcode, <span class="keywordtype">char</span>* arg1, <span class="keywordtype">char</span>* arg2);</div>
|
||||||
|
<div class="line"><a name="l00051"></a><span class="lineno"> 51</span> <span class="keywordtype">int</span> <a class="code" href="emulator_8h.html#a6f1fa1ff65a606afddb458fcd64449cf">opcodeSHR</a>(<span class="keywordtype">char</span>* opcode, <span class="keywordtype">char</span>* arg1, <span class="keywordtype">char</span>* arg2);</div>
|
||||||
|
<div class="line"><a name="l00052"></a><span class="lineno"> 52</span> <span class="keywordtype">int</span> <a class="code" href="emulator_8h.html#a734105640ec0f0c1e6dc8c5384b2d1d0">opcodeJMP</a>(<span class="keywordtype">char</span>* opcode, <span class="keywordtype">char</span>* arg1, <span class="keywordtype">char</span>* arg2);</div>
|
||||||
|
<div class="line"><a name="l00053"></a><span class="lineno"> 53</span> <span class="keywordtype">int</span> <a class="code" href="emulator_8h.html#aeb406b3428b5429249ab2c7e3d7bcc3c">opcodePRT</a>(<span class="keywordtype">char</span>* opcode, <span class="keywordtype">char</span>* arg1, <span class="keywordtype">char</span>* arg2);</div>
|
||||||
|
<div class="line"><a name="l00054"></a><span class="lineno"> 54</span> </div>
|
||||||
|
<div class="line"><a name="l00055"></a><span class="lineno"> 55</span> <span class="comment">// Argument extraction function</span></div>
|
||||||
|
<div class="line"><a name="l00056"></a><span class="lineno"> 56</span> <span class="keywordtype">int</span> <a class="code" href="emulator_8h.html#ae7178313a4254c62afc060814ebca038">getArg2</a>(<span class="keywordtype">char</span>* arg2);</div>
|
||||||
|
<div class="line"><a name="l00057"></a><span class="lineno"> 57</span> </div>
|
||||||
|
<div class="line"><a name="l00058"></a><span class="lineno"> 58</span> <span class="comment">// Command validator function</span></div>
|
||||||
|
<div class="line"><a name="l00059"></a><span class="lineno"> 59</span> <span class="keywordtype">bool</span> <a class="code" href="emulator_8h.html#a40c9c476ef53a0c955d3e633b54d2bd2">isValid</a>(<span class="keywordtype">char</span>* opcode, <span class="keywordtype">char</span>* arg1, <span class="keywordtype">char</span>* arg2);</div>
|
||||||
|
<div class="line"><a name="l00060"></a><span class="lineno"> 60</span> </div>
|
||||||
|
<div class="line"><a name="l00061"></a><span class="lineno"> 61</span> <span class="comment">// Emulator run functions</span></div>
|
||||||
|
<div class="line"><a name="l00062"></a><span class="lineno"> 62</span> <span class="keywordtype">int</span> <a class="code" href="emulator_8h.html#a6b5c26779c71916073e7b8f9debea56d">execInstruction</a>(<span class="keywordtype">char</span>* instruction);</div>
|
||||||
|
<div class="line"><a name="l00063"></a><span class="lineno"> 63</span> <span class="keywordtype">int</span> <a class="code" href="emulator_8h.html#a2bbc98d3653ad65ad12757dfa7bdfdd4">execProgram</a>();</div>
|
||||||
|
<div class="line"><a name="l00064"></a><span class="lineno"> 64</span> <span class="keywordtype">int</span> <a class="code" href="emulator_8h.html#a3d30edda62d5695ffaa3b62121d4bf98">loadProgram</a>();</div>
|
||||||
|
<div class="line"><a name="l00065"></a><span class="lineno"> 65</span> </div>
|
||||||
|
<div class="line"><a name="l00066"></a><span class="lineno"> 66</span> <span class="preprocessor">#endif </span><span class="comment">/* EMULATOR_H_ */</span><span class="preprocessor"></span></div>
|
||||||
|
<div class="ttc" id="emulator_8h_html_a54c12a24203abe192fe4f727ea9ffe60"><div class="ttname"><a href="emulator_8h.html#a54c12a24203abe192fe4f727ea9ffe60">opcodeOR</a></div><div class="ttdeci">int opcodeOR(char *opcode, char *arg1, char *arg2)</div><div class="ttdef"><b>Definition:</b> emulator.c:172</div></div>
|
||||||
|
<div class="ttc" id="emulator_8h_html_a3d30edda62d5695ffaa3b62121d4bf98"><div class="ttname"><a href="emulator_8h.html#a3d30edda62d5695ffaa3b62121d4bf98">loadProgram</a></div><div class="ttdeci">int loadProgram()</div><div class="ttdef"><b>Definition:</b> emulator.c:466</div></div>
|
||||||
|
<div class="ttc" id="emulator_8h_html_a5d6aac425624196dcd0d278760270d00"><div class="ttname"><a href="emulator_8h.html#a5d6aac425624196dcd0d278760270d00">opcodeSET</a></div><div class="ttdeci">int opcodeSET(char *opcode, char *arg1, char *arg2)</div><div class="ttdef"><b>Definition:</b> emulator.c:124</div></div>
|
||||||
|
<div class="ttc" id="emulator_8h_html_a6f1fa1ff65a606afddb458fcd64449cf"><div class="ttname"><a href="emulator_8h.html#a6f1fa1ff65a606afddb458fcd64449cf">opcodeSHR</a></div><div class="ttdeci">int opcodeSHR(char *opcode, char *arg1, char *arg2)</div><div class="ttdef"><b>Definition:</b> emulator.c:268</div></div>
|
||||||
|
<div class="ttc" id="emulator_8h_html_a00e5e1b7c08d6368342756805800133b"><div class="ttname"><a href="emulator_8h.html#a00e5e1b7c08d6368342756805800133b">opcodeNOP</a></div><div class="ttdeci">int opcodeNOP(char *opcode, char *arg1, char *arg2)</div><div class="ttdef"><b>Definition:</b> emulator.c:107</div></div>
|
||||||
|
<div class="ttc" id="emulator_8h_html_a6b5c26779c71916073e7b8f9debea56d"><div class="ttname"><a href="emulator_8h.html#a6b5c26779c71916073e7b8f9debea56d">execInstruction</a></div><div class="ttdeci">int execInstruction(char *instruction)</div><div class="ttdef"><b>Definition:</b> emulator.c:388</div></div>
|
||||||
|
<div class="ttc" id="emulator_8h_html_a2bbc98d3653ad65ad12757dfa7bdfdd4"><div class="ttname"><a href="emulator_8h.html#a2bbc98d3653ad65ad12757dfa7bdfdd4">execProgram</a></div><div class="ttdeci">int execProgram()</div><div class="ttdef"><b>Definition:</b> emulator.c:444</div></div>
|
||||||
|
<div class="ttc" id="emulator_8h_html_a3ead6beddb4488ab700a81968e30e11c"><div class="ttname"><a href="emulator_8h.html#a3ead6beddb4488ab700a81968e30e11c">opcodeSUB</a></div><div class="ttdeci">int opcodeSUB(char *opcode, char *arg1, char *arg2)</div><div class="ttdef"><b>Definition:</b> emulator.c:220</div></div>
|
||||||
|
<div class="ttc" id="emulator_8h_html_a501fe22548fd568d37522ba76ff2c1e7"><div class="ttname"><a href="emulator_8h.html#a501fe22548fd568d37522ba76ff2c1e7">opcodeADD</a></div><div class="ttdeci">int opcodeADD(char *opcode, char *arg1, char *arg2)</div><div class="ttdef"><b>Definition:</b> emulator.c:196</div></div>
|
||||||
|
<div class="ttc" id="emulator_8h_html_a434bd1e8b4e45503586891e565138b84"><div class="ttname"><a href="emulator_8h.html#a434bd1e8b4e45503586891e565138b84">opcodeAND</a></div><div class="ttdeci">int opcodeAND(char *opcode, char *arg1, char *arg2)</div><div class="ttdef"><b>Definition:</b> emulator.c:148</div></div>
|
||||||
|
<div class="ttc" id="emulator_8h_html_aeb406b3428b5429249ab2c7e3d7bcc3c"><div class="ttname"><a href="emulator_8h.html#aeb406b3428b5429249ab2c7e3d7bcc3c">opcodePRT</a></div><div class="ttdeci">int opcodePRT(char *opcode, char *arg1, char *arg2)</div><div class="ttdef"><b>Definition:</b> emulator.c:311</div></div>
|
||||||
|
<div class="ttc" id="emulator_8h_html_ae7178313a4254c62afc060814ebca038"><div class="ttname"><a href="emulator_8h.html#ae7178313a4254c62afc060814ebca038">getArg2</a></div><div class="ttdeci">int getArg2(char *arg2)</div><div class="ttdef"><b>Definition:</b> emulator.c:334</div></div>
|
||||||
|
<div class="ttc" id="emulator_8h_html_a3cdb2ee632bc1b19d885c26b044d76ae"><div class="ttname"><a href="emulator_8h.html#a3cdb2ee632bc1b19d885c26b044d76ae">opcodeSHL</a></div><div class="ttdeci">int opcodeSHL(char *opcode, char *arg1, char *arg2)</div><div class="ttdef"><b>Definition:</b> emulator.c:244</div></div>
|
||||||
|
<div class="ttc" id="emulator_8h_html_a40c9c476ef53a0c955d3e633b54d2bd2"><div class="ttname"><a href="emulator_8h.html#a40c9c476ef53a0c955d3e633b54d2bd2">isValid</a></div><div class="ttdeci">bool isValid(char *opcode, char *arg1, char *arg2)</div><div class="ttdef"><b>Definition:</b> emulator.c:352</div></div>
|
||||||
|
<div class="ttc" id="emulator_8h_html_a734105640ec0f0c1e6dc8c5384b2d1d0"><div class="ttname"><a href="emulator_8h.html#a734105640ec0f0c1e6dc8c5384b2d1d0">opcodeJMP</a></div><div class="ttdeci">int opcodeJMP(char *opcode, char *arg1, char *arg2)</div><div class="ttdef"><b>Definition:</b> emulator.c:291</div></div>
|
||||||
|
</div><!-- fragment --></div><!-- contents -->
|
||||||
|
<!-- start footer part -->
|
||||||
|
<hr class="footer"/><address class="footer"><small>
|
||||||
|
Generated on Tue May 19 2015 20:34:54 for SCC.150 Assembler Emulator by  <a href="http://www.doxygen.org/index.html">
|
||||||
|
<img class="footer" src="doxygen.png" alt="doxygen"/>
|
||||||
|
</a> 1.8.6
|
||||||
|
</small></address>
|
||||||
|
</body>
|
||||||
|
</html>
|
103
doc/html/files.html
Executable file
|
@ -0,0 +1,103 @@
|
||||||
|
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
||||||
|
<html xmlns="http://www.w3.org/1999/xhtml">
|
||||||
|
<head>
|
||||||
|
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
|
||||||
|
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
|
||||||
|
<meta name="generator" content="Doxygen 1.8.6"/>
|
||||||
|
<title>SCC.150 Assembler Emulator: File List</title>
|
||||||
|
<link href="tabs.css" rel="stylesheet" type="text/css"/>
|
||||||
|
<script type="text/javascript" src="jquery.js"></script>
|
||||||
|
<script type="text/javascript" src="dynsections.js"></script>
|
||||||
|
<link href="search/search.css" rel="stylesheet" type="text/css"/>
|
||||||
|
<script type="text/javascript" src="search/search.js"></script>
|
||||||
|
<script type="text/javascript">
|
||||||
|
$(document).ready(function() { searchBox.OnSelectItem(0); });
|
||||||
|
</script>
|
||||||
|
<link href="doxygen.css" rel="stylesheet" type="text/css" />
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
|
||||||
|
<div id="titlearea">
|
||||||
|
<table cellspacing="0" cellpadding="0">
|
||||||
|
<tbody>
|
||||||
|
<tr style="height: 56px;">
|
||||||
|
<td style="padding-left: 0.5em;">
|
||||||
|
<div id="projectname">SCC.150 Assembler Emulator
|
||||||
|
</div>
|
||||||
|
<div id="projectbrief">A compiler for a simple assembler language</div>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
</tbody>
|
||||||
|
</table>
|
||||||
|
</div>
|
||||||
|
<!-- end header part -->
|
||||||
|
<!-- Generated by Doxygen 1.8.6 -->
|
||||||
|
<script type="text/javascript">
|
||||||
|
var searchBox = new SearchBox("searchBox", "search",false,'Search');
|
||||||
|
</script>
|
||||||
|
<div id="navrow1" class="tabs">
|
||||||
|
<ul class="tablist">
|
||||||
|
<li><a href="index.html"><span>Main Page</span></a></li>
|
||||||
|
<li class="current"><a href="files.html"><span>Files</span></a></li>
|
||||||
|
<li>
|
||||||
|
<div id="MSearchBox" class="MSearchBoxInactive">
|
||||||
|
<span class="left">
|
||||||
|
<img id="MSearchSelect" src="search/mag_sel.png"
|
||||||
|
onmouseover="return searchBox.OnSearchSelectShow()"
|
||||||
|
onmouseout="return searchBox.OnSearchSelectHide()"
|
||||||
|
alt=""/>
|
||||||
|
<input type="text" id="MSearchField" value="Search" accesskey="S"
|
||||||
|
onfocus="searchBox.OnSearchFieldFocus(true)"
|
||||||
|
onblur="searchBox.OnSearchFieldFocus(false)"
|
||||||
|
onkeyup="searchBox.OnSearchFieldChange(event)"/>
|
||||||
|
</span><span class="right">
|
||||||
|
<a id="MSearchClose" href="javascript:searchBox.CloseResultsWindow()"><img id="MSearchCloseImg" border="0" src="search/close.png" alt=""/></a>
|
||||||
|
</span>
|
||||||
|
</div>
|
||||||
|
</li>
|
||||||
|
</ul>
|
||||||
|
</div>
|
||||||
|
<div id="navrow2" class="tabs2">
|
||||||
|
<ul class="tablist">
|
||||||
|
<li class="current"><a href="files.html"><span>File List</span></a></li>
|
||||||
|
<li><a href="globals.html"><span>Globals</span></a></li>
|
||||||
|
</ul>
|
||||||
|
</div>
|
||||||
|
</div><!-- top -->
|
||||||
|
<!-- window showing the filter options -->
|
||||||
|
<div id="MSearchSelectWindow"
|
||||||
|
onmouseover="return searchBox.OnSearchSelectShow()"
|
||||||
|
onmouseout="return searchBox.OnSearchSelectHide()"
|
||||||
|
onkeydown="return searchBox.OnSearchSelectKey(event)">
|
||||||
|
<a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(0)"><span class="SelectionMark"> </span>All</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(1)"><span class="SelectionMark"> </span>Files</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(2)"><span class="SelectionMark"> </span>Functions</a></div>
|
||||||
|
|
||||||
|
<!-- iframe showing the search results (closed by default) -->
|
||||||
|
<div id="MSearchResultsWindow">
|
||||||
|
<iframe src="javascript:void(0)" frameborder="0"
|
||||||
|
name="MSearchResults" id="MSearchResults">
|
||||||
|
</iframe>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="header">
|
||||||
|
<div class="headertitle">
|
||||||
|
<div class="title">File List</div> </div>
|
||||||
|
</div><!--header-->
|
||||||
|
<div class="contents">
|
||||||
|
<div class="textblock">Here is a list of all documented files with brief descriptions:</div><div class="directory">
|
||||||
|
<div class="levels">[detail level <span onclick="javascript:toggleLevel(1);">1</span><span onclick="javascript:toggleLevel(2);">2</span>]</div><table class="directory">
|
||||||
|
<tr id="row_0_" class="even"><td class="entry"><img id="arr_0_" src="ftv2mlastnode.png" alt="\" width="16" height="22" onclick="toggleFolder('0_')"/><img id="img_0_" src="ftv2folderopen.png" alt="-" width="24" height="22" onclick="toggleFolder('0_')"/><a class="el" href="dir_b2f33c71d4aa5e7af42a1ca61ff5af1b.html" target="_self">source</a></td><td class="desc"></td></tr>
|
||||||
|
<tr id="row_0_0_"><td class="entry"><img src="ftv2blank.png" alt=" " width="16" height="22" /><img src="ftv2node.png" alt="o" width="16" height="22" /><img src="ftv2doc.png" alt="*" width="24" height="22" /><a class="el" href="emulator_8c.html" target="_self">emulator.c</a></td><td class="desc"></td></tr>
|
||||||
|
<tr id="row_0_1_" class="even"><td class="entry"><img src="ftv2blank.png" alt=" " width="16" height="22" /><img src="ftv2node.png" alt="o" width="16" height="22" /><a href="emulator_8h_source.html"><img src="ftv2doc.png" alt="*" width="24" height="22" /></a><a class="el" href="emulator_8h.html" target="_self">emulator.h</a></td><td class="desc"></td></tr>
|
||||||
|
<tr id="row_0_2_"><td class="entry"><img src="ftv2blank.png" alt=" " width="16" height="22" /><img src="ftv2node.png" alt="o" width="16" height="22" /><img src="ftv2doc.png" alt="*" width="24" height="22" /><a class="el" href="mystring_8c.html" target="_self">mystring.c</a></td><td class="desc"></td></tr>
|
||||||
|
<tr id="row_0_3_" class="even"><td class="entry"><img src="ftv2blank.png" alt=" " width="16" height="22" /><img src="ftv2lastnode.png" alt="\" width="16" height="22" /><a href="mystring_8h_source.html"><img src="ftv2doc.png" alt="*" width="24" height="22" /></a><a class="el" href="mystring_8h.html" target="_self">mystring.h</a></td><td class="desc"></td></tr>
|
||||||
|
</table>
|
||||||
|
</div><!-- directory -->
|
||||||
|
</div><!-- contents -->
|
||||||
|
<!-- start footer part -->
|
||||||
|
<hr class="footer"/><address class="footer"><small>
|
||||||
|
Generated on Tue May 19 2015 20:34:54 for SCC.150 Assembler Emulator by  <a href="http://www.doxygen.org/index.html">
|
||||||
|
<img class="footer" src="doxygen.png" alt="doxygen"/>
|
||||||
|
</a> 1.8.6
|
||||||
|
</small></address>
|
||||||
|
</body>
|
||||||
|
</html>
|
BIN
doc/html/ftv2blank.png
Executable file
After (image error) Size: 86 B |
BIN
doc/html/ftv2cl.png
Executable file
After (image error) Size: 453 B |
BIN
doc/html/ftv2doc.png
Executable file
After (image error) Size: 746 B |
BIN
doc/html/ftv2folderclosed.png
Executable file
After (image error) Size: 616 B |
BIN
doc/html/ftv2folderopen.png
Executable file
After (image error) Size: 597 B |
BIN
doc/html/ftv2lastnode.png
Executable file
After (image error) Size: 86 B |
BIN
doc/html/ftv2link.png
Executable file
After (image error) Size: 746 B |
BIN
doc/html/ftv2mlastnode.png
Executable file
After (image error) Size: 246 B |
BIN
doc/html/ftv2mnode.png
Executable file
After (image error) Size: 246 B |
BIN
doc/html/ftv2mo.png
Executable file
After (image error) Size: 403 B |
BIN
doc/html/ftv2node.png
Executable file
After (image error) Size: 86 B |
BIN
doc/html/ftv2ns.png
Executable file
After (image error) Size: 388 B |
BIN
doc/html/ftv2plastnode.png
Executable file
After (image error) Size: 229 B |
BIN
doc/html/ftv2pnode.png
Executable file
After (image error) Size: 229 B |
BIN
doc/html/ftv2splitbar.png
Executable file
After (image error) Size: 314 B |
BIN
doc/html/ftv2vertline.png
Executable file
After (image error) Size: 86 B |
213
doc/html/globals.html
Executable file
|
@ -0,0 +1,213 @@
|
||||||
|
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
||||||
|
<html xmlns="http://www.w3.org/1999/xhtml">
|
||||||
|
<head>
|
||||||
|
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
|
||||||
|
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
|
||||||
|
<meta name="generator" content="Doxygen 1.8.6"/>
|
||||||
|
<title>SCC.150 Assembler Emulator: Globals</title>
|
||||||
|
<link href="tabs.css" rel="stylesheet" type="text/css"/>
|
||||||
|
<script type="text/javascript" src="jquery.js"></script>
|
||||||
|
<script type="text/javascript" src="dynsections.js"></script>
|
||||||
|
<link href="search/search.css" rel="stylesheet" type="text/css"/>
|
||||||
|
<script type="text/javascript" src="search/search.js"></script>
|
||||||
|
<script type="text/javascript">
|
||||||
|
$(document).ready(function() { searchBox.OnSelectItem(0); });
|
||||||
|
</script>
|
||||||
|
<link href="doxygen.css" rel="stylesheet" type="text/css" />
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
|
||||||
|
<div id="titlearea">
|
||||||
|
<table cellspacing="0" cellpadding="0">
|
||||||
|
<tbody>
|
||||||
|
<tr style="height: 56px;">
|
||||||
|
<td style="padding-left: 0.5em;">
|
||||||
|
<div id="projectname">SCC.150 Assembler Emulator
|
||||||
|
</div>
|
||||||
|
<div id="projectbrief">A compiler for a simple assembler language</div>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
</tbody>
|
||||||
|
</table>
|
||||||
|
</div>
|
||||||
|
<!-- end header part -->
|
||||||
|
<!-- Generated by Doxygen 1.8.6 -->
|
||||||
|
<script type="text/javascript">
|
||||||
|
var searchBox = new SearchBox("searchBox", "search",false,'Search');
|
||||||
|
</script>
|
||||||
|
<div id="navrow1" class="tabs">
|
||||||
|
<ul class="tablist">
|
||||||
|
<li><a href="index.html"><span>Main Page</span></a></li>
|
||||||
|
<li class="current"><a href="files.html"><span>Files</span></a></li>
|
||||||
|
<li>
|
||||||
|
<div id="MSearchBox" class="MSearchBoxInactive">
|
||||||
|
<span class="left">
|
||||||
|
<img id="MSearchSelect" src="search/mag_sel.png"
|
||||||
|
onmouseover="return searchBox.OnSearchSelectShow()"
|
||||||
|
onmouseout="return searchBox.OnSearchSelectHide()"
|
||||||
|
alt=""/>
|
||||||
|
<input type="text" id="MSearchField" value="Search" accesskey="S"
|
||||||
|
onfocus="searchBox.OnSearchFieldFocus(true)"
|
||||||
|
onblur="searchBox.OnSearchFieldFocus(false)"
|
||||||
|
onkeyup="searchBox.OnSearchFieldChange(event)"/>
|
||||||
|
</span><span class="right">
|
||||||
|
<a id="MSearchClose" href="javascript:searchBox.CloseResultsWindow()"><img id="MSearchCloseImg" border="0" src="search/close.png" alt=""/></a>
|
||||||
|
</span>
|
||||||
|
</div>
|
||||||
|
</li>
|
||||||
|
</ul>
|
||||||
|
</div>
|
||||||
|
<div id="navrow2" class="tabs2">
|
||||||
|
<ul class="tablist">
|
||||||
|
<li><a href="files.html"><span>File List</span></a></li>
|
||||||
|
<li class="current"><a href="globals.html"><span>Globals</span></a></li>
|
||||||
|
</ul>
|
||||||
|
</div>
|
||||||
|
<div id="navrow3" class="tabs2">
|
||||||
|
<ul class="tablist">
|
||||||
|
<li class="current"><a href="globals.html"><span>All</span></a></li>
|
||||||
|
<li><a href="globals_func.html"><span>Functions</span></a></li>
|
||||||
|
</ul>
|
||||||
|
</div>
|
||||||
|
<div id="navrow4" class="tabs3">
|
||||||
|
<ul class="tablist">
|
||||||
|
<li><a href="#index_e"><span>e</span></a></li>
|
||||||
|
<li><a href="#index_g"><span>g</span></a></li>
|
||||||
|
<li><a href="#index_i"><span>i</span></a></li>
|
||||||
|
<li><a href="#index_l"><span>l</span></a></li>
|
||||||
|
<li><a href="#index_m"><span>m</span></a></li>
|
||||||
|
<li class="current"><a href="#index_o"><span>o</span></a></li>
|
||||||
|
</ul>
|
||||||
|
</div>
|
||||||
|
</div><!-- top -->
|
||||||
|
<!-- window showing the filter options -->
|
||||||
|
<div id="MSearchSelectWindow"
|
||||||
|
onmouseover="return searchBox.OnSearchSelectShow()"
|
||||||
|
onmouseout="return searchBox.OnSearchSelectHide()"
|
||||||
|
onkeydown="return searchBox.OnSearchSelectKey(event)">
|
||||||
|
<a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(0)"><span class="SelectionMark"> </span>All</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(1)"><span class="SelectionMark"> </span>Files</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(2)"><span class="SelectionMark"> </span>Functions</a></div>
|
||||||
|
|
||||||
|
<!-- iframe showing the search results (closed by default) -->
|
||||||
|
<div id="MSearchResultsWindow">
|
||||||
|
<iframe src="javascript:void(0)" frameborder="0"
|
||||||
|
name="MSearchResults" id="MSearchResults">
|
||||||
|
</iframe>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="contents">
|
||||||
|
<div class="textblock">Here is a list of all documented functions, variables, defines, enums, and typedefs with links to the documentation:</div>
|
||||||
|
|
||||||
|
<h3><a class="anchor" id="index_e"></a>- e -</h3><ul>
|
||||||
|
<li>execInstruction()
|
||||||
|
: <a class="el" href="emulator_8c.html#a6b5c26779c71916073e7b8f9debea56d">emulator.c</a>
|
||||||
|
, <a class="el" href="emulator_8h.html#a6b5c26779c71916073e7b8f9debea56d">emulator.h</a>
|
||||||
|
</li>
|
||||||
|
<li>execProgram()
|
||||||
|
: <a class="el" href="emulator_8c.html#a2bbc98d3653ad65ad12757dfa7bdfdd4">emulator.c</a>
|
||||||
|
, <a class="el" href="emulator_8h.html#a2bbc98d3653ad65ad12757dfa7bdfdd4">emulator.h</a>
|
||||||
|
</li>
|
||||||
|
</ul>
|
||||||
|
|
||||||
|
|
||||||
|
<h3><a class="anchor" id="index_g"></a>- g -</h3><ul>
|
||||||
|
<li>getArg2()
|
||||||
|
: <a class="el" href="emulator_8c.html#ae7178313a4254c62afc060814ebca038">emulator.c</a>
|
||||||
|
, <a class="el" href="emulator_8h.html#ae7178313a4254c62afc060814ebca038">emulator.h</a>
|
||||||
|
</li>
|
||||||
|
</ul>
|
||||||
|
|
||||||
|
|
||||||
|
<h3><a class="anchor" id="index_i"></a>- i -</h3><ul>
|
||||||
|
<li>isValid()
|
||||||
|
: <a class="el" href="emulator_8c.html#a40c9c476ef53a0c955d3e633b54d2bd2">emulator.c</a>
|
||||||
|
, <a class="el" href="emulator_8h.html#a40c9c476ef53a0c955d3e633b54d2bd2">emulator.h</a>
|
||||||
|
</li>
|
||||||
|
</ul>
|
||||||
|
|
||||||
|
|
||||||
|
<h3><a class="anchor" id="index_l"></a>- l -</h3><ul>
|
||||||
|
<li>loadProgram()
|
||||||
|
: <a class="el" href="emulator_8c.html#a3d30edda62d5695ffaa3b62121d4bf98">emulator.c</a>
|
||||||
|
, <a class="el" href="emulator_8h.html#a3d30edda62d5695ffaa3b62121d4bf98">emulator.h</a>
|
||||||
|
</li>
|
||||||
|
</ul>
|
||||||
|
|
||||||
|
|
||||||
|
<h3><a class="anchor" id="index_m"></a>- m -</h3><ul>
|
||||||
|
<li>main()
|
||||||
|
: <a class="el" href="emulator_8c.html#ae66f6b31b5ad750f1fe042a706a4e3d4">emulator.c</a>
|
||||||
|
</li>
|
||||||
|
<li>mystrchr()
|
||||||
|
: <a class="el" href="mystring_8c.html#a1a18457ecefaaafb354de326065b86f9">mystring.c</a>
|
||||||
|
, <a class="el" href="mystring_8h.html#a1a18457ecefaaafb354de326065b86f9">mystring.h</a>
|
||||||
|
</li>
|
||||||
|
<li>mystrcmp()
|
||||||
|
: <a class="el" href="mystring_8c.html#a3dab99f21a63ee803be3e9344efda0a0">mystring.c</a>
|
||||||
|
, <a class="el" href="mystring_8h.html#a3dab99f21a63ee803be3e9344efda0a0">mystring.h</a>
|
||||||
|
</li>
|
||||||
|
<li>mystrlen()
|
||||||
|
: <a class="el" href="mystring_8c.html#aa231246d7f6f97231aa18689cc2ea20a">mystring.c</a>
|
||||||
|
, <a class="el" href="mystring_8h.html#aa231246d7f6f97231aa18689cc2ea20a">mystring.h</a>
|
||||||
|
</li>
|
||||||
|
<li>mystrncmp()
|
||||||
|
: <a class="el" href="mystring_8c.html#a70913f883a62585fb8fe025aa1e56749">mystring.c</a>
|
||||||
|
, <a class="el" href="mystring_8h.html#a70913f883a62585fb8fe025aa1e56749">mystring.h</a>
|
||||||
|
</li>
|
||||||
|
<li>mystrstr()
|
||||||
|
: <a class="el" href="mystring_8c.html#ac650f6f569951713296a17edd496f7a5">mystring.c</a>
|
||||||
|
, <a class="el" href="mystring_8h.html#ac650f6f569951713296a17edd496f7a5">mystring.h</a>
|
||||||
|
</li>
|
||||||
|
</ul>
|
||||||
|
|
||||||
|
|
||||||
|
<h3><a class="anchor" id="index_o"></a>- o -</h3><ul>
|
||||||
|
<li>opcodeADD()
|
||||||
|
: <a class="el" href="emulator_8c.html#a501fe22548fd568d37522ba76ff2c1e7">emulator.c</a>
|
||||||
|
, <a class="el" href="emulator_8h.html#a501fe22548fd568d37522ba76ff2c1e7">emulator.h</a>
|
||||||
|
</li>
|
||||||
|
<li>opcodeAND()
|
||||||
|
: <a class="el" href="emulator_8c.html#a434bd1e8b4e45503586891e565138b84">emulator.c</a>
|
||||||
|
, <a class="el" href="emulator_8h.html#a434bd1e8b4e45503586891e565138b84">emulator.h</a>
|
||||||
|
</li>
|
||||||
|
<li>opcodeJMP()
|
||||||
|
: <a class="el" href="emulator_8c.html#a734105640ec0f0c1e6dc8c5384b2d1d0">emulator.c</a>
|
||||||
|
, <a class="el" href="emulator_8h.html#a734105640ec0f0c1e6dc8c5384b2d1d0">emulator.h</a>
|
||||||
|
</li>
|
||||||
|
<li>opcodeNOP()
|
||||||
|
: <a class="el" href="emulator_8c.html#a00e5e1b7c08d6368342756805800133b">emulator.c</a>
|
||||||
|
, <a class="el" href="emulator_8h.html#a00e5e1b7c08d6368342756805800133b">emulator.h</a>
|
||||||
|
</li>
|
||||||
|
<li>opcodeOR()
|
||||||
|
: <a class="el" href="emulator_8c.html#a54c12a24203abe192fe4f727ea9ffe60">emulator.c</a>
|
||||||
|
, <a class="el" href="emulator_8h.html#a54c12a24203abe192fe4f727ea9ffe60">emulator.h</a>
|
||||||
|
</li>
|
||||||
|
<li>opcodePRT()
|
||||||
|
: <a class="el" href="emulator_8c.html#aeb406b3428b5429249ab2c7e3d7bcc3c">emulator.c</a>
|
||||||
|
, <a class="el" href="emulator_8h.html#aeb406b3428b5429249ab2c7e3d7bcc3c">emulator.h</a>
|
||||||
|
</li>
|
||||||
|
<li>opcodeSET()
|
||||||
|
: <a class="el" href="emulator_8c.html#a5d6aac425624196dcd0d278760270d00">emulator.c</a>
|
||||||
|
, <a class="el" href="emulator_8h.html#a5d6aac425624196dcd0d278760270d00">emulator.h</a>
|
||||||
|
</li>
|
||||||
|
<li>opcodeSHL()
|
||||||
|
: <a class="el" href="emulator_8c.html#a3cdb2ee632bc1b19d885c26b044d76ae">emulator.c</a>
|
||||||
|
, <a class="el" href="emulator_8h.html#a3cdb2ee632bc1b19d885c26b044d76ae">emulator.h</a>
|
||||||
|
</li>
|
||||||
|
<li>opcodeSHR()
|
||||||
|
: <a class="el" href="emulator_8c.html#a6f1fa1ff65a606afddb458fcd64449cf">emulator.c</a>
|
||||||
|
, <a class="el" href="emulator_8h.html#a6f1fa1ff65a606afddb458fcd64449cf">emulator.h</a>
|
||||||
|
</li>
|
||||||
|
<li>opcodeSUB()
|
||||||
|
: <a class="el" href="emulator_8c.html#a3ead6beddb4488ab700a81968e30e11c">emulator.c</a>
|
||||||
|
, <a class="el" href="emulator_8h.html#a3ead6beddb4488ab700a81968e30e11c">emulator.h</a>
|
||||||
|
</li>
|
||||||
|
</ul>
|
||||||
|
</div><!-- contents -->
|
||||||
|
<!-- start footer part -->
|
||||||
|
<hr class="footer"/><address class="footer"><small>
|
||||||
|
Generated on Tue May 19 2015 20:34:54 for SCC.150 Assembler Emulator by  <a href="http://www.doxygen.org/index.html">
|
||||||
|
<img class="footer" src="doxygen.png" alt="doxygen"/>
|
||||||
|
</a> 1.8.6
|
||||||
|
</small></address>
|
||||||
|
</body>
|
||||||
|
</html>
|
213
doc/html/globals_func.html
Executable file
|
@ -0,0 +1,213 @@
|
||||||
|
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
||||||
|
<html xmlns="http://www.w3.org/1999/xhtml">
|
||||||
|
<head>
|
||||||
|
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
|
||||||
|
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
|
||||||
|
<meta name="generator" content="Doxygen 1.8.6"/>
|
||||||
|
<title>SCC.150 Assembler Emulator: Globals</title>
|
||||||
|
<link href="tabs.css" rel="stylesheet" type="text/css"/>
|
||||||
|
<script type="text/javascript" src="jquery.js"></script>
|
||||||
|
<script type="text/javascript" src="dynsections.js"></script>
|
||||||
|
<link href="search/search.css" rel="stylesheet" type="text/css"/>
|
||||||
|
<script type="text/javascript" src="search/search.js"></script>
|
||||||
|
<script type="text/javascript">
|
||||||
|
$(document).ready(function() { searchBox.OnSelectItem(0); });
|
||||||
|
</script>
|
||||||
|
<link href="doxygen.css" rel="stylesheet" type="text/css" />
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
|
||||||
|
<div id="titlearea">
|
||||||
|
<table cellspacing="0" cellpadding="0">
|
||||||
|
<tbody>
|
||||||
|
<tr style="height: 56px;">
|
||||||
|
<td style="padding-left: 0.5em;">
|
||||||
|
<div id="projectname">SCC.150 Assembler Emulator
|
||||||
|
</div>
|
||||||
|
<div id="projectbrief">A compiler for a simple assembler language</div>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
</tbody>
|
||||||
|
</table>
|
||||||
|
</div>
|
||||||
|
<!-- end header part -->
|
||||||
|
<!-- Generated by Doxygen 1.8.6 -->
|
||||||
|
<script type="text/javascript">
|
||||||
|
var searchBox = new SearchBox("searchBox", "search",false,'Search');
|
||||||
|
</script>
|
||||||
|
<div id="navrow1" class="tabs">
|
||||||
|
<ul class="tablist">
|
||||||
|
<li><a href="index.html"><span>Main Page</span></a></li>
|
||||||
|
<li class="current"><a href="files.html"><span>Files</span></a></li>
|
||||||
|
<li>
|
||||||
|
<div id="MSearchBox" class="MSearchBoxInactive">
|
||||||
|
<span class="left">
|
||||||
|
<img id="MSearchSelect" src="search/mag_sel.png"
|
||||||
|
onmouseover="return searchBox.OnSearchSelectShow()"
|
||||||
|
onmouseout="return searchBox.OnSearchSelectHide()"
|
||||||
|
alt=""/>
|
||||||
|
<input type="text" id="MSearchField" value="Search" accesskey="S"
|
||||||
|
onfocus="searchBox.OnSearchFieldFocus(true)"
|
||||||
|
onblur="searchBox.OnSearchFieldFocus(false)"
|
||||||
|
onkeyup="searchBox.OnSearchFieldChange(event)"/>
|
||||||
|
</span><span class="right">
|
||||||
|
<a id="MSearchClose" href="javascript:searchBox.CloseResultsWindow()"><img id="MSearchCloseImg" border="0" src="search/close.png" alt=""/></a>
|
||||||
|
</span>
|
||||||
|
</div>
|
||||||
|
</li>
|
||||||
|
</ul>
|
||||||
|
</div>
|
||||||
|
<div id="navrow2" class="tabs2">
|
||||||
|
<ul class="tablist">
|
||||||
|
<li><a href="files.html"><span>File List</span></a></li>
|
||||||
|
<li class="current"><a href="globals.html"><span>Globals</span></a></li>
|
||||||
|
</ul>
|
||||||
|
</div>
|
||||||
|
<div id="navrow3" class="tabs2">
|
||||||
|
<ul class="tablist">
|
||||||
|
<li><a href="globals.html"><span>All</span></a></li>
|
||||||
|
<li class="current"><a href="globals_func.html"><span>Functions</span></a></li>
|
||||||
|
</ul>
|
||||||
|
</div>
|
||||||
|
<div id="navrow4" class="tabs3">
|
||||||
|
<ul class="tablist">
|
||||||
|
<li><a href="#index_e"><span>e</span></a></li>
|
||||||
|
<li><a href="#index_g"><span>g</span></a></li>
|
||||||
|
<li><a href="#index_i"><span>i</span></a></li>
|
||||||
|
<li><a href="#index_l"><span>l</span></a></li>
|
||||||
|
<li><a href="#index_m"><span>m</span></a></li>
|
||||||
|
<li class="current"><a href="#index_o"><span>o</span></a></li>
|
||||||
|
</ul>
|
||||||
|
</div>
|
||||||
|
</div><!-- top -->
|
||||||
|
<!-- window showing the filter options -->
|
||||||
|
<div id="MSearchSelectWindow"
|
||||||
|
onmouseover="return searchBox.OnSearchSelectShow()"
|
||||||
|
onmouseout="return searchBox.OnSearchSelectHide()"
|
||||||
|
onkeydown="return searchBox.OnSearchSelectKey(event)">
|
||||||
|
<a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(0)"><span class="SelectionMark"> </span>All</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(1)"><span class="SelectionMark"> </span>Files</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(2)"><span class="SelectionMark"> </span>Functions</a></div>
|
||||||
|
|
||||||
|
<!-- iframe showing the search results (closed by default) -->
|
||||||
|
<div id="MSearchResultsWindow">
|
||||||
|
<iframe src="javascript:void(0)" frameborder="0"
|
||||||
|
name="MSearchResults" id="MSearchResults">
|
||||||
|
</iframe>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="contents">
|
||||||
|
 
|
||||||
|
|
||||||
|
<h3><a class="anchor" id="index_e"></a>- e -</h3><ul>
|
||||||
|
<li>execInstruction()
|
||||||
|
: <a class="el" href="emulator_8c.html#a6b5c26779c71916073e7b8f9debea56d">emulator.c</a>
|
||||||
|
, <a class="el" href="emulator_8h.html#a6b5c26779c71916073e7b8f9debea56d">emulator.h</a>
|
||||||
|
</li>
|
||||||
|
<li>execProgram()
|
||||||
|
: <a class="el" href="emulator_8c.html#a2bbc98d3653ad65ad12757dfa7bdfdd4">emulator.c</a>
|
||||||
|
, <a class="el" href="emulator_8h.html#a2bbc98d3653ad65ad12757dfa7bdfdd4">emulator.h</a>
|
||||||
|
</li>
|
||||||
|
</ul>
|
||||||
|
|
||||||
|
|
||||||
|
<h3><a class="anchor" id="index_g"></a>- g -</h3><ul>
|
||||||
|
<li>getArg2()
|
||||||
|
: <a class="el" href="emulator_8c.html#ae7178313a4254c62afc060814ebca038">emulator.c</a>
|
||||||
|
, <a class="el" href="emulator_8h.html#ae7178313a4254c62afc060814ebca038">emulator.h</a>
|
||||||
|
</li>
|
||||||
|
</ul>
|
||||||
|
|
||||||
|
|
||||||
|
<h3><a class="anchor" id="index_i"></a>- i -</h3><ul>
|
||||||
|
<li>isValid()
|
||||||
|
: <a class="el" href="emulator_8c.html#a40c9c476ef53a0c955d3e633b54d2bd2">emulator.c</a>
|
||||||
|
, <a class="el" href="emulator_8h.html#a40c9c476ef53a0c955d3e633b54d2bd2">emulator.h</a>
|
||||||
|
</li>
|
||||||
|
</ul>
|
||||||
|
|
||||||
|
|
||||||
|
<h3><a class="anchor" id="index_l"></a>- l -</h3><ul>
|
||||||
|
<li>loadProgram()
|
||||||
|
: <a class="el" href="emulator_8c.html#a3d30edda62d5695ffaa3b62121d4bf98">emulator.c</a>
|
||||||
|
, <a class="el" href="emulator_8h.html#a3d30edda62d5695ffaa3b62121d4bf98">emulator.h</a>
|
||||||
|
</li>
|
||||||
|
</ul>
|
||||||
|
|
||||||
|
|
||||||
|
<h3><a class="anchor" id="index_m"></a>- m -</h3><ul>
|
||||||
|
<li>main()
|
||||||
|
: <a class="el" href="emulator_8c.html#ae66f6b31b5ad750f1fe042a706a4e3d4">emulator.c</a>
|
||||||
|
</li>
|
||||||
|
<li>mystrchr()
|
||||||
|
: <a class="el" href="mystring_8c.html#a1a18457ecefaaafb354de326065b86f9">mystring.c</a>
|
||||||
|
, <a class="el" href="mystring_8h.html#a1a18457ecefaaafb354de326065b86f9">mystring.h</a>
|
||||||
|
</li>
|
||||||
|
<li>mystrcmp()
|
||||||
|
: <a class="el" href="mystring_8c.html#a3dab99f21a63ee803be3e9344efda0a0">mystring.c</a>
|
||||||
|
, <a class="el" href="mystring_8h.html#a3dab99f21a63ee803be3e9344efda0a0">mystring.h</a>
|
||||||
|
</li>
|
||||||
|
<li>mystrlen()
|
||||||
|
: <a class="el" href="mystring_8c.html#aa231246d7f6f97231aa18689cc2ea20a">mystring.c</a>
|
||||||
|
, <a class="el" href="mystring_8h.html#aa231246d7f6f97231aa18689cc2ea20a">mystring.h</a>
|
||||||
|
</li>
|
||||||
|
<li>mystrncmp()
|
||||||
|
: <a class="el" href="mystring_8c.html#a70913f883a62585fb8fe025aa1e56749">mystring.c</a>
|
||||||
|
, <a class="el" href="mystring_8h.html#a70913f883a62585fb8fe025aa1e56749">mystring.h</a>
|
||||||
|
</li>
|
||||||
|
<li>mystrstr()
|
||||||
|
: <a class="el" href="mystring_8c.html#ac650f6f569951713296a17edd496f7a5">mystring.c</a>
|
||||||
|
, <a class="el" href="mystring_8h.html#ac650f6f569951713296a17edd496f7a5">mystring.h</a>
|
||||||
|
</li>
|
||||||
|
</ul>
|
||||||
|
|
||||||
|
|
||||||
|
<h3><a class="anchor" id="index_o"></a>- o -</h3><ul>
|
||||||
|
<li>opcodeADD()
|
||||||
|
: <a class="el" href="emulator_8c.html#a501fe22548fd568d37522ba76ff2c1e7">emulator.c</a>
|
||||||
|
, <a class="el" href="emulator_8h.html#a501fe22548fd568d37522ba76ff2c1e7">emulator.h</a>
|
||||||
|
</li>
|
||||||
|
<li>opcodeAND()
|
||||||
|
: <a class="el" href="emulator_8c.html#a434bd1e8b4e45503586891e565138b84">emulator.c</a>
|
||||||
|
, <a class="el" href="emulator_8h.html#a434bd1e8b4e45503586891e565138b84">emulator.h</a>
|
||||||
|
</li>
|
||||||
|
<li>opcodeJMP()
|
||||||
|
: <a class="el" href="emulator_8c.html#a734105640ec0f0c1e6dc8c5384b2d1d0">emulator.c</a>
|
||||||
|
, <a class="el" href="emulator_8h.html#a734105640ec0f0c1e6dc8c5384b2d1d0">emulator.h</a>
|
||||||
|
</li>
|
||||||
|
<li>opcodeNOP()
|
||||||
|
: <a class="el" href="emulator_8c.html#a00e5e1b7c08d6368342756805800133b">emulator.c</a>
|
||||||
|
, <a class="el" href="emulator_8h.html#a00e5e1b7c08d6368342756805800133b">emulator.h</a>
|
||||||
|
</li>
|
||||||
|
<li>opcodeOR()
|
||||||
|
: <a class="el" href="emulator_8c.html#a54c12a24203abe192fe4f727ea9ffe60">emulator.c</a>
|
||||||
|
, <a class="el" href="emulator_8h.html#a54c12a24203abe192fe4f727ea9ffe60">emulator.h</a>
|
||||||
|
</li>
|
||||||
|
<li>opcodePRT()
|
||||||
|
: <a class="el" href="emulator_8c.html#aeb406b3428b5429249ab2c7e3d7bcc3c">emulator.c</a>
|
||||||
|
, <a class="el" href="emulator_8h.html#aeb406b3428b5429249ab2c7e3d7bcc3c">emulator.h</a>
|
||||||
|
</li>
|
||||||
|
<li>opcodeSET()
|
||||||
|
: <a class="el" href="emulator_8c.html#a5d6aac425624196dcd0d278760270d00">emulator.c</a>
|
||||||
|
, <a class="el" href="emulator_8h.html#a5d6aac425624196dcd0d278760270d00">emulator.h</a>
|
||||||
|
</li>
|
||||||
|
<li>opcodeSHL()
|
||||||
|
: <a class="el" href="emulator_8c.html#a3cdb2ee632bc1b19d885c26b044d76ae">emulator.c</a>
|
||||||
|
, <a class="el" href="emulator_8h.html#a3cdb2ee632bc1b19d885c26b044d76ae">emulator.h</a>
|
||||||
|
</li>
|
||||||
|
<li>opcodeSHR()
|
||||||
|
: <a class="el" href="emulator_8c.html#a6f1fa1ff65a606afddb458fcd64449cf">emulator.c</a>
|
||||||
|
, <a class="el" href="emulator_8h.html#a6f1fa1ff65a606afddb458fcd64449cf">emulator.h</a>
|
||||||
|
</li>
|
||||||
|
<li>opcodeSUB()
|
||||||
|
: <a class="el" href="emulator_8c.html#a3ead6beddb4488ab700a81968e30e11c">emulator.c</a>
|
||||||
|
, <a class="el" href="emulator_8h.html#a3ead6beddb4488ab700a81968e30e11c">emulator.h</a>
|
||||||
|
</li>
|
||||||
|
</ul>
|
||||||
|
</div><!-- contents -->
|
||||||
|
<!-- start footer part -->
|
||||||
|
<hr class="footer"/><address class="footer"><small>
|
||||||
|
Generated on Tue May 19 2015 20:34:54 for SCC.150 Assembler Emulator by  <a href="http://www.doxygen.org/index.html">
|
||||||
|
<img class="footer" src="doxygen.png" alt="doxygen"/>
|
||||||
|
</a> 1.8.6
|
||||||
|
</small></address>
|
||||||
|
</body>
|
||||||
|
</html>
|
88
doc/html/index.html
Executable file
|
@ -0,0 +1,88 @@
|
||||||
|
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
||||||
|
<html xmlns="http://www.w3.org/1999/xhtml">
|
||||||
|
<head>
|
||||||
|
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
|
||||||
|
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
|
||||||
|
<meta name="generator" content="Doxygen 1.8.6"/>
|
||||||
|
<title>SCC.150 Assembler Emulator: Main Page</title>
|
||||||
|
<link href="tabs.css" rel="stylesheet" type="text/css"/>
|
||||||
|
<script type="text/javascript" src="jquery.js"></script>
|
||||||
|
<script type="text/javascript" src="dynsections.js"></script>
|
||||||
|
<link href="search/search.css" rel="stylesheet" type="text/css"/>
|
||||||
|
<script type="text/javascript" src="search/search.js"></script>
|
||||||
|
<script type="text/javascript">
|
||||||
|
$(document).ready(function() { searchBox.OnSelectItem(0); });
|
||||||
|
</script>
|
||||||
|
<link href="doxygen.css" rel="stylesheet" type="text/css" />
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
|
||||||
|
<div id="titlearea">
|
||||||
|
<table cellspacing="0" cellpadding="0">
|
||||||
|
<tbody>
|
||||||
|
<tr style="height: 56px;">
|
||||||
|
<td style="padding-left: 0.5em;">
|
||||||
|
<div id="projectname">SCC.150 Assembler Emulator
|
||||||
|
</div>
|
||||||
|
<div id="projectbrief">A compiler for a simple assembler language</div>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
</tbody>
|
||||||
|
</table>
|
||||||
|
</div>
|
||||||
|
<!-- end header part -->
|
||||||
|
<!-- Generated by Doxygen 1.8.6 -->
|
||||||
|
<script type="text/javascript">
|
||||||
|
var searchBox = new SearchBox("searchBox", "search",false,'Search');
|
||||||
|
</script>
|
||||||
|
<div id="navrow1" class="tabs">
|
||||||
|
<ul class="tablist">
|
||||||
|
<li class="current"><a href="index.html"><span>Main Page</span></a></li>
|
||||||
|
<li><a href="files.html"><span>Files</span></a></li>
|
||||||
|
<li>
|
||||||
|
<div id="MSearchBox" class="MSearchBoxInactive">
|
||||||
|
<span class="left">
|
||||||
|
<img id="MSearchSelect" src="search/mag_sel.png"
|
||||||
|
onmouseover="return searchBox.OnSearchSelectShow()"
|
||||||
|
onmouseout="return searchBox.OnSearchSelectHide()"
|
||||||
|
alt=""/>
|
||||||
|
<input type="text" id="MSearchField" value="Search" accesskey="S"
|
||||||
|
onfocus="searchBox.OnSearchFieldFocus(true)"
|
||||||
|
onblur="searchBox.OnSearchFieldFocus(false)"
|
||||||
|
onkeyup="searchBox.OnSearchFieldChange(event)"/>
|
||||||
|
</span><span class="right">
|
||||||
|
<a id="MSearchClose" href="javascript:searchBox.CloseResultsWindow()"><img id="MSearchCloseImg" border="0" src="search/close.png" alt=""/></a>
|
||||||
|
</span>
|
||||||
|
</div>
|
||||||
|
</li>
|
||||||
|
</ul>
|
||||||
|
</div>
|
||||||
|
</div><!-- top -->
|
||||||
|
<!-- window showing the filter options -->
|
||||||
|
<div id="MSearchSelectWindow"
|
||||||
|
onmouseover="return searchBox.OnSearchSelectShow()"
|
||||||
|
onmouseout="return searchBox.OnSearchSelectHide()"
|
||||||
|
onkeydown="return searchBox.OnSearchSelectKey(event)">
|
||||||
|
<a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(0)"><span class="SelectionMark"> </span>All</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(1)"><span class="SelectionMark"> </span>Files</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(2)"><span class="SelectionMark"> </span>Functions</a></div>
|
||||||
|
|
||||||
|
<!-- iframe showing the search results (closed by default) -->
|
||||||
|
<div id="MSearchResultsWindow">
|
||||||
|
<iframe src="javascript:void(0)" frameborder="0"
|
||||||
|
name="MSearchResults" id="MSearchResults">
|
||||||
|
</iframe>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="header">
|
||||||
|
<div class="headertitle">
|
||||||
|
<div class="title">SCC.150 Assembler Emulator Documentation</div> </div>
|
||||||
|
</div><!--header-->
|
||||||
|
<div class="contents">
|
||||||
|
</div><!-- contents -->
|
||||||
|
<!-- start footer part -->
|
||||||
|
<hr class="footer"/><address class="footer"><small>
|
||||||
|
Generated on Tue May 19 2015 20:34:54 for SCC.150 Assembler Emulator by  <a href="http://www.doxygen.org/index.html">
|
||||||
|
<img class="footer" src="doxygen.png" alt="doxygen"/>
|
||||||
|
</a> 1.8.6
|
||||||
|
</small></address>
|
||||||
|
</body>
|
||||||
|
</html>
|
31
doc/html/jquery.js
vendored
Executable file
305
doc/html/mystring_8c.html
Executable file
|
@ -0,0 +1,305 @@
|
||||||
|
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
||||||
|
<html xmlns="http://www.w3.org/1999/xhtml">
|
||||||
|
<head>
|
||||||
|
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
|
||||||
|
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
|
||||||
|
<meta name="generator" content="Doxygen 1.8.6"/>
|
||||||
|
<title>SCC.150 Assembler Emulator: /home/rumperuu/Documents/University/University Work/SCC.150 Digital Systems/Coursework/unr-C/SCC.150 Assembler Emulator/source/mystring.c File Reference</title>
|
||||||
|
<link href="tabs.css" rel="stylesheet" type="text/css"/>
|
||||||
|
<script type="text/javascript" src="jquery.js"></script>
|
||||||
|
<script type="text/javascript" src="dynsections.js"></script>
|
||||||
|
<link href="search/search.css" rel="stylesheet" type="text/css"/>
|
||||||
|
<script type="text/javascript" src="search/search.js"></script>
|
||||||
|
<script type="text/javascript">
|
||||||
|
$(document).ready(function() { searchBox.OnSelectItem(0); });
|
||||||
|
</script>
|
||||||
|
<link href="doxygen.css" rel="stylesheet" type="text/css" />
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
|
||||||
|
<div id="titlearea">
|
||||||
|
<table cellspacing="0" cellpadding="0">
|
||||||
|
<tbody>
|
||||||
|
<tr style="height: 56px;">
|
||||||
|
<td style="padding-left: 0.5em;">
|
||||||
|
<div id="projectname">SCC.150 Assembler Emulator
|
||||||
|
</div>
|
||||||
|
<div id="projectbrief">A compiler for a simple assembler language</div>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
</tbody>
|
||||||
|
</table>
|
||||||
|
</div>
|
||||||
|
<!-- end header part -->
|
||||||
|
<!-- Generated by Doxygen 1.8.6 -->
|
||||||
|
<script type="text/javascript">
|
||||||
|
var searchBox = new SearchBox("searchBox", "search",false,'Search');
|
||||||
|
</script>
|
||||||
|
<div id="navrow1" class="tabs">
|
||||||
|
<ul class="tablist">
|
||||||
|
<li><a href="index.html"><span>Main Page</span></a></li>
|
||||||
|
<li class="current"><a href="files.html"><span>Files</span></a></li>
|
||||||
|
<li>
|
||||||
|
<div id="MSearchBox" class="MSearchBoxInactive">
|
||||||
|
<span class="left">
|
||||||
|
<img id="MSearchSelect" src="search/mag_sel.png"
|
||||||
|
onmouseover="return searchBox.OnSearchSelectShow()"
|
||||||
|
onmouseout="return searchBox.OnSearchSelectHide()"
|
||||||
|
alt=""/>
|
||||||
|
<input type="text" id="MSearchField" value="Search" accesskey="S"
|
||||||
|
onfocus="searchBox.OnSearchFieldFocus(true)"
|
||||||
|
onblur="searchBox.OnSearchFieldFocus(false)"
|
||||||
|
onkeyup="searchBox.OnSearchFieldChange(event)"/>
|
||||||
|
</span><span class="right">
|
||||||
|
<a id="MSearchClose" href="javascript:searchBox.CloseResultsWindow()"><img id="MSearchCloseImg" border="0" src="search/close.png" alt=""/></a>
|
||||||
|
</span>
|
||||||
|
</div>
|
||||||
|
</li>
|
||||||
|
</ul>
|
||||||
|
</div>
|
||||||
|
<div id="navrow2" class="tabs2">
|
||||||
|
<ul class="tablist">
|
||||||
|
<li><a href="files.html"><span>File List</span></a></li>
|
||||||
|
<li><a href="globals.html"><span>Globals</span></a></li>
|
||||||
|
</ul>
|
||||||
|
</div>
|
||||||
|
<!-- window showing the filter options -->
|
||||||
|
<div id="MSearchSelectWindow"
|
||||||
|
onmouseover="return searchBox.OnSearchSelectShow()"
|
||||||
|
onmouseout="return searchBox.OnSearchSelectHide()"
|
||||||
|
onkeydown="return searchBox.OnSearchSelectKey(event)">
|
||||||
|
<a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(0)"><span class="SelectionMark"> </span>All</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(1)"><span class="SelectionMark"> </span>Files</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(2)"><span class="SelectionMark"> </span>Functions</a></div>
|
||||||
|
|
||||||
|
<!-- iframe showing the search results (closed by default) -->
|
||||||
|
<div id="MSearchResultsWindow">
|
||||||
|
<iframe src="javascript:void(0)" frameborder="0"
|
||||||
|
name="MSearchResults" id="MSearchResults">
|
||||||
|
</iframe>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div id="nav-path" class="navpath">
|
||||||
|
<ul>
|
||||||
|
<li class="navelem"><a class="el" href="dir_b2f33c71d4aa5e7af42a1ca61ff5af1b.html">source</a></li> </ul>
|
||||||
|
</div>
|
||||||
|
</div><!-- top -->
|
||||||
|
<div class="header">
|
||||||
|
<div class="summary">
|
||||||
|
<a href="#func-members">Functions</a> </div>
|
||||||
|
<div class="headertitle">
|
||||||
|
<div class="title">mystring.c File Reference</div> </div>
|
||||||
|
</div><!--header-->
|
||||||
|
<div class="contents">
|
||||||
|
<div class="textblock"><code>#include <stddef.h></code><br/>
|
||||||
|
<code>#include "<a class="el" href="mystring_8h_source.html">mystring.h</a>"</code><br/>
|
||||||
|
</div><table class="memberdecls">
|
||||||
|
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="func-members"></a>
|
||||||
|
Functions</h2></td></tr>
|
||||||
|
<tr class="memitem:aa231246d7f6f97231aa18689cc2ea20a"><td class="memItemLeft" align="right" valign="top">size_t </td><td class="memItemRight" valign="bottom"><a class="el" href="mystring_8c.html#aa231246d7f6f97231aa18689cc2ea20a">mystrlen</a> (const char *s)</td></tr>
|
||||||
|
<tr class="separator:aa231246d7f6f97231aa18689cc2ea20a"><td class="memSeparator" colspan="2"> </td></tr>
|
||||||
|
<tr class="memitem:a3dab99f21a63ee803be3e9344efda0a0"><td class="memItemLeft" align="right" valign="top">int </td><td class="memItemRight" valign="bottom"><a class="el" href="mystring_8c.html#a3dab99f21a63ee803be3e9344efda0a0">mystrcmp</a> (const char *s1, const char *s2)</td></tr>
|
||||||
|
<tr class="separator:a3dab99f21a63ee803be3e9344efda0a0"><td class="memSeparator" colspan="2"> </td></tr>
|
||||||
|
<tr class="memitem:a70913f883a62585fb8fe025aa1e56749"><td class="memItemLeft" align="right" valign="top">int </td><td class="memItemRight" valign="bottom"><a class="el" href="mystring_8c.html#a70913f883a62585fb8fe025aa1e56749">mystrncmp</a> (const char *s1, const char *s2, int n)</td></tr>
|
||||||
|
<tr class="separator:a70913f883a62585fb8fe025aa1e56749"><td class="memSeparator" colspan="2"> </td></tr>
|
||||||
|
<tr class="memitem:a1a18457ecefaaafb354de326065b86f9"><td class="memItemLeft" align="right" valign="top">char * </td><td class="memItemRight" valign="bottom"><a class="el" href="mystring_8c.html#a1a18457ecefaaafb354de326065b86f9">mystrchr</a> (char *haystack, const char needle)</td></tr>
|
||||||
|
<tr class="separator:a1a18457ecefaaafb354de326065b86f9"><td class="memSeparator" colspan="2"> </td></tr>
|
||||||
|
<tr class="memitem:ac650f6f569951713296a17edd496f7a5"><td class="memItemLeft" align="right" valign="top">char * </td><td class="memItemRight" valign="bottom"><a class="el" href="mystring_8c.html#ac650f6f569951713296a17edd496f7a5">mystrstr</a> (char *haystack, const char *needle)</td></tr>
|
||||||
|
<tr class="separator:ac650f6f569951713296a17edd496f7a5"><td class="memSeparator" colspan="2"> </td></tr>
|
||||||
|
</table>
|
||||||
|
<a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2>
|
||||||
|
<div class="textblock"><dl class="section author"><dt>Author</dt><dd>Ben Goldsworthy (rumps) <a href="#" onclick="location.href='mai'+'lto:'+'bgo'+'ld'+'swo'+'rt'+'hy9'+'6@'+'gma'+'il'+'.co'+'m'; return false;">bgold<span style="display: none;">.nosp@m.</span>swor<span style="display: none;">.nosp@m.</span>thy96<span style="display: none;">.nosp@m.</span>@gma<span style="display: none;">.nosp@m.</span>il.co<span style="display: none;">.nosp@m.</span>m</a> </dd></dl>
|
||||||
|
<dl class="section version"><dt>Version</dt><dd>1.0</dd></dl>
|
||||||
|
<h1><a class="anchor" id="LICENSE"></a>
|
||||||
|
LICENSE</h1>
|
||||||
|
<p>This file is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.</p>
|
||||||
|
<p>This file is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.</p>
|
||||||
|
<p>You should have received a copy of the GNU General Public License along with this program. If not, see <a href="http://www.gnu.org/licenses/">http://www.gnu.org/licenses/</a>.</p>
|
||||||
|
<h1><a class="anchor" id="DESCRIPTION"></a>
|
||||||
|
DESCRIPTION</h1>
|
||||||
|
<p>The <code><a class="el" href="mystring_8h.html">mystring.h</a></code> library serves as a fairly pointless replacement for the perfectly good (better, even) <code>string.h</code>. </p>
|
||||||
|
</div><h2 class="groupheader">Function Documentation</h2>
|
||||||
|
<a class="anchor" id="a1a18457ecefaaafb354de326065b86f9"></a>
|
||||||
|
<div class="memitem">
|
||||||
|
<div class="memproto">
|
||||||
|
<table class="memname">
|
||||||
|
<tr>
|
||||||
|
<td class="memname">char* mystrchr </td>
|
||||||
|
<td>(</td>
|
||||||
|
<td class="paramtype">char * </td>
|
||||||
|
<td class="paramname"><em>haystack</em>, </td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td class="paramkey"></td>
|
||||||
|
<td></td>
|
||||||
|
<td class="paramtype">const char </td>
|
||||||
|
<td class="paramname"><em>needle</em> </td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td></td>
|
||||||
|
<td>)</td>
|
||||||
|
<td></td><td></td>
|
||||||
|
</tr>
|
||||||
|
</table>
|
||||||
|
</div><div class="memdoc">
|
||||||
|
<p>A function to find if a character exists in a string.</p>
|
||||||
|
<p>Goes through the string <code>haystack</code> looking for the character <code>needle</code>.</p>
|
||||||
|
<dl class="params"><dt>Parameters</dt><dd>
|
||||||
|
<table class="params">
|
||||||
|
<tr><td class="paramname">haystack</td><td>the string to search </td></tr>
|
||||||
|
<tr><td class="paramname">needle</td><td>the character to search for </td></tr>
|
||||||
|
</table>
|
||||||
|
</dd>
|
||||||
|
</dl>
|
||||||
|
<dl class="section return"><dt>Returns</dt><dd><code>haystack</code> if successful, 0 if not </dd></dl>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<a class="anchor" id="a3dab99f21a63ee803be3e9344efda0a0"></a>
|
||||||
|
<div class="memitem">
|
||||||
|
<div class="memproto">
|
||||||
|
<table class="memname">
|
||||||
|
<tr>
|
||||||
|
<td class="memname">int mystrcmp </td>
|
||||||
|
<td>(</td>
|
||||||
|
<td class="paramtype">const char * </td>
|
||||||
|
<td class="paramname"><em>s1</em>, </td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td class="paramkey"></td>
|
||||||
|
<td></td>
|
||||||
|
<td class="paramtype">const char * </td>
|
||||||
|
<td class="paramname"><em>s2</em> </td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td></td>
|
||||||
|
<td>)</td>
|
||||||
|
<td></td><td></td>
|
||||||
|
</tr>
|
||||||
|
</table>
|
||||||
|
</div><div class="memdoc">
|
||||||
|
<p>A function to compare two strings.</p>
|
||||||
|
<p>Compares two strings, returning -1 if <code>s1</code> < <code>s2</code>, 1 if <code>s1</code> > <code>s2</code> and 0 if <code>s1</code> == <code>s2</code>.</p>
|
||||||
|
<dl class="params"><dt>Parameters</dt><dd>
|
||||||
|
<table class="params">
|
||||||
|
<tr><td class="paramname">s1</td><td>the string to compare </td></tr>
|
||||||
|
<tr><td class="paramname">s2</td><td>the string to compare <code>s1</code> to </td></tr>
|
||||||
|
</table>
|
||||||
|
</dd>
|
||||||
|
</dl>
|
||||||
|
<dl class="section return"><dt>Returns</dt><dd>-1 if the <code>s1</code> < <code>s2</code>; 1 if <code>s1</code> > <code>s2</code>; 0 if <code>s1</code> == <code>s2</code> </dd></dl>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<a class="anchor" id="aa231246d7f6f97231aa18689cc2ea20a"></a>
|
||||||
|
<div class="memitem">
|
||||||
|
<div class="memproto">
|
||||||
|
<table class="memname">
|
||||||
|
<tr>
|
||||||
|
<td class="memname">size_t mystrlen </td>
|
||||||
|
<td>(</td>
|
||||||
|
<td class="paramtype">const char * </td>
|
||||||
|
<td class="paramname"><em>s</em></td><td>)</td>
|
||||||
|
<td></td>
|
||||||
|
</tr>
|
||||||
|
</table>
|
||||||
|
</div><div class="memdoc">
|
||||||
|
<p>A function to measure the length of a valid C string.</p>
|
||||||
|
<p>Goes through the null-terminated (i.e. valid C) string <code>s</code> character-by-character, returning the length of the string (sans the null terminator).</p>
|
||||||
|
<dl class="params"><dt>Parameters</dt><dd>
|
||||||
|
<table class="params">
|
||||||
|
<tr><td class="paramname">s</td><td>the string to measure </td></tr>
|
||||||
|
</table>
|
||||||
|
</dd>
|
||||||
|
</dl>
|
||||||
|
<dl class="section return"><dt>Returns</dt><dd>the length of the string as an <code>unsigned int</code> (<code>size_t</code> because apparently that's the done thing as of C99, which I'm using because I love for loop initial declarations to bits) </dd></dl>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<a class="anchor" id="a70913f883a62585fb8fe025aa1e56749"></a>
|
||||||
|
<div class="memitem">
|
||||||
|
<div class="memproto">
|
||||||
|
<table class="memname">
|
||||||
|
<tr>
|
||||||
|
<td class="memname">int mystrncmp </td>
|
||||||
|
<td>(</td>
|
||||||
|
<td class="paramtype">const char * </td>
|
||||||
|
<td class="paramname"><em>s1</em>, </td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td class="paramkey"></td>
|
||||||
|
<td></td>
|
||||||
|
<td class="paramtype">const char * </td>
|
||||||
|
<td class="paramname"><em>s2</em>, </td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td class="paramkey"></td>
|
||||||
|
<td></td>
|
||||||
|
<td class="paramtype">int </td>
|
||||||
|
<td class="paramname"><em>n</em> </td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td></td>
|
||||||
|
<td>)</td>
|
||||||
|
<td></td><td></td>
|
||||||
|
</tr>
|
||||||
|
</table>
|
||||||
|
</div><div class="memdoc">
|
||||||
|
<p>A function to compare two strings up to a certain point.</p>
|
||||||
|
<p>Goes through <code>n</code> characters of <code>s1</code>, comparing them to the matching characters of <code>s2</code>. If the characters are different, it returns -1 if <code>s1</code> < <code>s2</code> and 1 if <code>s1</code> > <code>s2</code>.</p>
|
||||||
|
<p>If they're the same, it returns 0 if <code>s1</code> is the same length as <code>s2</code> (i.e. the same characters are both <code>NUL</code>). If the function reaches the <code>n</code>th character of <code>s1</code> and it remains the same as <code>s2</code>, it returns 0 also.</p>
|
||||||
|
<dl class="params"><dt>Parameters</dt><dd>
|
||||||
|
<table class="params">
|
||||||
|
<tr><td class="paramname">s1</td><td>the string to compare </td></tr>
|
||||||
|
<tr><td class="paramname">s2</td><td>the string to compare <code>s1</code> to </td></tr>
|
||||||
|
<tr><td class="paramname">n</td><td>the length of <code>s1</code> to compare </td></tr>
|
||||||
|
</table>
|
||||||
|
</dd>
|
||||||
|
</dl>
|
||||||
|
<dl class="section return"><dt>Returns</dt><dd>-1/1 if the strings don't match, 0 if they do </dd></dl>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<a class="anchor" id="ac650f6f569951713296a17edd496f7a5"></a>
|
||||||
|
<div class="memitem">
|
||||||
|
<div class="memproto">
|
||||||
|
<table class="memname">
|
||||||
|
<tr>
|
||||||
|
<td class="memname">char* mystrstr </td>
|
||||||
|
<td>(</td>
|
||||||
|
<td class="paramtype">char * </td>
|
||||||
|
<td class="paramname"><em>haystack</em>, </td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td class="paramkey"></td>
|
||||||
|
<td></td>
|
||||||
|
<td class="paramtype">const char * </td>
|
||||||
|
<td class="paramname"><em>needle</em> </td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td></td>
|
||||||
|
<td>)</td>
|
||||||
|
<td></td><td></td>
|
||||||
|
</tr>
|
||||||
|
</table>
|
||||||
|
</div><div class="memdoc">
|
||||||
|
<p>A function to find if a string exists as a subset or totality of another.</p>
|
||||||
|
<p>Goes through the string <code>haystack</code> looking for the string <code>needle</code> by executing <code>mystrchr</code> on each character in turn.</p>
|
||||||
|
<dl class="params"><dt>Parameters</dt><dd>
|
||||||
|
<table class="params">
|
||||||
|
<tr><td class="paramname">haystack</td><td>the string to search </td></tr>
|
||||||
|
<tr><td class="paramname">needle</td><td>the (sub)string to search for </td></tr>
|
||||||
|
</table>
|
||||||
|
</dd>
|
||||||
|
</dl>
|
||||||
|
<dl class="section return"><dt>Returns</dt><dd><code>haystack</code> if successful, 0 if not </dd></dl>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div><!-- contents -->
|
||||||
|
<!-- start footer part -->
|
||||||
|
<hr class="footer"/><address class="footer"><small>
|
||||||
|
Generated on Tue May 19 2015 20:34:54 for SCC.150 Assembler Emulator by  <a href="http://www.doxygen.org/index.html">
|
||||||
|
<img class="footer" src="doxygen.png" alt="doxygen"/>
|
||||||
|
</a> 1.8.6
|
||||||
|
</small></address>
|
||||||
|
</body>
|
||||||
|
</html>
|
306
doc/html/mystring_8h.html
Executable file
|
@ -0,0 +1,306 @@
|
||||||
|
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
||||||
|
<html xmlns="http://www.w3.org/1999/xhtml">
|
||||||
|
<head>
|
||||||
|
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
|
||||||
|
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
|
||||||
|
<meta name="generator" content="Doxygen 1.8.6"/>
|
||||||
|
<title>SCC.150 Assembler Emulator: /home/rumperuu/Documents/University/University Work/SCC.150 Digital Systems/Coursework/unr-C/SCC.150 Assembler Emulator/source/mystring.h File Reference</title>
|
||||||
|
<link href="tabs.css" rel="stylesheet" type="text/css"/>
|
||||||
|
<script type="text/javascript" src="jquery.js"></script>
|
||||||
|
<script type="text/javascript" src="dynsections.js"></script>
|
||||||
|
<link href="search/search.css" rel="stylesheet" type="text/css"/>
|
||||||
|
<script type="text/javascript" src="search/search.js"></script>
|
||||||
|
<script type="text/javascript">
|
||||||
|
$(document).ready(function() { searchBox.OnSelectItem(0); });
|
||||||
|
</script>
|
||||||
|
<link href="doxygen.css" rel="stylesheet" type="text/css" />
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
|
||||||
|
<div id="titlearea">
|
||||||
|
<table cellspacing="0" cellpadding="0">
|
||||||
|
<tbody>
|
||||||
|
<tr style="height: 56px;">
|
||||||
|
<td style="padding-left: 0.5em;">
|
||||||
|
<div id="projectname">SCC.150 Assembler Emulator
|
||||||
|
</div>
|
||||||
|
<div id="projectbrief">A compiler for a simple assembler language</div>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
</tbody>
|
||||||
|
</table>
|
||||||
|
</div>
|
||||||
|
<!-- end header part -->
|
||||||
|
<!-- Generated by Doxygen 1.8.6 -->
|
||||||
|
<script type="text/javascript">
|
||||||
|
var searchBox = new SearchBox("searchBox", "search",false,'Search');
|
||||||
|
</script>
|
||||||
|
<div id="navrow1" class="tabs">
|
||||||
|
<ul class="tablist">
|
||||||
|
<li><a href="index.html"><span>Main Page</span></a></li>
|
||||||
|
<li class="current"><a href="files.html"><span>Files</span></a></li>
|
||||||
|
<li>
|
||||||
|
<div id="MSearchBox" class="MSearchBoxInactive">
|
||||||
|
<span class="left">
|
||||||
|
<img id="MSearchSelect" src="search/mag_sel.png"
|
||||||
|
onmouseover="return searchBox.OnSearchSelectShow()"
|
||||||
|
onmouseout="return searchBox.OnSearchSelectHide()"
|
||||||
|
alt=""/>
|
||||||
|
<input type="text" id="MSearchField" value="Search" accesskey="S"
|
||||||
|
onfocus="searchBox.OnSearchFieldFocus(true)"
|
||||||
|
onblur="searchBox.OnSearchFieldFocus(false)"
|
||||||
|
onkeyup="searchBox.OnSearchFieldChange(event)"/>
|
||||||
|
</span><span class="right">
|
||||||
|
<a id="MSearchClose" href="javascript:searchBox.CloseResultsWindow()"><img id="MSearchCloseImg" border="0" src="search/close.png" alt=""/></a>
|
||||||
|
</span>
|
||||||
|
</div>
|
||||||
|
</li>
|
||||||
|
</ul>
|
||||||
|
</div>
|
||||||
|
<div id="navrow2" class="tabs2">
|
||||||
|
<ul class="tablist">
|
||||||
|
<li><a href="files.html"><span>File List</span></a></li>
|
||||||
|
<li><a href="globals.html"><span>Globals</span></a></li>
|
||||||
|
</ul>
|
||||||
|
</div>
|
||||||
|
<!-- window showing the filter options -->
|
||||||
|
<div id="MSearchSelectWindow"
|
||||||
|
onmouseover="return searchBox.OnSearchSelectShow()"
|
||||||
|
onmouseout="return searchBox.OnSearchSelectHide()"
|
||||||
|
onkeydown="return searchBox.OnSearchSelectKey(event)">
|
||||||
|
<a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(0)"><span class="SelectionMark"> </span>All</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(1)"><span class="SelectionMark"> </span>Files</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(2)"><span class="SelectionMark"> </span>Functions</a></div>
|
||||||
|
|
||||||
|
<!-- iframe showing the search results (closed by default) -->
|
||||||
|
<div id="MSearchResultsWindow">
|
||||||
|
<iframe src="javascript:void(0)" frameborder="0"
|
||||||
|
name="MSearchResults" id="MSearchResults">
|
||||||
|
</iframe>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div id="nav-path" class="navpath">
|
||||||
|
<ul>
|
||||||
|
<li class="navelem"><a class="el" href="dir_b2f33c71d4aa5e7af42a1ca61ff5af1b.html">source</a></li> </ul>
|
||||||
|
</div>
|
||||||
|
</div><!-- top -->
|
||||||
|
<div class="header">
|
||||||
|
<div class="summary">
|
||||||
|
<a href="#func-members">Functions</a> </div>
|
||||||
|
<div class="headertitle">
|
||||||
|
<div class="title">mystring.h File Reference</div> </div>
|
||||||
|
</div><!--header-->
|
||||||
|
<div class="contents">
|
||||||
|
<div class="textblock"><code>#include <stddef.h></code><br/>
|
||||||
|
</div>
|
||||||
|
<p><a href="mystring_8h_source.html">Go to the source code of this file.</a></p>
|
||||||
|
<table class="memberdecls">
|
||||||
|
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="func-members"></a>
|
||||||
|
Functions</h2></td></tr>
|
||||||
|
<tr class="memitem:aa231246d7f6f97231aa18689cc2ea20a"><td class="memItemLeft" align="right" valign="top">size_t </td><td class="memItemRight" valign="bottom"><a class="el" href="mystring_8h.html#aa231246d7f6f97231aa18689cc2ea20a">mystrlen</a> (const char *s)</td></tr>
|
||||||
|
<tr class="separator:aa231246d7f6f97231aa18689cc2ea20a"><td class="memSeparator" colspan="2"> </td></tr>
|
||||||
|
<tr class="memitem:a3dab99f21a63ee803be3e9344efda0a0"><td class="memItemLeft" align="right" valign="top">int </td><td class="memItemRight" valign="bottom"><a class="el" href="mystring_8h.html#a3dab99f21a63ee803be3e9344efda0a0">mystrcmp</a> (const char *s1, const char *s2)</td></tr>
|
||||||
|
<tr class="separator:a3dab99f21a63ee803be3e9344efda0a0"><td class="memSeparator" colspan="2"> </td></tr>
|
||||||
|
<tr class="memitem:a70913f883a62585fb8fe025aa1e56749"><td class="memItemLeft" align="right" valign="top">int </td><td class="memItemRight" valign="bottom"><a class="el" href="mystring_8h.html#a70913f883a62585fb8fe025aa1e56749">mystrncmp</a> (const char *s1, const char *s2, int n)</td></tr>
|
||||||
|
<tr class="separator:a70913f883a62585fb8fe025aa1e56749"><td class="memSeparator" colspan="2"> </td></tr>
|
||||||
|
<tr class="memitem:a1a18457ecefaaafb354de326065b86f9"><td class="memItemLeft" align="right" valign="top">char * </td><td class="memItemRight" valign="bottom"><a class="el" href="mystring_8h.html#a1a18457ecefaaafb354de326065b86f9">mystrchr</a> (char *haystack, const char needle)</td></tr>
|
||||||
|
<tr class="separator:a1a18457ecefaaafb354de326065b86f9"><td class="memSeparator" colspan="2"> </td></tr>
|
||||||
|
<tr class="memitem:ac650f6f569951713296a17edd496f7a5"><td class="memItemLeft" align="right" valign="top">char * </td><td class="memItemRight" valign="bottom"><a class="el" href="mystring_8h.html#ac650f6f569951713296a17edd496f7a5">mystrstr</a> (char *haystack, const char *needle)</td></tr>
|
||||||
|
<tr class="separator:ac650f6f569951713296a17edd496f7a5"><td class="memSeparator" colspan="2"> </td></tr>
|
||||||
|
</table>
|
||||||
|
<a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2>
|
||||||
|
<div class="textblock"><dl class="section author"><dt>Author</dt><dd>Ben Goldsworthy (rumps) <a href="#" onclick="location.href='mai'+'lto:'+'bgo'+'ld'+'swo'+'rt'+'hy9'+'6@'+'gma'+'il'+'.co'+'m'; return false;">bgold<span style="display: none;">.nosp@m.</span>swor<span style="display: none;">.nosp@m.</span>thy96<span style="display: none;">.nosp@m.</span>@gma<span style="display: none;">.nosp@m.</span>il.co<span style="display: none;">.nosp@m.</span>m</a> </dd></dl>
|
||||||
|
<dl class="section version"><dt>Version</dt><dd>1.0</dd></dl>
|
||||||
|
<h1><a class="anchor" id="LICENSE"></a>
|
||||||
|
LICENSE</h1>
|
||||||
|
<p>This file is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.</p>
|
||||||
|
<p>This file is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.</p>
|
||||||
|
<p>You should have received a copy of the GNU General Public License along with this program. If not, see <a href="http://www.gnu.org/licenses/">http://www.gnu.org/licenses/</a>.</p>
|
||||||
|
<h1><a class="anchor" id="DESCRIPTION"></a>
|
||||||
|
DESCRIPTION</h1>
|
||||||
|
<p>Header file for <code><a class="el" href="mystring_8c.html">mystring.c</a></code>. </p>
|
||||||
|
</div><h2 class="groupheader">Function Documentation</h2>
|
||||||
|
<a class="anchor" id="a1a18457ecefaaafb354de326065b86f9"></a>
|
||||||
|
<div class="memitem">
|
||||||
|
<div class="memproto">
|
||||||
|
<table class="memname">
|
||||||
|
<tr>
|
||||||
|
<td class="memname">char* mystrchr </td>
|
||||||
|
<td>(</td>
|
||||||
|
<td class="paramtype">char * </td>
|
||||||
|
<td class="paramname"><em>haystack</em>, </td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td class="paramkey"></td>
|
||||||
|
<td></td>
|
||||||
|
<td class="paramtype">const char </td>
|
||||||
|
<td class="paramname"><em>needle</em> </td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td></td>
|
||||||
|
<td>)</td>
|
||||||
|
<td></td><td></td>
|
||||||
|
</tr>
|
||||||
|
</table>
|
||||||
|
</div><div class="memdoc">
|
||||||
|
<p>A function to find if a character exists in a string.</p>
|
||||||
|
<p>Goes through the string <code>haystack</code> looking for the character <code>needle</code>.</p>
|
||||||
|
<dl class="params"><dt>Parameters</dt><dd>
|
||||||
|
<table class="params">
|
||||||
|
<tr><td class="paramname">haystack</td><td>the string to search </td></tr>
|
||||||
|
<tr><td class="paramname">needle</td><td>the character to search for </td></tr>
|
||||||
|
</table>
|
||||||
|
</dd>
|
||||||
|
</dl>
|
||||||
|
<dl class="section return"><dt>Returns</dt><dd><code>haystack</code> if successful, 0 if not </dd></dl>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<a class="anchor" id="a3dab99f21a63ee803be3e9344efda0a0"></a>
|
||||||
|
<div class="memitem">
|
||||||
|
<div class="memproto">
|
||||||
|
<table class="memname">
|
||||||
|
<tr>
|
||||||
|
<td class="memname">int mystrcmp </td>
|
||||||
|
<td>(</td>
|
||||||
|
<td class="paramtype">const char * </td>
|
||||||
|
<td class="paramname"><em>s1</em>, </td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td class="paramkey"></td>
|
||||||
|
<td></td>
|
||||||
|
<td class="paramtype">const char * </td>
|
||||||
|
<td class="paramname"><em>s2</em> </td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td></td>
|
||||||
|
<td>)</td>
|
||||||
|
<td></td><td></td>
|
||||||
|
</tr>
|
||||||
|
</table>
|
||||||
|
</div><div class="memdoc">
|
||||||
|
<p>A function to compare two strings.</p>
|
||||||
|
<p>Compares two strings, returning -1 if <code>s1</code> < <code>s2</code>, 1 if <code>s1</code> > <code>s2</code> and 0 if <code>s1</code> == <code>s2</code>.</p>
|
||||||
|
<dl class="params"><dt>Parameters</dt><dd>
|
||||||
|
<table class="params">
|
||||||
|
<tr><td class="paramname">s1</td><td>the string to compare </td></tr>
|
||||||
|
<tr><td class="paramname">s2</td><td>the string to compare <code>s1</code> to </td></tr>
|
||||||
|
</table>
|
||||||
|
</dd>
|
||||||
|
</dl>
|
||||||
|
<dl class="section return"><dt>Returns</dt><dd>-1 if the <code>s1</code> < <code>s2</code>; 1 if <code>s1</code> > <code>s2</code>; 0 if <code>s1</code> == <code>s2</code> </dd></dl>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<a class="anchor" id="aa231246d7f6f97231aa18689cc2ea20a"></a>
|
||||||
|
<div class="memitem">
|
||||||
|
<div class="memproto">
|
||||||
|
<table class="memname">
|
||||||
|
<tr>
|
||||||
|
<td class="memname">size_t mystrlen </td>
|
||||||
|
<td>(</td>
|
||||||
|
<td class="paramtype">const char * </td>
|
||||||
|
<td class="paramname"><em>s</em></td><td>)</td>
|
||||||
|
<td></td>
|
||||||
|
</tr>
|
||||||
|
</table>
|
||||||
|
</div><div class="memdoc">
|
||||||
|
<p>A function to measure the length of a valid C string.</p>
|
||||||
|
<p>Goes through the null-terminated (i.e. valid C) string <code>s</code> character-by-character, returning the length of the string (sans the null terminator).</p>
|
||||||
|
<dl class="params"><dt>Parameters</dt><dd>
|
||||||
|
<table class="params">
|
||||||
|
<tr><td class="paramname">s</td><td>the string to measure </td></tr>
|
||||||
|
</table>
|
||||||
|
</dd>
|
||||||
|
</dl>
|
||||||
|
<dl class="section return"><dt>Returns</dt><dd>the length of the string as an <code>unsigned int</code> (<code>size_t</code> because apparently that's the done thing as of C99, which I'm using because I love for loop initial declarations to bits) </dd></dl>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<a class="anchor" id="a70913f883a62585fb8fe025aa1e56749"></a>
|
||||||
|
<div class="memitem">
|
||||||
|
<div class="memproto">
|
||||||
|
<table class="memname">
|
||||||
|
<tr>
|
||||||
|
<td class="memname">int mystrncmp </td>
|
||||||
|
<td>(</td>
|
||||||
|
<td class="paramtype">const char * </td>
|
||||||
|
<td class="paramname"><em>s1</em>, </td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td class="paramkey"></td>
|
||||||
|
<td></td>
|
||||||
|
<td class="paramtype">const char * </td>
|
||||||
|
<td class="paramname"><em>s2</em>, </td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td class="paramkey"></td>
|
||||||
|
<td></td>
|
||||||
|
<td class="paramtype">int </td>
|
||||||
|
<td class="paramname"><em>n</em> </td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td></td>
|
||||||
|
<td>)</td>
|
||||||
|
<td></td><td></td>
|
||||||
|
</tr>
|
||||||
|
</table>
|
||||||
|
</div><div class="memdoc">
|
||||||
|
<p>A function to compare two strings up to a certain point.</p>
|
||||||
|
<p>Goes through <code>n</code> characters of <code>s1</code>, comparing them to the matching characters of <code>s2</code>. If the characters are different, it returns -1 if <code>s1</code> < <code>s2</code> and 1 if <code>s1</code> > <code>s2</code>.</p>
|
||||||
|
<p>If they're the same, it returns 0 if <code>s1</code> is the same length as <code>s2</code> (i.e. the same characters are both <code>NUL</code>). If the function reaches the <code>n</code>th character of <code>s1</code> and it remains the same as <code>s2</code>, it returns 0 also.</p>
|
||||||
|
<dl class="params"><dt>Parameters</dt><dd>
|
||||||
|
<table class="params">
|
||||||
|
<tr><td class="paramname">s1</td><td>the string to compare </td></tr>
|
||||||
|
<tr><td class="paramname">s2</td><td>the string to compare <code>s1</code> to </td></tr>
|
||||||
|
<tr><td class="paramname">n</td><td>the length of <code>s1</code> to compare </td></tr>
|
||||||
|
</table>
|
||||||
|
</dd>
|
||||||
|
</dl>
|
||||||
|
<dl class="section return"><dt>Returns</dt><dd>-1/1 if the strings don't match, 0 if they do </dd></dl>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<a class="anchor" id="ac650f6f569951713296a17edd496f7a5"></a>
|
||||||
|
<div class="memitem">
|
||||||
|
<div class="memproto">
|
||||||
|
<table class="memname">
|
||||||
|
<tr>
|
||||||
|
<td class="memname">char* mystrstr </td>
|
||||||
|
<td>(</td>
|
||||||
|
<td class="paramtype">char * </td>
|
||||||
|
<td class="paramname"><em>haystack</em>, </td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td class="paramkey"></td>
|
||||||
|
<td></td>
|
||||||
|
<td class="paramtype">const char * </td>
|
||||||
|
<td class="paramname"><em>needle</em> </td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td></td>
|
||||||
|
<td>)</td>
|
||||||
|
<td></td><td></td>
|
||||||
|
</tr>
|
||||||
|
</table>
|
||||||
|
</div><div class="memdoc">
|
||||||
|
<p>A function to find if a string exists as a subset or totality of another.</p>
|
||||||
|
<p>Goes through the string <code>haystack</code> looking for the string <code>needle</code> by executing <code>mystrchr</code> on each character in turn.</p>
|
||||||
|
<dl class="params"><dt>Parameters</dt><dd>
|
||||||
|
<table class="params">
|
||||||
|
<tr><td class="paramname">haystack</td><td>the string to search </td></tr>
|
||||||
|
<tr><td class="paramname">needle</td><td>the (sub)string to search for </td></tr>
|
||||||
|
</table>
|
||||||
|
</dd>
|
||||||
|
</dl>
|
||||||
|
<dl class="section return"><dt>Returns</dt><dd><code>haystack</code> if successful, 0 if not </dd></dl>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div><!-- contents -->
|
||||||
|
<!-- start footer part -->
|
||||||
|
<hr class="footer"/><address class="footer"><small>
|
||||||
|
Generated on Tue May 19 2015 20:34:54 for SCC.150 Assembler Emulator by  <a href="http://www.doxygen.org/index.html">
|
||||||
|
<img class="footer" src="doxygen.png" alt="doxygen"/>
|
||||||
|
</a> 1.8.6
|
||||||
|
</small></address>
|
||||||
|
</body>
|
||||||
|
</html>
|
115
doc/html/mystring_8h_source.html
Executable file
|
@ -0,0 +1,115 @@
|
||||||
|
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
||||||
|
<html xmlns="http://www.w3.org/1999/xhtml">
|
||||||
|
<head>
|
||||||
|
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
|
||||||
|
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
|
||||||
|
<meta name="generator" content="Doxygen 1.8.6"/>
|
||||||
|
<title>SCC.150 Assembler Emulator: /home/rumperuu/Documents/University/University Work/SCC.150 Digital Systems/Coursework/unr-C/SCC.150 Assembler Emulator/source/mystring.h Source File</title>
|
||||||
|
<link href="tabs.css" rel="stylesheet" type="text/css"/>
|
||||||
|
<script type="text/javascript" src="jquery.js"></script>
|
||||||
|
<script type="text/javascript" src="dynsections.js"></script>
|
||||||
|
<link href="search/search.css" rel="stylesheet" type="text/css"/>
|
||||||
|
<script type="text/javascript" src="search/search.js"></script>
|
||||||
|
<script type="text/javascript">
|
||||||
|
$(document).ready(function() { searchBox.OnSelectItem(0); });
|
||||||
|
</script>
|
||||||
|
<link href="doxygen.css" rel="stylesheet" type="text/css" />
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
|
||||||
|
<div id="titlearea">
|
||||||
|
<table cellspacing="0" cellpadding="0">
|
||||||
|
<tbody>
|
||||||
|
<tr style="height: 56px;">
|
||||||
|
<td style="padding-left: 0.5em;">
|
||||||
|
<div id="projectname">SCC.150 Assembler Emulator
|
||||||
|
</div>
|
||||||
|
<div id="projectbrief">A compiler for a simple assembler language</div>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
</tbody>
|
||||||
|
</table>
|
||||||
|
</div>
|
||||||
|
<!-- end header part -->
|
||||||
|
<!-- Generated by Doxygen 1.8.6 -->
|
||||||
|
<script type="text/javascript">
|
||||||
|
var searchBox = new SearchBox("searchBox", "search",false,'Search');
|
||||||
|
</script>
|
||||||
|
<div id="navrow1" class="tabs">
|
||||||
|
<ul class="tablist">
|
||||||
|
<li><a href="index.html"><span>Main Page</span></a></li>
|
||||||
|
<li class="current"><a href="files.html"><span>Files</span></a></li>
|
||||||
|
<li>
|
||||||
|
<div id="MSearchBox" class="MSearchBoxInactive">
|
||||||
|
<span class="left">
|
||||||
|
<img id="MSearchSelect" src="search/mag_sel.png"
|
||||||
|
onmouseover="return searchBox.OnSearchSelectShow()"
|
||||||
|
onmouseout="return searchBox.OnSearchSelectHide()"
|
||||||
|
alt=""/>
|
||||||
|
<input type="text" id="MSearchField" value="Search" accesskey="S"
|
||||||
|
onfocus="searchBox.OnSearchFieldFocus(true)"
|
||||||
|
onblur="searchBox.OnSearchFieldFocus(false)"
|
||||||
|
onkeyup="searchBox.OnSearchFieldChange(event)"/>
|
||||||
|
</span><span class="right">
|
||||||
|
<a id="MSearchClose" href="javascript:searchBox.CloseResultsWindow()"><img id="MSearchCloseImg" border="0" src="search/close.png" alt=""/></a>
|
||||||
|
</span>
|
||||||
|
</div>
|
||||||
|
</li>
|
||||||
|
</ul>
|
||||||
|
</div>
|
||||||
|
<div id="navrow2" class="tabs2">
|
||||||
|
<ul class="tablist">
|
||||||
|
<li><a href="files.html"><span>File List</span></a></li>
|
||||||
|
<li><a href="globals.html"><span>Globals</span></a></li>
|
||||||
|
</ul>
|
||||||
|
</div>
|
||||||
|
<!-- window showing the filter options -->
|
||||||
|
<div id="MSearchSelectWindow"
|
||||||
|
onmouseover="return searchBox.OnSearchSelectShow()"
|
||||||
|
onmouseout="return searchBox.OnSearchSelectHide()"
|
||||||
|
onkeydown="return searchBox.OnSearchSelectKey(event)">
|
||||||
|
<a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(0)"><span class="SelectionMark"> </span>All</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(1)"><span class="SelectionMark"> </span>Files</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(2)"><span class="SelectionMark"> </span>Functions</a></div>
|
||||||
|
|
||||||
|
<!-- iframe showing the search results (closed by default) -->
|
||||||
|
<div id="MSearchResultsWindow">
|
||||||
|
<iframe src="javascript:void(0)" frameborder="0"
|
||||||
|
name="MSearchResults" id="MSearchResults">
|
||||||
|
</iframe>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div id="nav-path" class="navpath">
|
||||||
|
<ul>
|
||||||
|
<li class="navelem"><a class="el" href="dir_b2f33c71d4aa5e7af42a1ca61ff5af1b.html">source</a></li> </ul>
|
||||||
|
</div>
|
||||||
|
</div><!-- top -->
|
||||||
|
<div class="header">
|
||||||
|
<div class="headertitle">
|
||||||
|
<div class="title">mystring.h</div> </div>
|
||||||
|
</div><!--header-->
|
||||||
|
<div class="contents">
|
||||||
|
<a href="mystring_8h.html">Go to the documentation of this file.</a><div class="fragment"><div class="line"><a name="l00001"></a><span class="lineno"> 1</span> <span class="preprocessor">#ifndef MYSTRING_H_</span></div>
|
||||||
|
<div class="line"><a name="l00002"></a><span class="lineno"> 2</span> <span class="preprocessor"></span><span class="preprocessor">#define MYSTRING_H_</span></div>
|
||||||
|
<div class="line"><a name="l00003"></a><span class="lineno"> 3</span> <span class="preprocessor"></span></div>
|
||||||
|
<div class="line"><a name="l00029"></a><span class="lineno"> 29</span> <span class="preprocessor">#include <stddef.h></span> <span class="comment">// used for size_t</span></div>
|
||||||
|
<div class="line"><a name="l00030"></a><span class="lineno"> 30</span> </div>
|
||||||
|
<div class="line"><a name="l00031"></a><span class="lineno"> 31</span> <span class="keywordtype">size_t</span> <a class="code" href="mystring_8h.html#aa231246d7f6f97231aa18689cc2ea20a">mystrlen</a>(<span class="keyword">const</span> <span class="keywordtype">char</span>* s);</div>
|
||||||
|
<div class="line"><a name="l00032"></a><span class="lineno"> 32</span> <span class="keywordtype">int</span> <a class="code" href="mystring_8h.html#a3dab99f21a63ee803be3e9344efda0a0">mystrcmp</a>(<span class="keyword">const</span> <span class="keywordtype">char</span>* s1, <span class="keyword">const</span> <span class="keywordtype">char</span>* s2);</div>
|
||||||
|
<div class="line"><a name="l00033"></a><span class="lineno"> 33</span> <span class="keywordtype">int</span> <a class="code" href="mystring_8h.html#a70913f883a62585fb8fe025aa1e56749">mystrncmp</a>(<span class="keyword">const</span> <span class="keywordtype">char</span>* s1, <span class="keyword">const</span> <span class="keywordtype">char</span>* s2, <span class="keywordtype">int</span> n);</div>
|
||||||
|
<div class="line"><a name="l00034"></a><span class="lineno"> 34</span> <span class="keywordtype">char</span>* <a class="code" href="mystring_8h.html#a1a18457ecefaaafb354de326065b86f9">mystrchr</a>(<span class="keywordtype">char</span>* haystack, <span class="keyword">const</span> <span class="keywordtype">char</span> needle);</div>
|
||||||
|
<div class="line"><a name="l00035"></a><span class="lineno"> 35</span> <span class="keywordtype">char</span>* <a class="code" href="mystring_8h.html#ac650f6f569951713296a17edd496f7a5">mystrstr</a>(<span class="keywordtype">char</span>* haystack, <span class="keyword">const</span> <span class="keywordtype">char</span>* needle);</div>
|
||||||
|
<div class="line"><a name="l00036"></a><span class="lineno"> 36</span> </div>
|
||||||
|
<div class="line"><a name="l00037"></a><span class="lineno"> 37</span> <span class="preprocessor">#endif </span><span class="comment">/* MYSTRING_H_ */</span><span class="preprocessor"></span></div>
|
||||||
|
<div class="ttc" id="mystring_8h_html_a70913f883a62585fb8fe025aa1e56749"><div class="ttname"><a href="mystring_8h.html#a70913f883a62585fb8fe025aa1e56749">mystrncmp</a></div><div class="ttdeci">int mystrncmp(const char *s1, const char *s2, int n)</div><div class="ttdef"><b>Definition:</b> mystring.c:99</div></div>
|
||||||
|
<div class="ttc" id="mystring_8h_html_aa231246d7f6f97231aa18689cc2ea20a"><div class="ttname"><a href="mystring_8h.html#aa231246d7f6f97231aa18689cc2ea20a">mystrlen</a></div><div class="ttdeci">size_t mystrlen(const char *s)</div><div class="ttdef"><b>Definition:</b> mystring.c:46</div></div>
|
||||||
|
<div class="ttc" id="mystring_8h_html_a3dab99f21a63ee803be3e9344efda0a0"><div class="ttname"><a href="mystring_8h.html#a3dab99f21a63ee803be3e9344efda0a0">mystrcmp</a></div><div class="ttdeci">int mystrcmp(const char *s1, const char *s2)</div><div class="ttdef"><b>Definition:</b> mystring.c:67</div></div>
|
||||||
|
<div class="ttc" id="mystring_8h_html_a1a18457ecefaaafb354de326065b86f9"><div class="ttname"><a href="mystring_8h.html#a1a18457ecefaaafb354de326065b86f9">mystrchr</a></div><div class="ttdeci">char * mystrchr(char *haystack, const char needle)</div><div class="ttdef"><b>Definition:</b> mystring.c:119</div></div>
|
||||||
|
<div class="ttc" id="mystring_8h_html_ac650f6f569951713296a17edd496f7a5"><div class="ttname"><a href="mystring_8h.html#ac650f6f569951713296a17edd496f7a5">mystrstr</a></div><div class="ttdeci">char * mystrstr(char *haystack, const char *needle)</div><div class="ttdef"><b>Definition:</b> mystring.c:138</div></div>
|
||||||
|
</div><!-- fragment --></div><!-- contents -->
|
||||||
|
<!-- start footer part -->
|
||||||
|
<hr class="footer"/><address class="footer"><small>
|
||||||
|
Generated on Tue May 19 2015 20:34:54 for SCC.150 Assembler Emulator by  <a href="http://www.doxygen.org/index.html">
|
||||||
|
<img class="footer" src="doxygen.png" alt="doxygen"/>
|
||||||
|
</a> 1.8.6
|
||||||
|
</small></address>
|
||||||
|
</body>
|
||||||
|
</html>
|
BIN
doc/html/nav_f.png
Executable file
After (image error) Size: 153 B |
BIN
doc/html/nav_g.png
Executable file
After (image error) Size: 95 B |
BIN
doc/html/nav_h.png
Executable file
After (image error) Size: 98 B |
BIN
doc/html/open.png
Executable file
After (image error) Size: 123 B |
26
doc/html/search/all_0.html
Executable file
|
@ -0,0 +1,26 @@
|
||||||
|
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
||||||
|
<html><head><title></title>
|
||||||
|
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
|
||||||
|
<meta name="generator" content="Doxygen 1.8.6">
|
||||||
|
<link rel="stylesheet" type="text/css" href="search.css"/>
|
||||||
|
<script type="text/javascript" src="all_0.js"></script>
|
||||||
|
<script type="text/javascript" src="search.js"></script>
|
||||||
|
</head>
|
||||||
|
<body class="SRPage">
|
||||||
|
<div id="SRIndex">
|
||||||
|
<div class="SRStatus" id="Loading">Loading...</div>
|
||||||
|
<div id="SRResults"></div>
|
||||||
|
<script type="text/javascript"><!--
|
||||||
|
createResults();
|
||||||
|
--></script>
|
||||||
|
<div class="SRStatus" id="Searching">Searching...</div>
|
||||||
|
<div class="SRStatus" id="NoMatches">No Matches</div>
|
||||||
|
<script type="text/javascript"><!--
|
||||||
|
document.getElementById("Loading").style.display="none";
|
||||||
|
document.getElementById("NoMatches").style.display="none";
|
||||||
|
var searchResults = new SearchResults("searchResults");
|
||||||
|
searchResults.Search();
|
||||||
|
--></script>
|
||||||
|
</div>
|
||||||
|
</body>
|
||||||
|
</html>
|
7
doc/html/search/all_0.js
Executable file
|
@ -0,0 +1,7 @@
|
||||||
|
var searchData=
|
||||||
|
[
|
||||||
|
['emulator_2ec',['emulator.c',['../emulator_8c.html',1,'']]],
|
||||||
|
['emulator_2eh',['emulator.h',['../emulator_8h.html',1,'']]],
|
||||||
|
['execinstruction',['execInstruction',['../emulator_8c.html#a6b5c26779c71916073e7b8f9debea56d',1,'execInstruction(char *instruction): emulator.c'],['../emulator_8h.html#a6b5c26779c71916073e7b8f9debea56d',1,'execInstruction(char *instruction): emulator.c']]],
|
||||||
|
['execprogram',['execProgram',['../emulator_8c.html#a2bbc98d3653ad65ad12757dfa7bdfdd4',1,'execProgram(): emulator.c'],['../emulator_8h.html#a2bbc98d3653ad65ad12757dfa7bdfdd4',1,'execProgram(): emulator.c']]]
|
||||||
|
];
|
26
doc/html/search/all_1.html
Executable file
|
@ -0,0 +1,26 @@
|
||||||
|
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
||||||
|
<html><head><title></title>
|
||||||
|
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
|
||||||
|
<meta name="generator" content="Doxygen 1.8.6">
|
||||||
|
<link rel="stylesheet" type="text/css" href="search.css"/>
|
||||||
|
<script type="text/javascript" src="all_1.js"></script>
|
||||||
|
<script type="text/javascript" src="search.js"></script>
|
||||||
|
</head>
|
||||||
|
<body class="SRPage">
|
||||||
|
<div id="SRIndex">
|
||||||
|
<div class="SRStatus" id="Loading">Loading...</div>
|
||||||
|
<div id="SRResults"></div>
|
||||||
|
<script type="text/javascript"><!--
|
||||||
|
createResults();
|
||||||
|
--></script>
|
||||||
|
<div class="SRStatus" id="Searching">Searching...</div>
|
||||||
|
<div class="SRStatus" id="NoMatches">No Matches</div>
|
||||||
|
<script type="text/javascript"><!--
|
||||||
|
document.getElementById("Loading").style.display="none";
|
||||||
|
document.getElementById("NoMatches").style.display="none";
|
||||||
|
var searchResults = new SearchResults("searchResults");
|
||||||
|
searchResults.Search();
|
||||||
|
--></script>
|
||||||
|
</div>
|
||||||
|
</body>
|
||||||
|
</html>
|
4
doc/html/search/all_1.js
Executable file
|
@ -0,0 +1,4 @@
|
||||||
|
var searchData=
|
||||||
|
[
|
||||||
|
['getarg2',['getArg2',['../emulator_8c.html#ae7178313a4254c62afc060814ebca038',1,'getArg2(char *arg2): emulator.c'],['../emulator_8h.html#ae7178313a4254c62afc060814ebca038',1,'getArg2(char *arg2): emulator.c']]]
|
||||||
|
];
|
26
doc/html/search/all_2.html
Executable file
|
@ -0,0 +1,26 @@
|
||||||
|
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
||||||
|
<html><head><title></title>
|
||||||
|
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
|
||||||
|
<meta name="generator" content="Doxygen 1.8.6">
|
||||||
|
<link rel="stylesheet" type="text/css" href="search.css"/>
|
||||||
|
<script type="text/javascript" src="all_2.js"></script>
|
||||||
|
<script type="text/javascript" src="search.js"></script>
|
||||||
|
</head>
|
||||||
|
<body class="SRPage">
|
||||||
|
<div id="SRIndex">
|
||||||
|
<div class="SRStatus" id="Loading">Loading...</div>
|
||||||
|
<div id="SRResults"></div>
|
||||||
|
<script type="text/javascript"><!--
|
||||||
|
createResults();
|
||||||
|
--></script>
|
||||||
|
<div class="SRStatus" id="Searching">Searching...</div>
|
||||||
|
<div class="SRStatus" id="NoMatches">No Matches</div>
|
||||||
|
<script type="text/javascript"><!--
|
||||||
|
document.getElementById("Loading").style.display="none";
|
||||||
|
document.getElementById("NoMatches").style.display="none";
|
||||||
|
var searchResults = new SearchResults("searchResults");
|
||||||
|
searchResults.Search();
|
||||||
|
--></script>
|
||||||
|
</div>
|
||||||
|
</body>
|
||||||
|
</html>
|
4
doc/html/search/all_2.js
Executable file
|
@ -0,0 +1,4 @@
|
||||||
|
var searchData=
|
||||||
|
[
|
||||||
|
['isvalid',['isValid',['../emulator_8c.html#a40c9c476ef53a0c955d3e633b54d2bd2',1,'isValid(char *opcode, char *arg1, char *arg2): emulator.c'],['../emulator_8h.html#a40c9c476ef53a0c955d3e633b54d2bd2',1,'isValid(char *opcode, char *arg1, char *arg2): emulator.c']]]
|
||||||
|
];
|
26
doc/html/search/all_3.html
Executable file
|
@ -0,0 +1,26 @@
|
||||||
|
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
||||||
|
<html><head><title></title>
|
||||||
|
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
|
||||||
|
<meta name="generator" content="Doxygen 1.8.6">
|
||||||
|
<link rel="stylesheet" type="text/css" href="search.css"/>
|
||||||
|
<script type="text/javascript" src="all_3.js"></script>
|
||||||
|
<script type="text/javascript" src="search.js"></script>
|
||||||
|
</head>
|
||||||
|
<body class="SRPage">
|
||||||
|
<div id="SRIndex">
|
||||||
|
<div class="SRStatus" id="Loading">Loading...</div>
|
||||||
|
<div id="SRResults"></div>
|
||||||
|
<script type="text/javascript"><!--
|
||||||
|
createResults();
|
||||||
|
--></script>
|
||||||
|
<div class="SRStatus" id="Searching">Searching...</div>
|
||||||
|
<div class="SRStatus" id="NoMatches">No Matches</div>
|
||||||
|
<script type="text/javascript"><!--
|
||||||
|
document.getElementById("Loading").style.display="none";
|
||||||
|
document.getElementById("NoMatches").style.display="none";
|
||||||
|
var searchResults = new SearchResults("searchResults");
|
||||||
|
searchResults.Search();
|
||||||
|
--></script>
|
||||||
|
</div>
|
||||||
|
</body>
|
||||||
|
</html>
|
4
doc/html/search/all_3.js
Executable file
|
@ -0,0 +1,4 @@
|
||||||
|
var searchData=
|
||||||
|
[
|
||||||
|
['loadprogram',['loadProgram',['../emulator_8c.html#a3d30edda62d5695ffaa3b62121d4bf98',1,'loadProgram(): emulator.c'],['../emulator_8h.html#a3d30edda62d5695ffaa3b62121d4bf98',1,'loadProgram(): emulator.c']]]
|
||||||
|
];
|
26
doc/html/search/all_4.html
Executable file
|
@ -0,0 +1,26 @@
|
||||||
|
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
||||||
|
<html><head><title></title>
|
||||||
|
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
|
||||||
|
<meta name="generator" content="Doxygen 1.8.6">
|
||||||
|
<link rel="stylesheet" type="text/css" href="search.css"/>
|
||||||
|
<script type="text/javascript" src="all_4.js"></script>
|
||||||
|
<script type="text/javascript" src="search.js"></script>
|
||||||
|
</head>
|
||||||
|
<body class="SRPage">
|
||||||
|
<div id="SRIndex">
|
||||||
|
<div class="SRStatus" id="Loading">Loading...</div>
|
||||||
|
<div id="SRResults"></div>
|
||||||
|
<script type="text/javascript"><!--
|
||||||
|
createResults();
|
||||||
|
--></script>
|
||||||
|
<div class="SRStatus" id="Searching">Searching...</div>
|
||||||
|
<div class="SRStatus" id="NoMatches">No Matches</div>
|
||||||
|
<script type="text/javascript"><!--
|
||||||
|
document.getElementById("Loading").style.display="none";
|
||||||
|
document.getElementById("NoMatches").style.display="none";
|
||||||
|
var searchResults = new SearchResults("searchResults");
|
||||||
|
searchResults.Search();
|
||||||
|
--></script>
|
||||||
|
</div>
|
||||||
|
</body>
|
||||||
|
</html>
|
11
doc/html/search/all_4.js
Executable file
|
@ -0,0 +1,11 @@
|
||||||
|
var searchData=
|
||||||
|
[
|
||||||
|
['main',['main',['../emulator_8c.html#ae66f6b31b5ad750f1fe042a706a4e3d4',1,'emulator.c']]],
|
||||||
|
['mystrchr',['mystrchr',['../mystring_8c.html#a1a18457ecefaaafb354de326065b86f9',1,'mystrchr(char *haystack, const char needle): mystring.c'],['../mystring_8h.html#a1a18457ecefaaafb354de326065b86f9',1,'mystrchr(char *haystack, const char needle): mystring.c']]],
|
||||||
|
['mystrcmp',['mystrcmp',['../mystring_8c.html#a3dab99f21a63ee803be3e9344efda0a0',1,'mystrcmp(const char *s1, const char *s2): mystring.c'],['../mystring_8h.html#a3dab99f21a63ee803be3e9344efda0a0',1,'mystrcmp(const char *s1, const char *s2): mystring.c']]],
|
||||||
|
['mystring_2ec',['mystring.c',['../mystring_8c.html',1,'']]],
|
||||||
|
['mystring_2eh',['mystring.h',['../mystring_8h.html',1,'']]],
|
||||||
|
['mystrlen',['mystrlen',['../mystring_8c.html#aa231246d7f6f97231aa18689cc2ea20a',1,'mystrlen(const char *s): mystring.c'],['../mystring_8h.html#aa231246d7f6f97231aa18689cc2ea20a',1,'mystrlen(const char *s): mystring.c']]],
|
||||||
|
['mystrncmp',['mystrncmp',['../mystring_8c.html#a70913f883a62585fb8fe025aa1e56749',1,'mystrncmp(const char *s1, const char *s2, int n): mystring.c'],['../mystring_8h.html#a70913f883a62585fb8fe025aa1e56749',1,'mystrncmp(const char *s1, const char *s2, int n): mystring.c']]],
|
||||||
|
['mystrstr',['mystrstr',['../mystring_8c.html#ac650f6f569951713296a17edd496f7a5',1,'mystrstr(char *haystack, const char *needle): mystring.c'],['../mystring_8h.html#ac650f6f569951713296a17edd496f7a5',1,'mystrstr(char *haystack, const char *needle): mystring.c']]]
|
||||||
|
];
|
26
doc/html/search/all_5.html
Executable file
|
@ -0,0 +1,26 @@
|
||||||
|
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
||||||
|
<html><head><title></title>
|
||||||
|
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
|
||||||
|
<meta name="generator" content="Doxygen 1.8.6">
|
||||||
|
<link rel="stylesheet" type="text/css" href="search.css"/>
|
||||||
|
<script type="text/javascript" src="all_5.js"></script>
|
||||||
|
<script type="text/javascript" src="search.js"></script>
|
||||||
|
</head>
|
||||||
|
<body class="SRPage">
|
||||||
|
<div id="SRIndex">
|
||||||
|
<div class="SRStatus" id="Loading">Loading...</div>
|
||||||
|
<div id="SRResults"></div>
|
||||||
|
<script type="text/javascript"><!--
|
||||||
|
createResults();
|
||||||
|
--></script>
|
||||||
|
<div class="SRStatus" id="Searching">Searching...</div>
|
||||||
|
<div class="SRStatus" id="NoMatches">No Matches</div>
|
||||||
|
<script type="text/javascript"><!--
|
||||||
|
document.getElementById("Loading").style.display="none";
|
||||||
|
document.getElementById("NoMatches").style.display="none";
|
||||||
|
var searchResults = new SearchResults("searchResults");
|
||||||
|
searchResults.Search();
|
||||||
|
--></script>
|
||||||
|
</div>
|
||||||
|
</body>
|
||||||
|
</html>
|
13
doc/html/search/all_5.js
Executable file
|
@ -0,0 +1,13 @@
|
||||||
|
var searchData=
|
||||||
|
[
|
||||||
|
['opcodeadd',['opcodeADD',['../emulator_8c.html#a501fe22548fd568d37522ba76ff2c1e7',1,'opcodeADD(char *opcode, char *arg1, char *arg2): emulator.c'],['../emulator_8h.html#a501fe22548fd568d37522ba76ff2c1e7',1,'opcodeADD(char *opcode, char *arg1, char *arg2): emulator.c']]],
|
||||||
|
['opcodeand',['opcodeAND',['../emulator_8c.html#a434bd1e8b4e45503586891e565138b84',1,'opcodeAND(char *opcode, char *arg1, char *arg2): emulator.c'],['../emulator_8h.html#a434bd1e8b4e45503586891e565138b84',1,'opcodeAND(char *opcode, char *arg1, char *arg2): emulator.c']]],
|
||||||
|
['opcodejmp',['opcodeJMP',['../emulator_8c.html#a734105640ec0f0c1e6dc8c5384b2d1d0',1,'opcodeJMP(char *opcode, char *arg1, char *arg2): emulator.c'],['../emulator_8h.html#a734105640ec0f0c1e6dc8c5384b2d1d0',1,'opcodeJMP(char *opcode, char *arg1, char *arg2): emulator.c']]],
|
||||||
|
['opcodenop',['opcodeNOP',['../emulator_8c.html#a00e5e1b7c08d6368342756805800133b',1,'opcodeNOP(char *opcode, char *arg1, char *arg2): emulator.c'],['../emulator_8h.html#a00e5e1b7c08d6368342756805800133b',1,'opcodeNOP(char *opcode, char *arg1, char *arg2): emulator.c']]],
|
||||||
|
['opcodeor',['opcodeOR',['../emulator_8c.html#a54c12a24203abe192fe4f727ea9ffe60',1,'opcodeOR(char *opcode, char *arg1, char *arg2): emulator.c'],['../emulator_8h.html#a54c12a24203abe192fe4f727ea9ffe60',1,'opcodeOR(char *opcode, char *arg1, char *arg2): emulator.c']]],
|
||||||
|
['opcodeprt',['opcodePRT',['../emulator_8c.html#aeb406b3428b5429249ab2c7e3d7bcc3c',1,'opcodePRT(char *opcode, char *arg1, char *arg2): emulator.c'],['../emulator_8h.html#aeb406b3428b5429249ab2c7e3d7bcc3c',1,'opcodePRT(char *opcode, char *arg1, char *arg2): emulator.c']]],
|
||||||
|
['opcodeset',['opcodeSET',['../emulator_8c.html#a5d6aac425624196dcd0d278760270d00',1,'opcodeSET(char *opcode, char *arg1, char *arg2): emulator.c'],['../emulator_8h.html#a5d6aac425624196dcd0d278760270d00',1,'opcodeSET(char *opcode, char *arg1, char *arg2): emulator.c']]],
|
||||||
|
['opcodeshl',['opcodeSHL',['../emulator_8c.html#a3cdb2ee632bc1b19d885c26b044d76ae',1,'opcodeSHL(char *opcode, char *arg1, char *arg2): emulator.c'],['../emulator_8h.html#a3cdb2ee632bc1b19d885c26b044d76ae',1,'opcodeSHL(char *opcode, char *arg1, char *arg2): emulator.c']]],
|
||||||
|
['opcodeshr',['opcodeSHR',['../emulator_8c.html#a6f1fa1ff65a606afddb458fcd64449cf',1,'opcodeSHR(char *opcode, char *arg1, char *arg2): emulator.c'],['../emulator_8h.html#a6f1fa1ff65a606afddb458fcd64449cf',1,'opcodeSHR(char *opcode, char *arg1, char *arg2): emulator.c']]],
|
||||||
|
['opcodesub',['opcodeSUB',['../emulator_8c.html#a3ead6beddb4488ab700a81968e30e11c',1,'opcodeSUB(char *opcode, char *arg1, char *arg2): emulator.c'],['../emulator_8h.html#a3ead6beddb4488ab700a81968e30e11c',1,'opcodeSUB(char *opcode, char *arg1, char *arg2): emulator.c']]]
|
||||||
|
];
|
BIN
doc/html/search/close.png
Executable file
After (image error) Size: 273 B |
26
doc/html/search/files_0.html
Executable file
|
@ -0,0 +1,26 @@
|
||||||
|
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
||||||
|
<html><head><title></title>
|
||||||
|
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
|
||||||
|
<meta name="generator" content="Doxygen 1.8.6">
|
||||||
|
<link rel="stylesheet" type="text/css" href="search.css"/>
|
||||||
|
<script type="text/javascript" src="files_0.js"></script>
|
||||||
|
<script type="text/javascript" src="search.js"></script>
|
||||||
|
</head>
|
||||||
|
<body class="SRPage">
|
||||||
|
<div id="SRIndex">
|
||||||
|
<div class="SRStatus" id="Loading">Loading...</div>
|
||||||
|
<div id="SRResults"></div>
|
||||||
|
<script type="text/javascript"><!--
|
||||||
|
createResults();
|
||||||
|
--></script>
|
||||||
|
<div class="SRStatus" id="Searching">Searching...</div>
|
||||||
|
<div class="SRStatus" id="NoMatches">No Matches</div>
|
||||||
|
<script type="text/javascript"><!--
|
||||||
|
document.getElementById("Loading").style.display="none";
|
||||||
|
document.getElementById("NoMatches").style.display="none";
|
||||||
|
var searchResults = new SearchResults("searchResults");
|
||||||
|
searchResults.Search();
|
||||||
|
--></script>
|
||||||
|
</div>
|
||||||
|
</body>
|
||||||
|
</html>
|
5
doc/html/search/files_0.js
Executable file
|
@ -0,0 +1,5 @@
|
||||||
|
var searchData=
|
||||||
|
[
|
||||||
|
['emulator_2ec',['emulator.c',['../emulator_8c.html',1,'']]],
|
||||||
|
['emulator_2eh',['emulator.h',['../emulator_8h.html',1,'']]]
|
||||||
|
];
|
26
doc/html/search/files_1.html
Executable file
|
@ -0,0 +1,26 @@
|
||||||
|
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
||||||
|
<html><head><title></title>
|
||||||
|
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
|
||||||
|
<meta name="generator" content="Doxygen 1.8.6">
|
||||||
|
<link rel="stylesheet" type="text/css" href="search.css"/>
|
||||||
|
<script type="text/javascript" src="files_1.js"></script>
|
||||||
|
<script type="text/javascript" src="search.js"></script>
|
||||||
|
</head>
|
||||||
|
<body class="SRPage">
|
||||||
|
<div id="SRIndex">
|
||||||
|
<div class="SRStatus" id="Loading">Loading...</div>
|
||||||
|
<div id="SRResults"></div>
|
||||||
|
<script type="text/javascript"><!--
|
||||||
|
createResults();
|
||||||
|
--></script>
|
||||||
|
<div class="SRStatus" id="Searching">Searching...</div>
|
||||||
|
<div class="SRStatus" id="NoMatches">No Matches</div>
|
||||||
|
<script type="text/javascript"><!--
|
||||||
|
document.getElementById("Loading").style.display="none";
|
||||||
|
document.getElementById("NoMatches").style.display="none";
|
||||||
|
var searchResults = new SearchResults("searchResults");
|
||||||
|
searchResults.Search();
|
||||||
|
--></script>
|
||||||
|
</div>
|
||||||
|
</body>
|
||||||
|
</html>
|
5
doc/html/search/files_1.js
Executable file
|
@ -0,0 +1,5 @@
|
||||||
|
var searchData=
|
||||||
|
[
|
||||||
|
['mystring_2ec',['mystring.c',['../mystring_8c.html',1,'']]],
|
||||||
|
['mystring_2eh',['mystring.h',['../mystring_8h.html',1,'']]]
|
||||||
|
];
|
26
doc/html/search/functions_0.html
Executable file
|
@ -0,0 +1,26 @@
|
||||||
|
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
||||||
|
<html><head><title></title>
|
||||||
|
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
|
||||||
|
<meta name="generator" content="Doxygen 1.8.6">
|
||||||
|
<link rel="stylesheet" type="text/css" href="search.css"/>
|
||||||
|
<script type="text/javascript" src="functions_0.js"></script>
|
||||||
|
<script type="text/javascript" src="search.js"></script>
|
||||||
|
</head>
|
||||||
|
<body class="SRPage">
|
||||||
|
<div id="SRIndex">
|
||||||
|
<div class="SRStatus" id="Loading">Loading...</div>
|
||||||
|
<div id="SRResults"></div>
|
||||||
|
<script type="text/javascript"><!--
|
||||||
|
createResults();
|
||||||
|
--></script>
|
||||||
|
<div class="SRStatus" id="Searching">Searching...</div>
|
||||||
|
<div class="SRStatus" id="NoMatches">No Matches</div>
|
||||||
|
<script type="text/javascript"><!--
|
||||||
|
document.getElementById("Loading").style.display="none";
|
||||||
|
document.getElementById("NoMatches").style.display="none";
|
||||||
|
var searchResults = new SearchResults("searchResults");
|
||||||
|
searchResults.Search();
|
||||||
|
--></script>
|
||||||
|
</div>
|
||||||
|
</body>
|
||||||
|
</html>
|
5
doc/html/search/functions_0.js
Executable file
|
@ -0,0 +1,5 @@
|
||||||
|
var searchData=
|
||||||
|
[
|
||||||
|
['execinstruction',['execInstruction',['../emulator_8c.html#a6b5c26779c71916073e7b8f9debea56d',1,'execInstruction(char *instruction): emulator.c'],['../emulator_8h.html#a6b5c26779c71916073e7b8f9debea56d',1,'execInstruction(char *instruction): emulator.c']]],
|
||||||
|
['execprogram',['execProgram',['../emulator_8c.html#a2bbc98d3653ad65ad12757dfa7bdfdd4',1,'execProgram(): emulator.c'],['../emulator_8h.html#a2bbc98d3653ad65ad12757dfa7bdfdd4',1,'execProgram(): emulator.c']]]
|
||||||
|
];
|
26
doc/html/search/functions_1.html
Executable file
|
@ -0,0 +1,26 @@
|
||||||
|
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
||||||
|
<html><head><title></title>
|
||||||
|
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
|
||||||
|
<meta name="generator" content="Doxygen 1.8.6">
|
||||||
|
<link rel="stylesheet" type="text/css" href="search.css"/>
|
||||||
|
<script type="text/javascript" src="functions_1.js"></script>
|
||||||
|
<script type="text/javascript" src="search.js"></script>
|
||||||
|
</head>
|
||||||
|
<body class="SRPage">
|
||||||
|
<div id="SRIndex">
|
||||||
|
<div class="SRStatus" id="Loading">Loading...</div>
|
||||||
|
<div id="SRResults"></div>
|
||||||
|
<script type="text/javascript"><!--
|
||||||
|
createResults();
|
||||||
|
--></script>
|
||||||
|
<div class="SRStatus" id="Searching">Searching...</div>
|
||||||
|
<div class="SRStatus" id="NoMatches">No Matches</div>
|
||||||
|
<script type="text/javascript"><!--
|
||||||
|
document.getElementById("Loading").style.display="none";
|
||||||
|
document.getElementById("NoMatches").style.display="none";
|
||||||
|
var searchResults = new SearchResults("searchResults");
|
||||||
|
searchResults.Search();
|
||||||
|
--></script>
|
||||||
|
</div>
|
||||||
|
</body>
|
||||||
|
</html>
|
4
doc/html/search/functions_1.js
Executable file
|
@ -0,0 +1,4 @@
|
||||||
|
var searchData=
|
||||||
|
[
|
||||||
|
['getarg2',['getArg2',['../emulator_8c.html#ae7178313a4254c62afc060814ebca038',1,'getArg2(char *arg2): emulator.c'],['../emulator_8h.html#ae7178313a4254c62afc060814ebca038',1,'getArg2(char *arg2): emulator.c']]]
|
||||||
|
];
|
26
doc/html/search/functions_2.html
Executable file
|
@ -0,0 +1,26 @@
|
||||||
|
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
||||||
|
<html><head><title></title>
|
||||||
|
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
|
||||||
|
<meta name="generator" content="Doxygen 1.8.6">
|
||||||
|
<link rel="stylesheet" type="text/css" href="search.css"/>
|
||||||
|
<script type="text/javascript" src="functions_2.js"></script>
|
||||||
|
<script type="text/javascript" src="search.js"></script>
|
||||||
|
</head>
|
||||||
|
<body class="SRPage">
|
||||||
|
<div id="SRIndex">
|
||||||
|
<div class="SRStatus" id="Loading">Loading...</div>
|
||||||
|
<div id="SRResults"></div>
|
||||||
|
<script type="text/javascript"><!--
|
||||||
|
createResults();
|
||||||
|
--></script>
|
||||||
|
<div class="SRStatus" id="Searching">Searching...</div>
|
||||||
|
<div class="SRStatus" id="NoMatches">No Matches</div>
|
||||||
|
<script type="text/javascript"><!--
|
||||||
|
document.getElementById("Loading").style.display="none";
|
||||||
|
document.getElementById("NoMatches").style.display="none";
|
||||||
|
var searchResults = new SearchResults("searchResults");
|
||||||
|
searchResults.Search();
|
||||||
|
--></script>
|
||||||
|
</div>
|
||||||
|
</body>
|
||||||
|
</html>
|
4
doc/html/search/functions_2.js
Executable file
|
@ -0,0 +1,4 @@
|
||||||
|
var searchData=
|
||||||
|
[
|
||||||
|
['isvalid',['isValid',['../emulator_8c.html#a40c9c476ef53a0c955d3e633b54d2bd2',1,'isValid(char *opcode, char *arg1, char *arg2): emulator.c'],['../emulator_8h.html#a40c9c476ef53a0c955d3e633b54d2bd2',1,'isValid(char *opcode, char *arg1, char *arg2): emulator.c']]]
|
||||||
|
];
|
26
doc/html/search/functions_3.html
Executable file
|
@ -0,0 +1,26 @@
|
||||||
|
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
||||||
|
<html><head><title></title>
|
||||||
|
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
|
||||||
|
<meta name="generator" content="Doxygen 1.8.6">
|
||||||
|
<link rel="stylesheet" type="text/css" href="search.css"/>
|
||||||
|
<script type="text/javascript" src="functions_3.js"></script>
|
||||||
|
<script type="text/javascript" src="search.js"></script>
|
||||||
|
</head>
|
||||||
|
<body class="SRPage">
|
||||||
|
<div id="SRIndex">
|
||||||
|
<div class="SRStatus" id="Loading">Loading...</div>
|
||||||
|
<div id="SRResults"></div>
|
||||||
|
<script type="text/javascript"><!--
|
||||||
|
createResults();
|
||||||
|
--></script>
|
||||||
|
<div class="SRStatus" id="Searching">Searching...</div>
|
||||||
|
<div class="SRStatus" id="NoMatches">No Matches</div>
|
||||||
|
<script type="text/javascript"><!--
|
||||||
|
document.getElementById("Loading").style.display="none";
|
||||||
|
document.getElementById("NoMatches").style.display="none";
|
||||||
|
var searchResults = new SearchResults("searchResults");
|
||||||
|
searchResults.Search();
|
||||||
|
--></script>
|
||||||
|
</div>
|
||||||
|
</body>
|
||||||
|
</html>
|
4
doc/html/search/functions_3.js
Executable file
|
@ -0,0 +1,4 @@
|
||||||
|
var searchData=
|
||||||
|
[
|
||||||
|
['loadprogram',['loadProgram',['../emulator_8c.html#a3d30edda62d5695ffaa3b62121d4bf98',1,'loadProgram(): emulator.c'],['../emulator_8h.html#a3d30edda62d5695ffaa3b62121d4bf98',1,'loadProgram(): emulator.c']]]
|
||||||
|
];
|
26
doc/html/search/functions_4.html
Executable file
|
@ -0,0 +1,26 @@
|
||||||
|
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
||||||
|
<html><head><title></title>
|
||||||
|
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
|
||||||
|
<meta name="generator" content="Doxygen 1.8.6">
|
||||||
|
<link rel="stylesheet" type="text/css" href="search.css"/>
|
||||||
|
<script type="text/javascript" src="functions_4.js"></script>
|
||||||
|
<script type="text/javascript" src="search.js"></script>
|
||||||
|
</head>
|
||||||
|
<body class="SRPage">
|
||||||
|
<div id="SRIndex">
|
||||||
|
<div class="SRStatus" id="Loading">Loading...</div>
|
||||||
|
<div id="SRResults"></div>
|
||||||
|
<script type="text/javascript"><!--
|
||||||
|
createResults();
|
||||||
|
--></script>
|
||||||
|
<div class="SRStatus" id="Searching">Searching...</div>
|
||||||
|
<div class="SRStatus" id="NoMatches">No Matches</div>
|
||||||
|
<script type="text/javascript"><!--
|
||||||
|
document.getElementById("Loading").style.display="none";
|
||||||
|
document.getElementById("NoMatches").style.display="none";
|
||||||
|
var searchResults = new SearchResults("searchResults");
|
||||||
|
searchResults.Search();
|
||||||
|
--></script>
|
||||||
|
</div>
|
||||||
|
</body>
|
||||||
|
</html>
|
9
doc/html/search/functions_4.js
Executable file
|
@ -0,0 +1,9 @@
|
||||||
|
var searchData=
|
||||||
|
[
|
||||||
|
['main',['main',['../emulator_8c.html#ae66f6b31b5ad750f1fe042a706a4e3d4',1,'emulator.c']]],
|
||||||
|
['mystrchr',['mystrchr',['../mystring_8c.html#a1a18457ecefaaafb354de326065b86f9',1,'mystrchr(char *haystack, const char needle): mystring.c'],['../mystring_8h.html#a1a18457ecefaaafb354de326065b86f9',1,'mystrchr(char *haystack, const char needle): mystring.c']]],
|
||||||
|
['mystrcmp',['mystrcmp',['../mystring_8c.html#a3dab99f21a63ee803be3e9344efda0a0',1,'mystrcmp(const char *s1, const char *s2): mystring.c'],['../mystring_8h.html#a3dab99f21a63ee803be3e9344efda0a0',1,'mystrcmp(const char *s1, const char *s2): mystring.c']]],
|
||||||
|
['mystrlen',['mystrlen',['../mystring_8c.html#aa231246d7f6f97231aa18689cc2ea20a',1,'mystrlen(const char *s): mystring.c'],['../mystring_8h.html#aa231246d7f6f97231aa18689cc2ea20a',1,'mystrlen(const char *s): mystring.c']]],
|
||||||
|
['mystrncmp',['mystrncmp',['../mystring_8c.html#a70913f883a62585fb8fe025aa1e56749',1,'mystrncmp(const char *s1, const char *s2, int n): mystring.c'],['../mystring_8h.html#a70913f883a62585fb8fe025aa1e56749',1,'mystrncmp(const char *s1, const char *s2, int n): mystring.c']]],
|
||||||
|
['mystrstr',['mystrstr',['../mystring_8c.html#ac650f6f569951713296a17edd496f7a5',1,'mystrstr(char *haystack, const char *needle): mystring.c'],['../mystring_8h.html#ac650f6f569951713296a17edd496f7a5',1,'mystrstr(char *haystack, const char *needle): mystring.c']]]
|
||||||
|
];
|
26
doc/html/search/functions_5.html
Executable file
|
@ -0,0 +1,26 @@
|
||||||
|
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
||||||
|
<html><head><title></title>
|
||||||
|
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
|
||||||
|
<meta name="generator" content="Doxygen 1.8.6">
|
||||||
|
<link rel="stylesheet" type="text/css" href="search.css"/>
|
||||||
|
<script type="text/javascript" src="functions_5.js"></script>
|
||||||
|
<script type="text/javascript" src="search.js"></script>
|
||||||
|
</head>
|
||||||
|
<body class="SRPage">
|
||||||
|
<div id="SRIndex">
|
||||||
|
<div class="SRStatus" id="Loading">Loading...</div>
|
||||||
|
<div id="SRResults"></div>
|
||||||
|
<script type="text/javascript"><!--
|
||||||
|
createResults();
|
||||||
|
--></script>
|
||||||
|
<div class="SRStatus" id="Searching">Searching...</div>
|
||||||
|
<div class="SRStatus" id="NoMatches">No Matches</div>
|
||||||
|
<script type="text/javascript"><!--
|
||||||
|
document.getElementById("Loading").style.display="none";
|
||||||
|
document.getElementById("NoMatches").style.display="none";
|
||||||
|
var searchResults = new SearchResults("searchResults");
|
||||||
|
searchResults.Search();
|
||||||
|
--></script>
|
||||||
|
</div>
|
||||||
|
</body>
|
||||||
|
</html>
|
13
doc/html/search/functions_5.js
Executable file
|
@ -0,0 +1,13 @@
|
||||||
|
var searchData=
|
||||||
|
[
|
||||||
|
['opcodeadd',['opcodeADD',['../emulator_8c.html#a501fe22548fd568d37522ba76ff2c1e7',1,'opcodeADD(char *opcode, char *arg1, char *arg2): emulator.c'],['../emulator_8h.html#a501fe22548fd568d37522ba76ff2c1e7',1,'opcodeADD(char *opcode, char *arg1, char *arg2): emulator.c']]],
|
||||||
|
['opcodeand',['opcodeAND',['../emulator_8c.html#a434bd1e8b4e45503586891e565138b84',1,'opcodeAND(char *opcode, char *arg1, char *arg2): emulator.c'],['../emulator_8h.html#a434bd1e8b4e45503586891e565138b84',1,'opcodeAND(char *opcode, char *arg1, char *arg2): emulator.c']]],
|
||||||
|
['opcodejmp',['opcodeJMP',['../emulator_8c.html#a734105640ec0f0c1e6dc8c5384b2d1d0',1,'opcodeJMP(char *opcode, char *arg1, char *arg2): emulator.c'],['../emulator_8h.html#a734105640ec0f0c1e6dc8c5384b2d1d0',1,'opcodeJMP(char *opcode, char *arg1, char *arg2): emulator.c']]],
|
||||||
|
['opcodenop',['opcodeNOP',['../emulator_8c.html#a00e5e1b7c08d6368342756805800133b',1,'opcodeNOP(char *opcode, char *arg1, char *arg2): emulator.c'],['../emulator_8h.html#a00e5e1b7c08d6368342756805800133b',1,'opcodeNOP(char *opcode, char *arg1, char *arg2): emulator.c']]],
|
||||||
|
['opcodeor',['opcodeOR',['../emulator_8c.html#a54c12a24203abe192fe4f727ea9ffe60',1,'opcodeOR(char *opcode, char *arg1, char *arg2): emulator.c'],['../emulator_8h.html#a54c12a24203abe192fe4f727ea9ffe60',1,'opcodeOR(char *opcode, char *arg1, char *arg2): emulator.c']]],
|
||||||
|
['opcodeprt',['opcodePRT',['../emulator_8c.html#aeb406b3428b5429249ab2c7e3d7bcc3c',1,'opcodePRT(char *opcode, char *arg1, char *arg2): emulator.c'],['../emulator_8h.html#aeb406b3428b5429249ab2c7e3d7bcc3c',1,'opcodePRT(char *opcode, char *arg1, char *arg2): emulator.c']]],
|
||||||
|
['opcodeset',['opcodeSET',['../emulator_8c.html#a5d6aac425624196dcd0d278760270d00',1,'opcodeSET(char *opcode, char *arg1, char *arg2): emulator.c'],['../emulator_8h.html#a5d6aac425624196dcd0d278760270d00',1,'opcodeSET(char *opcode, char *arg1, char *arg2): emulator.c']]],
|
||||||
|
['opcodeshl',['opcodeSHL',['../emulator_8c.html#a3cdb2ee632bc1b19d885c26b044d76ae',1,'opcodeSHL(char *opcode, char *arg1, char *arg2): emulator.c'],['../emulator_8h.html#a3cdb2ee632bc1b19d885c26b044d76ae',1,'opcodeSHL(char *opcode, char *arg1, char *arg2): emulator.c']]],
|
||||||
|
['opcodeshr',['opcodeSHR',['../emulator_8c.html#a6f1fa1ff65a606afddb458fcd64449cf',1,'opcodeSHR(char *opcode, char *arg1, char *arg2): emulator.c'],['../emulator_8h.html#a6f1fa1ff65a606afddb458fcd64449cf',1,'opcodeSHR(char *opcode, char *arg1, char *arg2): emulator.c']]],
|
||||||
|
['opcodesub',['opcodeSUB',['../emulator_8c.html#a3ead6beddb4488ab700a81968e30e11c',1,'opcodeSUB(char *opcode, char *arg1, char *arg2): emulator.c'],['../emulator_8h.html#a3ead6beddb4488ab700a81968e30e11c',1,'opcodeSUB(char *opcode, char *arg1, char *arg2): emulator.c']]]
|
||||||
|
];
|
BIN
doc/html/search/mag_sel.png
Executable file
After (image error) Size: 563 B |
12
doc/html/search/nomatches.html
Executable file
|
@ -0,0 +1,12 @@
|
||||||
|
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
||||||
|
<html><head><title></title>
|
||||||
|
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
|
||||||
|
<link rel="stylesheet" type="text/css" href="search.css"/>
|
||||||
|
<script type="text/javascript" src="search.js"></script>
|
||||||
|
</head>
|
||||||
|
<body class="SRPage">
|
||||||
|
<div id="SRIndex">
|
||||||
|
<div class="SRStatus" id="NoMatches">No Matches</div>
|
||||||
|
</div>
|
||||||
|
</body>
|
||||||
|
</html>
|
271
doc/html/search/search.css
Executable file
|
@ -0,0 +1,271 @@
|
||||||
|
/*---------------- Search Box */
|
||||||
|
|
||||||
|
#FSearchBox {
|
||||||
|
float: left;
|
||||||
|
}
|
||||||
|
|
||||||
|
#MSearchBox {
|
||||||
|
white-space : nowrap;
|
||||||
|
position: absolute;
|
||||||
|
float: none;
|
||||||
|
display: inline;
|
||||||
|
margin-top: 8px;
|
||||||
|
right: 0px;
|
||||||
|
width: 170px;
|
||||||
|
z-index: 102;
|
||||||
|
background-color: white;
|
||||||
|
}
|
||||||
|
|
||||||
|
#MSearchBox .left
|
||||||
|
{
|
||||||
|
display:block;
|
||||||
|
position:absolute;
|
||||||
|
left:10px;
|
||||||
|
width:20px;
|
||||||
|
height:19px;
|
||||||
|
background:url('search_l.png') no-repeat;
|
||||||
|
background-position:right;
|
||||||
|
}
|
||||||
|
|
||||||
|
#MSearchSelect {
|
||||||
|
display:block;
|
||||||
|
position:absolute;
|
||||||
|
width:20px;
|
||||||
|
height:19px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.left #MSearchSelect {
|
||||||
|
left:4px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.right #MSearchSelect {
|
||||||
|
right:5px;
|
||||||
|
}
|
||||||
|
|
||||||
|
#MSearchField {
|
||||||
|
display:block;
|
||||||
|
position:absolute;
|
||||||
|
height:19px;
|
||||||
|
background:url('search_m.png') repeat-x;
|
||||||
|
border:none;
|
||||||
|
width:111px;
|
||||||
|
margin-left:20px;
|
||||||
|
padding-left:4px;
|
||||||
|
color: #909090;
|
||||||
|
outline: none;
|
||||||
|
font: 9pt Arial, Verdana, sans-serif;
|
||||||
|
}
|
||||||
|
|
||||||
|
#FSearchBox #MSearchField {
|
||||||
|
margin-left:15px;
|
||||||
|
}
|
||||||
|
|
||||||
|
#MSearchBox .right {
|
||||||
|
display:block;
|
||||||
|
position:absolute;
|
||||||
|
right:10px;
|
||||||
|
top:0px;
|
||||||
|
width:20px;
|
||||||
|
height:19px;
|
||||||
|
background:url('search_r.png') no-repeat;
|
||||||
|
background-position:left;
|
||||||
|
}
|
||||||
|
|
||||||
|
#MSearchClose {
|
||||||
|
display: none;
|
||||||
|
position: absolute;
|
||||||
|
top: 4px;
|
||||||
|
background : none;
|
||||||
|
border: none;
|
||||||
|
margin: 0px 4px 0px 0px;
|
||||||
|
padding: 0px 0px;
|
||||||
|
outline: none;
|
||||||
|
}
|
||||||
|
|
||||||
|
.left #MSearchClose {
|
||||||
|
left: 6px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.right #MSearchClose {
|
||||||
|
right: 2px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.MSearchBoxActive #MSearchField {
|
||||||
|
color: #000000;
|
||||||
|
}
|
||||||
|
|
||||||
|
/*---------------- Search filter selection */
|
||||||
|
|
||||||
|
#MSearchSelectWindow {
|
||||||
|
display: none;
|
||||||
|
position: absolute;
|
||||||
|
left: 0; top: 0;
|
||||||
|
border: 1px solid #90A5CE;
|
||||||
|
background-color: #F9FAFC;
|
||||||
|
z-index: 1;
|
||||||
|
padding-top: 4px;
|
||||||
|
padding-bottom: 4px;
|
||||||
|
-moz-border-radius: 4px;
|
||||||
|
-webkit-border-top-left-radius: 4px;
|
||||||
|
-webkit-border-top-right-radius: 4px;
|
||||||
|
-webkit-border-bottom-left-radius: 4px;
|
||||||
|
-webkit-border-bottom-right-radius: 4px;
|
||||||
|
-webkit-box-shadow: 5px 5px 5px rgba(0, 0, 0, 0.15);
|
||||||
|
}
|
||||||
|
|
||||||
|
.SelectItem {
|
||||||
|
font: 8pt Arial, Verdana, sans-serif;
|
||||||
|
padding-left: 2px;
|
||||||
|
padding-right: 12px;
|
||||||
|
border: 0px;
|
||||||
|
}
|
||||||
|
|
||||||
|
span.SelectionMark {
|
||||||
|
margin-right: 4px;
|
||||||
|
font-family: monospace;
|
||||||
|
outline-style: none;
|
||||||
|
text-decoration: none;
|
||||||
|
}
|
||||||
|
|
||||||
|
a.SelectItem {
|
||||||
|
display: block;
|
||||||
|
outline-style: none;
|
||||||
|
color: #000000;
|
||||||
|
text-decoration: none;
|
||||||
|
padding-left: 6px;
|
||||||
|
padding-right: 12px;
|
||||||
|
}
|
||||||
|
|
||||||
|
a.SelectItem:focus,
|
||||||
|
a.SelectItem:active {
|
||||||
|
color: #000000;
|
||||||
|
outline-style: none;
|
||||||
|
text-decoration: none;
|
||||||
|
}
|
||||||
|
|
||||||
|
a.SelectItem:hover {
|
||||||
|
color: #FFFFFF;
|
||||||
|
background-color: #3D578C;
|
||||||
|
outline-style: none;
|
||||||
|
text-decoration: none;
|
||||||
|
cursor: pointer;
|
||||||
|
display: block;
|
||||||
|
}
|
||||||
|
|
||||||
|
/*---------------- Search results window */
|
||||||
|
|
||||||
|
iframe#MSearchResults {
|
||||||
|
width: 60ex;
|
||||||
|
height: 15em;
|
||||||
|
}
|
||||||
|
|
||||||
|
#MSearchResultsWindow {
|
||||||
|
display: none;
|
||||||
|
position: absolute;
|
||||||
|
left: 0; top: 0;
|
||||||
|
border: 1px solid #000;
|
||||||
|
background-color: #EEF1F7;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* ----------------------------------- */
|
||||||
|
|
||||||
|
|
||||||
|
#SRIndex {
|
||||||
|
clear:both;
|
||||||
|
padding-bottom: 15px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.SREntry {
|
||||||
|
font-size: 10pt;
|
||||||
|
padding-left: 1ex;
|
||||||
|
}
|
||||||
|
|
||||||
|
.SRPage .SREntry {
|
||||||
|
font-size: 8pt;
|
||||||
|
padding: 1px 5px;
|
||||||
|
}
|
||||||
|
|
||||||
|
body.SRPage {
|
||||||
|
margin: 5px 2px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.SRChildren {
|
||||||
|
padding-left: 3ex; padding-bottom: .5em
|
||||||
|
}
|
||||||
|
|
||||||
|
.SRPage .SRChildren {
|
||||||
|
display: none;
|
||||||
|
}
|
||||||
|
|
||||||
|
.SRSymbol {
|
||||||
|
font-weight: bold;
|
||||||
|
color: #425E97;
|
||||||
|
font-family: Arial, Verdana, sans-serif;
|
||||||
|
text-decoration: none;
|
||||||
|
outline: none;
|
||||||
|
}
|
||||||
|
|
||||||
|
a.SRScope {
|
||||||
|
display: block;
|
||||||
|
color: #425E97;
|
||||||
|
font-family: Arial, Verdana, sans-serif;
|
||||||
|
text-decoration: none;
|
||||||
|
outline: none;
|
||||||
|
}
|
||||||
|
|
||||||
|
a.SRSymbol:focus, a.SRSymbol:active,
|
||||||
|
a.SRScope:focus, a.SRScope:active {
|
||||||
|
text-decoration: underline;
|
||||||
|
}
|
||||||
|
|
||||||
|
span.SRScope {
|
||||||
|
padding-left: 4px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.SRPage .SRStatus {
|
||||||
|
padding: 2px 5px;
|
||||||
|
font-size: 8pt;
|
||||||
|
font-style: italic;
|
||||||
|
}
|
||||||
|
|
||||||
|
.SRResult {
|
||||||
|
display: none;
|
||||||
|
}
|
||||||
|
|
||||||
|
DIV.searchresults {
|
||||||
|
margin-left: 10px;
|
||||||
|
margin-right: 10px;
|
||||||
|
}
|
||||||
|
|
||||||
|
/*---------------- External search page results */
|
||||||
|
|
||||||
|
.searchresult {
|
||||||
|
background-color: #F0F3F8;
|
||||||
|
}
|
||||||
|
|
||||||
|
.pages b {
|
||||||
|
color: white;
|
||||||
|
padding: 5px 5px 3px 5px;
|
||||||
|
background-image: url("../tab_a.png");
|
||||||
|
background-repeat: repeat-x;
|
||||||
|
text-shadow: 0 1px 1px #000000;
|
||||||
|
}
|
||||||
|
|
||||||
|
.pages {
|
||||||
|
line-height: 17px;
|
||||||
|
margin-left: 4px;
|
||||||
|
text-decoration: none;
|
||||||
|
}
|
||||||
|
|
||||||
|
.hl {
|
||||||
|
font-weight: bold;
|
||||||
|
}
|
||||||
|
|
||||||
|
#searchresults {
|
||||||
|
margin-bottom: 20px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.searchpages {
|
||||||
|
margin-top: 10px;
|
||||||
|
}
|
||||||
|
|
797
doc/html/search/search.js
Executable file
|
@ -0,0 +1,797 @@
|
||||||
|
// Search script generated by doxygen
|
||||||
|
// Copyright (C) 2009 by Dimitri van Heesch.
|
||||||
|
|
||||||
|
// The code in this file is loosly based on main.js, part of Natural Docs,
|
||||||
|
// which is Copyright (C) 2003-2008 Greg Valure
|
||||||
|
// Natural Docs is licensed under the GPL.
|
||||||
|
|
||||||
|
var indexSectionsWithContent =
|
||||||
|
{
|
||||||
|
0: "egilmo",
|
||||||
|
1: "em",
|
||||||
|
2: "egilmo"
|
||||||
|
};
|
||||||
|
|
||||||
|
var indexSectionNames =
|
||||||
|
{
|
||||||
|
0: "all",
|
||||||
|
1: "files",
|
||||||
|
2: "functions"
|
||||||
|
};
|
||||||
|
|
||||||
|
function convertToId(search)
|
||||||
|
{
|
||||||
|
var result = '';
|
||||||
|
for (i=0;i<search.length;i++)
|
||||||
|
{
|
||||||
|
var c = search.charAt(i);
|
||||||
|
var cn = c.charCodeAt(0);
|
||||||
|
if (c.match(/[a-z0-9\u0080-\uFFFF]/))
|
||||||
|
{
|
||||||
|
result+=c;
|
||||||
|
}
|
||||||
|
else if (cn<16)
|
||||||
|
{
|
||||||
|
result+="_0"+cn.toString(16);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
result+="_"+cn.toString(16);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
|
function getXPos(item)
|
||||||
|
{
|
||||||
|
var x = 0;
|
||||||
|
if (item.offsetWidth)
|
||||||
|
{
|
||||||
|
while (item && item!=document.body)
|
||||||
|
{
|
||||||
|
x += item.offsetLeft;
|
||||||
|
item = item.offsetParent;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return x;
|
||||||
|
}
|
||||||
|
|
||||||
|
function getYPos(item)
|
||||||
|
{
|
||||||
|
var y = 0;
|
||||||
|
if (item.offsetWidth)
|
||||||
|
{
|
||||||
|
while (item && item!=document.body)
|
||||||
|
{
|
||||||
|
y += item.offsetTop;
|
||||||
|
item = item.offsetParent;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return y;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* A class handling everything associated with the search panel.
|
||||||
|
|
||||||
|
Parameters:
|
||||||
|
name - The name of the global variable that will be
|
||||||
|
storing this instance. Is needed to be able to set timeouts.
|
||||||
|
resultPath - path to use for external files
|
||||||
|
*/
|
||||||
|
function SearchBox(name, resultsPath, inFrame, label)
|
||||||
|
{
|
||||||
|
if (!name || !resultsPath) { alert("Missing parameters to SearchBox."); }
|
||||||
|
|
||||||
|
// ---------- Instance variables
|
||||||
|
this.name = name;
|
||||||
|
this.resultsPath = resultsPath;
|
||||||
|
this.keyTimeout = 0;
|
||||||
|
this.keyTimeoutLength = 500;
|
||||||
|
this.closeSelectionTimeout = 300;
|
||||||
|
this.lastSearchValue = "";
|
||||||
|
this.lastResultsPage = "";
|
||||||
|
this.hideTimeout = 0;
|
||||||
|
this.searchIndex = 0;
|
||||||
|
this.searchActive = false;
|
||||||
|
this.insideFrame = inFrame;
|
||||||
|
this.searchLabel = label;
|
||||||
|
|
||||||
|
// ----------- DOM Elements
|
||||||
|
|
||||||
|
this.DOMSearchField = function()
|
||||||
|
{ return document.getElementById("MSearchField"); }
|
||||||
|
|
||||||
|
this.DOMSearchSelect = function()
|
||||||
|
{ return document.getElementById("MSearchSelect"); }
|
||||||
|
|
||||||
|
this.DOMSearchSelectWindow = function()
|
||||||
|
{ return document.getElementById("MSearchSelectWindow"); }
|
||||||
|
|
||||||
|
this.DOMPopupSearchResults = function()
|
||||||
|
{ return document.getElementById("MSearchResults"); }
|
||||||
|
|
||||||
|
this.DOMPopupSearchResultsWindow = function()
|
||||||
|
{ return document.getElementById("MSearchResultsWindow"); }
|
||||||
|
|
||||||
|
this.DOMSearchClose = function()
|
||||||
|
{ return document.getElementById("MSearchClose"); }
|
||||||
|
|
||||||
|
this.DOMSearchBox = function()
|
||||||
|
{ return document.getElementById("MSearchBox"); }
|
||||||
|
|
||||||
|
// ------------ Event Handlers
|
||||||
|
|
||||||
|
// Called when focus is added or removed from the search field.
|
||||||
|
this.OnSearchFieldFocus = function(isActive)
|
||||||
|
{
|
||||||
|
this.Activate(isActive);
|
||||||
|
}
|
||||||
|
|
||||||
|
this.OnSearchSelectShow = function()
|
||||||
|
{
|
||||||
|
var searchSelectWindow = this.DOMSearchSelectWindow();
|
||||||
|
var searchField = this.DOMSearchSelect();
|
||||||
|
|
||||||
|
if (this.insideFrame)
|
||||||
|
{
|
||||||
|
var left = getXPos(searchField);
|
||||||
|
var top = getYPos(searchField);
|
||||||
|
left += searchField.offsetWidth + 6;
|
||||||
|
top += searchField.offsetHeight;
|
||||||
|
|
||||||
|
// show search selection popup
|
||||||
|
searchSelectWindow.style.display='block';
|
||||||
|
left -= searchSelectWindow.offsetWidth;
|
||||||
|
searchSelectWindow.style.left = left + 'px';
|
||||||
|
searchSelectWindow.style.top = top + 'px';
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
var left = getXPos(searchField);
|
||||||
|
var top = getYPos(searchField);
|
||||||
|
top += searchField.offsetHeight;
|
||||||
|
|
||||||
|
// show search selection popup
|
||||||
|
searchSelectWindow.style.display='block';
|
||||||
|
searchSelectWindow.style.left = left + 'px';
|
||||||
|
searchSelectWindow.style.top = top + 'px';
|
||||||
|
}
|
||||||
|
|
||||||
|
// stop selection hide timer
|
||||||
|
if (this.hideTimeout)
|
||||||
|
{
|
||||||
|
clearTimeout(this.hideTimeout);
|
||||||
|
this.hideTimeout=0;
|
||||||
|
}
|
||||||
|
return false; // to avoid "image drag" default event
|
||||||
|
}
|
||||||
|
|
||||||
|
this.OnSearchSelectHide = function()
|
||||||
|
{
|
||||||
|
this.hideTimeout = setTimeout(this.name +".CloseSelectionWindow()",
|
||||||
|
this.closeSelectionTimeout);
|
||||||
|
}
|
||||||
|
|
||||||
|
// Called when the content of the search field is changed.
|
||||||
|
this.OnSearchFieldChange = function(evt)
|
||||||
|
{
|
||||||
|
if (this.keyTimeout) // kill running timer
|
||||||
|
{
|
||||||
|
clearTimeout(this.keyTimeout);
|
||||||
|
this.keyTimeout = 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
var e = (evt) ? evt : window.event; // for IE
|
||||||
|
if (e.keyCode==40 || e.keyCode==13)
|
||||||
|
{
|
||||||
|
if (e.shiftKey==1)
|
||||||
|
{
|
||||||
|
this.OnSearchSelectShow();
|
||||||
|
var win=this.DOMSearchSelectWindow();
|
||||||
|
for (i=0;i<win.childNodes.length;i++)
|
||||||
|
{
|
||||||
|
var child = win.childNodes[i]; // get span within a
|
||||||
|
if (child.className=='SelectItem')
|
||||||
|
{
|
||||||
|
child.focus();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
else if (window.frames.MSearchResults.searchResults)
|
||||||
|
{
|
||||||
|
var elem = window.frames.MSearchResults.searchResults.NavNext(0);
|
||||||
|
if (elem) elem.focus();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else if (e.keyCode==27) // Escape out of the search field
|
||||||
|
{
|
||||||
|
this.DOMSearchField().blur();
|
||||||
|
this.DOMPopupSearchResultsWindow().style.display = 'none';
|
||||||
|
this.DOMSearchClose().style.display = 'none';
|
||||||
|
this.lastSearchValue = '';
|
||||||
|
this.Activate(false);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
// strip whitespaces
|
||||||
|
var searchValue = this.DOMSearchField().value.replace(/ +/g, "");
|
||||||
|
|
||||||
|
if (searchValue != this.lastSearchValue) // search value has changed
|
||||||
|
{
|
||||||
|
if (searchValue != "") // non-empty search
|
||||||
|
{
|
||||||
|
// set timer for search update
|
||||||
|
this.keyTimeout = setTimeout(this.name + '.Search()',
|
||||||
|
this.keyTimeoutLength);
|
||||||
|
}
|
||||||
|
else // empty search field
|
||||||
|
{
|
||||||
|
this.DOMPopupSearchResultsWindow().style.display = 'none';
|
||||||
|
this.DOMSearchClose().style.display = 'none';
|
||||||
|
this.lastSearchValue = '';
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
this.SelectItemCount = function(id)
|
||||||
|
{
|
||||||
|
var count=0;
|
||||||
|
var win=this.DOMSearchSelectWindow();
|
||||||
|
for (i=0;i<win.childNodes.length;i++)
|
||||||
|
{
|
||||||
|
var child = win.childNodes[i]; // get span within a
|
||||||
|
if (child.className=='SelectItem')
|
||||||
|
{
|
||||||
|
count++;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return count;
|
||||||
|
}
|
||||||
|
|
||||||
|
this.SelectItemSet = function(id)
|
||||||
|
{
|
||||||
|
var i,j=0;
|
||||||
|
var win=this.DOMSearchSelectWindow();
|
||||||
|
for (i=0;i<win.childNodes.length;i++)
|
||||||
|
{
|
||||||
|
var child = win.childNodes[i]; // get span within a
|
||||||
|
if (child.className=='SelectItem')
|
||||||
|
{
|
||||||
|
var node = child.firstChild;
|
||||||
|
if (j==id)
|
||||||
|
{
|
||||||
|
node.innerHTML='•';
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
node.innerHTML=' ';
|
||||||
|
}
|
||||||
|
j++;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Called when an search filter selection is made.
|
||||||
|
// set item with index id as the active item
|
||||||
|
this.OnSelectItem = function(id)
|
||||||
|
{
|
||||||
|
this.searchIndex = id;
|
||||||
|
this.SelectItemSet(id);
|
||||||
|
var searchValue = this.DOMSearchField().value.replace(/ +/g, "");
|
||||||
|
if (searchValue!="" && this.searchActive) // something was found -> do a search
|
||||||
|
{
|
||||||
|
this.Search();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
this.OnSearchSelectKey = function(evt)
|
||||||
|
{
|
||||||
|
var e = (evt) ? evt : window.event; // for IE
|
||||||
|
if (e.keyCode==40 && this.searchIndex<this.SelectItemCount()) // Down
|
||||||
|
{
|
||||||
|
this.searchIndex++;
|
||||||
|
this.OnSelectItem(this.searchIndex);
|
||||||
|
}
|
||||||
|
else if (e.keyCode==38 && this.searchIndex>0) // Up
|
||||||
|
{
|
||||||
|
this.searchIndex--;
|
||||||
|
this.OnSelectItem(this.searchIndex);
|
||||||
|
}
|
||||||
|
else if (e.keyCode==13 || e.keyCode==27)
|
||||||
|
{
|
||||||
|
this.OnSelectItem(this.searchIndex);
|
||||||
|
this.CloseSelectionWindow();
|
||||||
|
this.DOMSearchField().focus();
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
// --------- Actions
|
||||||
|
|
||||||
|
// Closes the results window.
|
||||||
|
this.CloseResultsWindow = function()
|
||||||
|
{
|
||||||
|
this.DOMPopupSearchResultsWindow().style.display = 'none';
|
||||||
|
this.DOMSearchClose().style.display = 'none';
|
||||||
|
this.Activate(false);
|
||||||
|
}
|
||||||
|
|
||||||
|
this.CloseSelectionWindow = function()
|
||||||
|
{
|
||||||
|
this.DOMSearchSelectWindow().style.display = 'none';
|
||||||
|
}
|
||||||
|
|
||||||
|
// Performs a search.
|
||||||
|
this.Search = function()
|
||||||
|
{
|
||||||
|
this.keyTimeout = 0;
|
||||||
|
|
||||||
|
// strip leading whitespace
|
||||||
|
var searchValue = this.DOMSearchField().value.replace(/^ +/, "");
|
||||||
|
|
||||||
|
var code = searchValue.toLowerCase().charCodeAt(0);
|
||||||
|
var idxChar = searchValue.substr(0, 1).toLowerCase();
|
||||||
|
if ( 0xD800 <= code && code <= 0xDBFF && searchValue > 1) // surrogate pair
|
||||||
|
{
|
||||||
|
idxChar = searchValue.substr(0, 2);
|
||||||
|
}
|
||||||
|
|
||||||
|
var resultsPage;
|
||||||
|
var resultsPageWithSearch;
|
||||||
|
var hasResultsPage;
|
||||||
|
|
||||||
|
var idx = indexSectionsWithContent[this.searchIndex].indexOf(idxChar);
|
||||||
|
if (idx!=-1)
|
||||||
|
{
|
||||||
|
var hexCode=idx.toString(16);
|
||||||
|
resultsPage = this.resultsPath + '/' + indexSectionNames[this.searchIndex] + '_' + hexCode + '.html';
|
||||||
|
resultsPageWithSearch = resultsPage+'?'+escape(searchValue);
|
||||||
|
hasResultsPage = true;
|
||||||
|
}
|
||||||
|
else // nothing available for this search term
|
||||||
|
{
|
||||||
|
resultsPage = this.resultsPath + '/nomatches.html';
|
||||||
|
resultsPageWithSearch = resultsPage;
|
||||||
|
hasResultsPage = false;
|
||||||
|
}
|
||||||
|
|
||||||
|
window.frames.MSearchResults.location = resultsPageWithSearch;
|
||||||
|
var domPopupSearchResultsWindow = this.DOMPopupSearchResultsWindow();
|
||||||
|
|
||||||
|
if (domPopupSearchResultsWindow.style.display!='block')
|
||||||
|
{
|
||||||
|
var domSearchBox = this.DOMSearchBox();
|
||||||
|
this.DOMSearchClose().style.display = 'inline';
|
||||||
|
if (this.insideFrame)
|
||||||
|
{
|
||||||
|
var domPopupSearchResults = this.DOMPopupSearchResults();
|
||||||
|
domPopupSearchResultsWindow.style.position = 'relative';
|
||||||
|
domPopupSearchResultsWindow.style.display = 'block';
|
||||||
|
var width = document.body.clientWidth - 8; // the -8 is for IE :-(
|
||||||
|
domPopupSearchResultsWindow.style.width = width + 'px';
|
||||||
|
domPopupSearchResults.style.width = width + 'px';
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
var domPopupSearchResults = this.DOMPopupSearchResults();
|
||||||
|
var left = getXPos(domSearchBox) + 150; // domSearchBox.offsetWidth;
|
||||||
|
var top = getYPos(domSearchBox) + 20; // domSearchBox.offsetHeight + 1;
|
||||||
|
domPopupSearchResultsWindow.style.display = 'block';
|
||||||
|
left -= domPopupSearchResults.offsetWidth;
|
||||||
|
domPopupSearchResultsWindow.style.top = top + 'px';
|
||||||
|
domPopupSearchResultsWindow.style.left = left + 'px';
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
this.lastSearchValue = searchValue;
|
||||||
|
this.lastResultsPage = resultsPage;
|
||||||
|
}
|
||||||
|
|
||||||
|
// -------- Activation Functions
|
||||||
|
|
||||||
|
// Activates or deactivates the search panel, resetting things to
|
||||||
|
// their default values if necessary.
|
||||||
|
this.Activate = function(isActive)
|
||||||
|
{
|
||||||
|
if (isActive || // open it
|
||||||
|
this.DOMPopupSearchResultsWindow().style.display == 'block'
|
||||||
|
)
|
||||||
|
{
|
||||||
|
this.DOMSearchBox().className = 'MSearchBoxActive';
|
||||||
|
|
||||||
|
var searchField = this.DOMSearchField();
|
||||||
|
|
||||||
|
if (searchField.value == this.searchLabel) // clear "Search" term upon entry
|
||||||
|
{
|
||||||
|
searchField.value = '';
|
||||||
|
this.searchActive = true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else if (!isActive) // directly remove the panel
|
||||||
|
{
|
||||||
|
this.DOMSearchBox().className = 'MSearchBoxInactive';
|
||||||
|
this.DOMSearchField().value = this.searchLabel;
|
||||||
|
this.searchActive = false;
|
||||||
|
this.lastSearchValue = ''
|
||||||
|
this.lastResultsPage = '';
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// -----------------------------------------------------------------------
|
||||||
|
|
||||||
|
// The class that handles everything on the search results page.
|
||||||
|
function SearchResults(name)
|
||||||
|
{
|
||||||
|
// The number of matches from the last run of <Search()>.
|
||||||
|
this.lastMatchCount = 0;
|
||||||
|
this.lastKey = 0;
|
||||||
|
this.repeatOn = false;
|
||||||
|
|
||||||
|
// Toggles the visibility of the passed element ID.
|
||||||
|
this.FindChildElement = function(id)
|
||||||
|
{
|
||||||
|
var parentElement = document.getElementById(id);
|
||||||
|
var element = parentElement.firstChild;
|
||||||
|
|
||||||
|
while (element && element!=parentElement)
|
||||||
|
{
|
||||||
|
if (element.nodeName == 'DIV' && element.className == 'SRChildren')
|
||||||
|
{
|
||||||
|
return element;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (element.nodeName == 'DIV' && element.hasChildNodes())
|
||||||
|
{
|
||||||
|
element = element.firstChild;
|
||||||
|
}
|
||||||
|
else if (element.nextSibling)
|
||||||
|
{
|
||||||
|
element = element.nextSibling;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
do
|
||||||
|
{
|
||||||
|
element = element.parentNode;
|
||||||
|
}
|
||||||
|
while (element && element!=parentElement && !element.nextSibling);
|
||||||
|
|
||||||
|
if (element && element!=parentElement)
|
||||||
|
{
|
||||||
|
element = element.nextSibling;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
this.Toggle = function(id)
|
||||||
|
{
|
||||||
|
var element = this.FindChildElement(id);
|
||||||
|
if (element)
|
||||||
|
{
|
||||||
|
if (element.style.display == 'block')
|
||||||
|
{
|
||||||
|
element.style.display = 'none';
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
element.style.display = 'block';
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Searches for the passed string. If there is no parameter,
|
||||||
|
// it takes it from the URL query.
|
||||||
|
//
|
||||||
|
// Always returns true, since other documents may try to call it
|
||||||
|
// and that may or may not be possible.
|
||||||
|
this.Search = function(search)
|
||||||
|
{
|
||||||
|
if (!search) // get search word from URL
|
||||||
|
{
|
||||||
|
search = window.location.search;
|
||||||
|
search = search.substring(1); // Remove the leading '?'
|
||||||
|
search = unescape(search);
|
||||||
|
}
|
||||||
|
|
||||||
|
search = search.replace(/^ +/, ""); // strip leading spaces
|
||||||
|
search = search.replace(/ +$/, ""); // strip trailing spaces
|
||||||
|
search = search.toLowerCase();
|
||||||
|
search = convertToId(search);
|
||||||
|
|
||||||
|
var resultRows = document.getElementsByTagName("div");
|
||||||
|
var matches = 0;
|
||||||
|
|
||||||
|
var i = 0;
|
||||||
|
while (i < resultRows.length)
|
||||||
|
{
|
||||||
|
var row = resultRows.item(i);
|
||||||
|
if (row.className == "SRResult")
|
||||||
|
{
|
||||||
|
var rowMatchName = row.id.toLowerCase();
|
||||||
|
rowMatchName = rowMatchName.replace(/^sr\d*_/, ''); // strip 'sr123_'
|
||||||
|
|
||||||
|
if (search.length<=rowMatchName.length &&
|
||||||
|
rowMatchName.substr(0, search.length)==search)
|
||||||
|
{
|
||||||
|
row.style.display = 'block';
|
||||||
|
matches++;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
row.style.display = 'none';
|
||||||
|
}
|
||||||
|
}
|
||||||
|
i++;
|
||||||
|
}
|
||||||
|
document.getElementById("Searching").style.display='none';
|
||||||
|
if (matches == 0) // no results
|
||||||
|
{
|
||||||
|
document.getElementById("NoMatches").style.display='block';
|
||||||
|
}
|
||||||
|
else // at least one result
|
||||||
|
{
|
||||||
|
document.getElementById("NoMatches").style.display='none';
|
||||||
|
}
|
||||||
|
this.lastMatchCount = matches;
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
// return the first item with index index or higher that is visible
|
||||||
|
this.NavNext = function(index)
|
||||||
|
{
|
||||||
|
var focusItem;
|
||||||
|
while (1)
|
||||||
|
{
|
||||||
|
var focusName = 'Item'+index;
|
||||||
|
focusItem = document.getElementById(focusName);
|
||||||
|
if (focusItem && focusItem.parentNode.parentNode.style.display=='block')
|
||||||
|
{
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
else if (!focusItem) // last element
|
||||||
|
{
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
focusItem=null;
|
||||||
|
index++;
|
||||||
|
}
|
||||||
|
return focusItem;
|
||||||
|
}
|
||||||
|
|
||||||
|
this.NavPrev = function(index)
|
||||||
|
{
|
||||||
|
var focusItem;
|
||||||
|
while (1)
|
||||||
|
{
|
||||||
|
var focusName = 'Item'+index;
|
||||||
|
focusItem = document.getElementById(focusName);
|
||||||
|
if (focusItem && focusItem.parentNode.parentNode.style.display=='block')
|
||||||
|
{
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
else if (!focusItem) // last element
|
||||||
|
{
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
focusItem=null;
|
||||||
|
index--;
|
||||||
|
}
|
||||||
|
return focusItem;
|
||||||
|
}
|
||||||
|
|
||||||
|
this.ProcessKeys = function(e)
|
||||||
|
{
|
||||||
|
if (e.type == "keydown")
|
||||||
|
{
|
||||||
|
this.repeatOn = false;
|
||||||
|
this.lastKey = e.keyCode;
|
||||||
|
}
|
||||||
|
else if (e.type == "keypress")
|
||||||
|
{
|
||||||
|
if (!this.repeatOn)
|
||||||
|
{
|
||||||
|
if (this.lastKey) this.repeatOn = true;
|
||||||
|
return false; // ignore first keypress after keydown
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else if (e.type == "keyup")
|
||||||
|
{
|
||||||
|
this.lastKey = 0;
|
||||||
|
this.repeatOn = false;
|
||||||
|
}
|
||||||
|
return this.lastKey!=0;
|
||||||
|
}
|
||||||
|
|
||||||
|
this.Nav = function(evt,itemIndex)
|
||||||
|
{
|
||||||
|
var e = (evt) ? evt : window.event; // for IE
|
||||||
|
if (e.keyCode==13) return true;
|
||||||
|
if (!this.ProcessKeys(e)) return false;
|
||||||
|
|
||||||
|
if (this.lastKey==38) // Up
|
||||||
|
{
|
||||||
|
var newIndex = itemIndex-1;
|
||||||
|
var focusItem = this.NavPrev(newIndex);
|
||||||
|
if (focusItem)
|
||||||
|
{
|
||||||
|
var child = this.FindChildElement(focusItem.parentNode.parentNode.id);
|
||||||
|
if (child && child.style.display == 'block') // children visible
|
||||||
|
{
|
||||||
|
var n=0;
|
||||||
|
var tmpElem;
|
||||||
|
while (1) // search for last child
|
||||||
|
{
|
||||||
|
tmpElem = document.getElementById('Item'+newIndex+'_c'+n);
|
||||||
|
if (tmpElem)
|
||||||
|
{
|
||||||
|
focusItem = tmpElem;
|
||||||
|
}
|
||||||
|
else // found it!
|
||||||
|
{
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
n++;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (focusItem)
|
||||||
|
{
|
||||||
|
focusItem.focus();
|
||||||
|
}
|
||||||
|
else // return focus to search field
|
||||||
|
{
|
||||||
|
parent.document.getElementById("MSearchField").focus();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else if (this.lastKey==40) // Down
|
||||||
|
{
|
||||||
|
var newIndex = itemIndex+1;
|
||||||
|
var focusItem;
|
||||||
|
var item = document.getElementById('Item'+itemIndex);
|
||||||
|
var elem = this.FindChildElement(item.parentNode.parentNode.id);
|
||||||
|
if (elem && elem.style.display == 'block') // children visible
|
||||||
|
{
|
||||||
|
focusItem = document.getElementById('Item'+itemIndex+'_c0');
|
||||||
|
}
|
||||||
|
if (!focusItem) focusItem = this.NavNext(newIndex);
|
||||||
|
if (focusItem) focusItem.focus();
|
||||||
|
}
|
||||||
|
else if (this.lastKey==39) // Right
|
||||||
|
{
|
||||||
|
var item = document.getElementById('Item'+itemIndex);
|
||||||
|
var elem = this.FindChildElement(item.parentNode.parentNode.id);
|
||||||
|
if (elem) elem.style.display = 'block';
|
||||||
|
}
|
||||||
|
else if (this.lastKey==37) // Left
|
||||||
|
{
|
||||||
|
var item = document.getElementById('Item'+itemIndex);
|
||||||
|
var elem = this.FindChildElement(item.parentNode.parentNode.id);
|
||||||
|
if (elem) elem.style.display = 'none';
|
||||||
|
}
|
||||||
|
else if (this.lastKey==27) // Escape
|
||||||
|
{
|
||||||
|
parent.searchBox.CloseResultsWindow();
|
||||||
|
parent.document.getElementById("MSearchField").focus();
|
||||||
|
}
|
||||||
|
else if (this.lastKey==13) // Enter
|
||||||
|
{
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
this.NavChild = function(evt,itemIndex,childIndex)
|
||||||
|
{
|
||||||
|
var e = (evt) ? evt : window.event; // for IE
|
||||||
|
if (e.keyCode==13) return true;
|
||||||
|
if (!this.ProcessKeys(e)) return false;
|
||||||
|
|
||||||
|
if (this.lastKey==38) // Up
|
||||||
|
{
|
||||||
|
if (childIndex>0)
|
||||||
|
{
|
||||||
|
var newIndex = childIndex-1;
|
||||||
|
document.getElementById('Item'+itemIndex+'_c'+newIndex).focus();
|
||||||
|
}
|
||||||
|
else // already at first child, jump to parent
|
||||||
|
{
|
||||||
|
document.getElementById('Item'+itemIndex).focus();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else if (this.lastKey==40) // Down
|
||||||
|
{
|
||||||
|
var newIndex = childIndex+1;
|
||||||
|
var elem = document.getElementById('Item'+itemIndex+'_c'+newIndex);
|
||||||
|
if (!elem) // last child, jump to parent next parent
|
||||||
|
{
|
||||||
|
elem = this.NavNext(itemIndex+1);
|
||||||
|
}
|
||||||
|
if (elem)
|
||||||
|
{
|
||||||
|
elem.focus();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else if (this.lastKey==27) // Escape
|
||||||
|
{
|
||||||
|
parent.searchBox.CloseResultsWindow();
|
||||||
|
parent.document.getElementById("MSearchField").focus();
|
||||||
|
}
|
||||||
|
else if (this.lastKey==13) // Enter
|
||||||
|
{
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
function setKeyActions(elem,action)
|
||||||
|
{
|
||||||
|
elem.setAttribute('onkeydown',action);
|
||||||
|
elem.setAttribute('onkeypress',action);
|
||||||
|
elem.setAttribute('onkeyup',action);
|
||||||
|
}
|
||||||
|
|
||||||
|
function setClassAttr(elem,attr)
|
||||||
|
{
|
||||||
|
elem.setAttribute('class',attr);
|
||||||
|
elem.setAttribute('className',attr);
|
||||||
|
}
|
||||||
|
|
||||||
|
function createResults()
|
||||||
|
{
|
||||||
|
var results = document.getElementById("SRResults");
|
||||||
|
for (var e=0; e<searchData.length; e++)
|
||||||
|
{
|
||||||
|
var id = searchData[e][0];
|
||||||
|
var srResult = document.createElement('div');
|
||||||
|
srResult.setAttribute('id','SR_'+id);
|
||||||
|
setClassAttr(srResult,'SRResult');
|
||||||
|
var srEntry = document.createElement('div');
|
||||||
|
setClassAttr(srEntry,'SREntry');
|
||||||
|
var srLink = document.createElement('a');
|
||||||
|
srLink.setAttribute('id','Item'+e);
|
||||||
|
setKeyActions(srLink,'return searchResults.Nav(event,'+e+')');
|
||||||
|
setClassAttr(srLink,'SRSymbol');
|
||||||
|
srLink.innerHTML = searchData[e][1][0];
|
||||||
|
srEntry.appendChild(srLink);
|
||||||
|
if (searchData[e][1].length==2) // single result
|
||||||
|
{
|
||||||
|
srLink.setAttribute('href',searchData[e][1][1][0]);
|
||||||
|
if (searchData[e][1][1][1])
|
||||||
|
{
|
||||||
|
srLink.setAttribute('target','_parent');
|
||||||
|
}
|
||||||
|
var srScope = document.createElement('span');
|
||||||
|
setClassAttr(srScope,'SRScope');
|
||||||
|
srScope.innerHTML = searchData[e][1][1][2];
|
||||||
|
srEntry.appendChild(srScope);
|
||||||
|
}
|
||||||
|
else // multiple results
|
||||||
|
{
|
||||||
|
srLink.setAttribute('href','javascript:searchResults.Toggle("SR_'+id+'")');
|
||||||
|
var srChildren = document.createElement('div');
|
||||||
|
setClassAttr(srChildren,'SRChildren');
|
||||||
|
for (var c=0; c<searchData[e][1].length-1; c++)
|
||||||
|
{
|
||||||
|
var srChild = document.createElement('a');
|
||||||
|
srChild.setAttribute('id','Item'+e+'_c'+c);
|
||||||
|
setKeyActions(srChild,'return searchResults.NavChild(event,'+e+','+c+')');
|
||||||
|
setClassAttr(srChild,'SRScope');
|
||||||
|
srChild.setAttribute('href',searchData[e][1][c+1][0]);
|
||||||
|
if (searchData[e][1][c+1][1])
|
||||||
|
{
|
||||||
|
srChild.setAttribute('target','_parent');
|
||||||
|
}
|
||||||
|
srChild.innerHTML = searchData[e][1][c+1][2];
|
||||||
|
srChildren.appendChild(srChild);
|
||||||
|
}
|
||||||
|
srEntry.appendChild(srChildren);
|
||||||
|
}
|
||||||
|
srResult.appendChild(srEntry);
|
||||||
|
results.appendChild(srResult);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
BIN
doc/html/search/search_l.png
Executable file
After (image error) Size: 604 B |
BIN
doc/html/search/search_m.png
Executable file
After (image error) Size: 158 B |
BIN
doc/html/search/search_r.png
Executable file
After (image error) Size: 612 B |
BIN
doc/html/sync_off.png
Executable file
After (image error) Size: 853 B |
BIN
doc/html/sync_on.png
Executable file
After (image error) Size: 845 B |
BIN
doc/html/tab_a.png
Executable file
After (image error) Size: 142 B |
BIN
doc/html/tab_b.png
Executable file
After (image error) Size: 169 B |
BIN
doc/html/tab_h.png
Executable file
After (image error) Size: 177 B |
BIN
doc/html/tab_s.png
Executable file
After (image error) Size: 184 B |
60
doc/html/tabs.css
Executable file
|
@ -0,0 +1,60 @@
|
||||||
|
.tabs, .tabs2, .tabs3 {
|
||||||
|
background-image: url('tab_b.png');
|
||||||
|
width: 100%;
|
||||||
|
z-index: 101;
|
||||||
|
font-size: 13px;
|
||||||
|
font-family: 'Lucida Grande',Geneva,Helvetica,Arial,sans-serif;
|
||||||
|
}
|
||||||
|
|
||||||
|
.tabs2 {
|
||||||
|
font-size: 10px;
|
||||||
|
}
|
||||||
|
.tabs3 {
|
||||||
|
font-size: 9px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.tablist {
|
||||||
|
margin: 0;
|
||||||
|
padding: 0;
|
||||||
|
display: table;
|
||||||
|
}
|
||||||
|
|
||||||
|
.tablist li {
|
||||||
|
float: left;
|
||||||
|
display: table-cell;
|
||||||
|
background-image: url('tab_b.png');
|
||||||
|
line-height: 36px;
|
||||||
|
list-style: none;
|
||||||
|
}
|
||||||
|
|
||||||
|
.tablist a {
|
||||||
|
display: block;
|
||||||
|
padding: 0 20px;
|
||||||
|
font-weight: bold;
|
||||||
|
background-image:url('tab_s.png');
|
||||||
|
background-repeat:no-repeat;
|
||||||
|
background-position:right;
|
||||||
|
color: #283A5D;
|
||||||
|
text-shadow: 0px 1px 1px rgba(255, 255, 255, 0.9);
|
||||||
|
text-decoration: none;
|
||||||
|
outline: none;
|
||||||
|
}
|
||||||
|
|
||||||
|
.tabs3 .tablist a {
|
||||||
|
padding: 0 10px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.tablist a:hover {
|
||||||
|
background-image: url('tab_h.png');
|
||||||
|
background-repeat:repeat-x;
|
||||||
|
color: #fff;
|
||||||
|
text-shadow: 0px 1px 1px rgba(0, 0, 0, 1.0);
|
||||||
|
text-decoration: none;
|
||||||
|
}
|
||||||
|
|
||||||
|
.tablist li.current a {
|
||||||
|
background-image: url('tab_a.png');
|
||||||
|
background-repeat:repeat-x;
|
||||||
|
color: #fff;
|
||||||
|
text-shadow: 0px 1px 1px rgba(0, 0, 0, 1.0);
|
||||||
|
}
|
501
src/emulator.c
Executable file
|
@ -0,0 +1,501 @@
|
||||||
|
/**
|
||||||
|
* @file
|
||||||
|
* @author Ben Goldsworthy (rumps) <me+scc150@bengoldsworthy.net>
|
||||||
|
* @version 1.0
|
||||||
|
*
|
||||||
|
* @section LICENSE
|
||||||
|
*
|
||||||
|
* This file is free software: you can redistribute it and/or modify
|
||||||
|
* it under the terms of the GNU General Public License as published by
|
||||||
|
* the Free Software Foundation, either version 3 of the License,
|
||||||
|
* or (at your option) any later version.
|
||||||
|
*
|
||||||
|
* This file is distributed in the hope that it will be useful,
|
||||||
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
* GNU General Public License for more details.
|
||||||
|
*
|
||||||
|
* You should have received a copy of the GNU General Public License
|
||||||
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
*
|
||||||
|
* @section DESCRIPTION
|
||||||
|
*
|
||||||
|
* This program emulates programs written in the SCC.150 Assembler language.
|
||||||
|
* The language is a very simple assembly language that comprises of only ten
|
||||||
|
* opcodes:
|
||||||
|
*
|
||||||
|
* `NOP` or 'No OPeration', which performs no task
|
||||||
|
*
|
||||||
|
* `SET ARG1 ARG2`, which puts the value in `ARG2` into the register
|
||||||
|
* indicated in `ARG1`
|
||||||
|
*
|
||||||
|
* `AND ARG1 ARG2`, which performs a bitwise AND operation on the values in
|
||||||
|
* `ARG1` and `ARG2`
|
||||||
|
*
|
||||||
|
* `OR ARG1 ARG2`, which performs a bitwise OR operation on the values in
|
||||||
|
* `ARG1` and `ARG2`
|
||||||
|
*
|
||||||
|
* `ADD ARG1 ARG2`, which performs an addition operation on the values in
|
||||||
|
* `ARG1` and `ARG2`
|
||||||
|
*
|
||||||
|
* `SUB ARG1 ARG2`, which performs a subtraction operation on the values in
|
||||||
|
* `ARG1` and `ARG2`
|
||||||
|
*
|
||||||
|
* `SHL ARG1 ARG2`, which performs a bitwise shift left on the value in
|
||||||
|
* `ARG1`, to the number indicated in `ARG2`
|
||||||
|
*
|
||||||
|
* `SHR ARG1 ARG2`, which performs a bitwise shift right on the value in
|
||||||
|
* `ARG1`, to the number indicated in `ARG2`
|
||||||
|
*
|
||||||
|
* `JMP ARG1`, which jumps to the line indicated by `ARG1` if the value in
|
||||||
|
* `REGX` is 0
|
||||||
|
*
|
||||||
|
* `PRT ARG1`, which prints the value in `ARG1`
|
||||||
|
*
|
||||||
|
* Five registers are used: `REGA`, `REGB`, `REGC`, `REGX` and `INSP`, or
|
||||||
|
* 'INStruction Pointer'.
|
||||||
|
*
|
||||||
|
* Comments in the language are indicated by the line beginning with a '#'.
|
||||||
|
*/
|
||||||
|
|
||||||
|
#include "emulator.h"
|
||||||
|
#include "mystring.h"
|
||||||
|
|
||||||
|
// Function pointer definition for opcodes
|
||||||
|
typedef int (*opcode_function)(char*, char*, char*);
|
||||||
|
|
||||||
|
// Contains the program after reading it from the file
|
||||||
|
char prog[MAX_PROG_LEN][MAX_LINE_LEN];
|
||||||
|
// The length of the loaded program in lines
|
||||||
|
int progLen = 0;
|
||||||
|
|
||||||
|
// Used to detect if a program is stuck in an infinite loop
|
||||||
|
unsigned int programRuns = 0;
|
||||||
|
|
||||||
|
// The three general purpose registers
|
||||||
|
unsigned int REGA = 0;
|
||||||
|
unsigned int REGB = 0;
|
||||||
|
unsigned int REGC = 0;
|
||||||
|
// A special register, used by JMP
|
||||||
|
unsigned int REGX = 0;
|
||||||
|
// A special register; the instruction pointer pointing to the next
|
||||||
|
// program line to be executed
|
||||||
|
unsigned int INSP = 0;
|
||||||
|
|
||||||
|
// Arrays to allow generic access to registers (not actually used in the end)
|
||||||
|
const char* register_str[] = {"REGA", "REGB", "REGC", "REGX"};
|
||||||
|
//int *register_ptr[]={®A, ®B, ®C, ®X};
|
||||||
|
|
||||||
|
|
||||||
|
// Arrays to allow generic access to functions for opcode execution
|
||||||
|
const char* opcodeStr[] = {"NOP", "SET", "AND", "OR", "ADD",
|
||||||
|
"SUB", "SHL", "SHR", "JMP", "PRT"};
|
||||||
|
opcode_function opcodeFunc[] = {&opcodeNOP, &opcodeSET, &opcodeAND, &opcodeOR,
|
||||||
|
&opcodeADD, &opcodeSUB, &opcodeSHL, &opcodeSHR,
|
||||||
|
&opcodeJMP, &opcodePRT};
|
||||||
|
|
||||||
|
/**
|
||||||
|
* A function to handle the `NOP` opcode
|
||||||
|
*
|
||||||
|
* Increments the instruction pointer `INSP`.
|
||||||
|
*
|
||||||
|
* @param opcode the opcode
|
||||||
|
* @param arg1 the first argument (not applicable for `NOP`)
|
||||||
|
* @param arg2 the second argument (not applicable for `NOP`)
|
||||||
|
* @return 0 on success
|
||||||
|
*/
|
||||||
|
int opcodeNOP(char* opcode, char* arg1, char* arg2) {
|
||||||
|
INSP++;
|
||||||
|
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* A function to handle the `SET` opcode
|
||||||
|
*
|
||||||
|
* Gets the value of either the register or integer set in `arg2` and places it
|
||||||
|
* in the register indicated by `arg1`.
|
||||||
|
*
|
||||||
|
* @param opcode the opcode
|
||||||
|
* @param arg1 the first argument
|
||||||
|
* @param arg2 the second argument
|
||||||
|
* @return 0 on success
|
||||||
|
*/
|
||||||
|
int opcodeSET(char* opcode, char* arg1, char* arg2) {
|
||||||
|
int val = getArg2(arg2);
|
||||||
|
|
||||||
|
if (!mystrncmp(arg1, "REGA", ARG_LENGTH)) REGA = val;
|
||||||
|
else if (!mystrncmp(arg1, "REGB", ARG_LENGTH)) REGB = val;
|
||||||
|
else if (!mystrncmp(arg1, "REGC", ARG_LENGTH)) REGC = val;
|
||||||
|
else if (!mystrncmp(arg1, "REGX", ARG_LENGTH)) REGX = val;
|
||||||
|
|
||||||
|
INSP++;
|
||||||
|
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* A function to handle the `AND` opcode
|
||||||
|
*
|
||||||
|
* Performs a bitwise AND on the values in `arg1` and `arg2`, storing
|
||||||
|
* the result in `arg1`.
|
||||||
|
*
|
||||||
|
* @param opcode the opcode
|
||||||
|
* @param arg1 the first argument
|
||||||
|
* @param arg2 the second argument
|
||||||
|
* @return 0 on success
|
||||||
|
*/
|
||||||
|
int opcodeAND(char* opcode, char* arg1, char* arg2) {
|
||||||
|
int val = getArg2(arg2);
|
||||||
|
|
||||||
|
if (!mystrncmp(arg1, "REGA", ARG_LENGTH)) REGA = REGA & val;
|
||||||
|
else if (!mystrncmp(arg1, "REGB", ARG_LENGTH)) REGB = REGB & val;
|
||||||
|
else if (!mystrncmp(arg1, "REGC", ARG_LENGTH)) REGC = REGC & val;
|
||||||
|
else if (!mystrncmp(arg1, "REGX", ARG_LENGTH)) REGX = REGX & val;
|
||||||
|
|
||||||
|
INSP++;
|
||||||
|
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* A function to handle the `OR` opcode
|
||||||
|
*
|
||||||
|
* Performs a bitwise OR on the values in `arg1` and `arg2`, storing
|
||||||
|
* the result in `arg1`.
|
||||||
|
*
|
||||||
|
* @param opcode the opcode
|
||||||
|
* @param arg1 the first argument
|
||||||
|
* @param arg2 the second argument
|
||||||
|
* @return 0 on success
|
||||||
|
*/
|
||||||
|
int opcodeOR(char* opcode, char* arg1, char* arg2) {
|
||||||
|
int val = getArg2(arg2);
|
||||||
|
|
||||||
|
if (!mystrncmp(arg1, "REGA", ARG_LENGTH)) REGA = REGA | val;
|
||||||
|
else if (!mystrncmp(arg1, "REGB", ARG_LENGTH)) REGB = REGB | val;
|
||||||
|
else if (!mystrncmp(arg1, "REGC", ARG_LENGTH)) REGC = REGC | val;
|
||||||
|
else if (!mystrncmp(arg1, "REGX", ARG_LENGTH)) REGX = REGX | val;
|
||||||
|
|
||||||
|
INSP++;
|
||||||
|
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* A function to handle the `ADD` opcode
|
||||||
|
*
|
||||||
|
* Performs addition on the values in `arg1` and `arg2`, storing
|
||||||
|
* the result in `arg1`.
|
||||||
|
*
|
||||||
|
* @param opcode the opcode
|
||||||
|
* @param arg1 the first argument
|
||||||
|
* @param arg2 the second argument
|
||||||
|
* @return 0 on success
|
||||||
|
*/
|
||||||
|
int opcodeADD(char* opcode, char* arg1, char* arg2) {
|
||||||
|
int val = getArg2(arg2);
|
||||||
|
|
||||||
|
if (!mystrncmp(arg1, "REGA", ARG_LENGTH)) REGA = REGA + val;
|
||||||
|
else if (!mystrncmp(arg1, "REGB", ARG_LENGTH)) REGB = REGB + val;
|
||||||
|
else if (!mystrncmp(arg1, "REGC", ARG_LENGTH)) REGC = REGC + val;
|
||||||
|
else if (!mystrncmp(arg1, "REGX", ARG_LENGTH)) REGX = REGX + val;
|
||||||
|
|
||||||
|
INSP++;
|
||||||
|
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* A function to handle the `SUB` opcode
|
||||||
|
*
|
||||||
|
* Subtracts the value in `arg2` from the value in `arg1`, storing
|
||||||
|
* the result in `arg1`.
|
||||||
|
*
|
||||||
|
* @param opcode the opcode
|
||||||
|
* @param arg1 the first argument
|
||||||
|
* @param arg2 the second argument
|
||||||
|
* @return 0 on success
|
||||||
|
*/
|
||||||
|
int opcodeSUB(char* opcode, char* arg1, char* arg2) {
|
||||||
|
int val = getArg2(arg2);
|
||||||
|
|
||||||
|
if (!mystrncmp(arg1, "REGA", ARG_LENGTH)) REGA = REGA - val;
|
||||||
|
else if (!mystrncmp(arg1, "REGB", ARG_LENGTH)) REGB = REGB - val;
|
||||||
|
else if (!mystrncmp(arg1, "REGC", ARG_LENGTH)) REGC = REGC - val;
|
||||||
|
else if (!mystrncmp(arg1, "REGX", ARG_LENGTH)) REGX = REGX - val;
|
||||||
|
|
||||||
|
INSP++;
|
||||||
|
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* A function to handle the `SHL` opcode
|
||||||
|
*
|
||||||
|
* Performs a bitwise shift left on the value in `arg1`, storing
|
||||||
|
* the result in `arg1`. The number of shifts is specified in `arg2`.
|
||||||
|
*
|
||||||
|
* @param opcode the opcode
|
||||||
|
* @param arg1 the first argument
|
||||||
|
* @param arg2 the second argument
|
||||||
|
* @return 0 on success
|
||||||
|
*/
|
||||||
|
int opcodeSHL(char* opcode, char* arg1, char* arg2) {
|
||||||
|
int val = getArg2(arg2);
|
||||||
|
|
||||||
|
if (!mystrncmp(arg1, "REGA", ARG_LENGTH)) REGA = REGA << val;
|
||||||
|
else if (!mystrncmp(arg1, "REGB", ARG_LENGTH)) REGB = REGB << val;
|
||||||
|
else if (!mystrncmp(arg1, "REGC", ARG_LENGTH)) REGC = REGC << val;
|
||||||
|
else if (!mystrncmp(arg1, "REGX", ARG_LENGTH)) REGX = REGX << val;
|
||||||
|
|
||||||
|
INSP++;
|
||||||
|
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* A function to handle the `SHR` opcode
|
||||||
|
*
|
||||||
|
* Performs a bitwise shift right on the value in `arg1`, storing
|
||||||
|
* the result in `arg1`. The number of shifts is specified in `arg2`.
|
||||||
|
*
|
||||||
|
* @param opcode the opcode
|
||||||
|
* @param arg1 the first argument
|
||||||
|
* @param arg2 the second argument
|
||||||
|
* @return 0 on success
|
||||||
|
*/
|
||||||
|
int opcodeSHR(char* opcode, char* arg1, char* arg2) {
|
||||||
|
int val = getArg2(arg2);
|
||||||
|
|
||||||
|
if (!mystrncmp(arg1, "REGA", ARG_LENGTH)) REGA = REGA >> val;
|
||||||
|
else if (!mystrncmp(arg1, "REGB", ARG_LENGTH)) REGB = REGB >> val;
|
||||||
|
else if (!mystrncmp(arg1, "REGC", ARG_LENGTH)) REGC = REGC >> val;
|
||||||
|
else if (!mystrncmp(arg1, "REGX", ARG_LENGTH)) REGX = REGX >> val;
|
||||||
|
|
||||||
|
INSP++;
|
||||||
|
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* A function to handle the `JMP` opcode
|
||||||
|
*
|
||||||
|
* If `REGX` contains 0, jumps to the line indicated by `arg1`.
|
||||||
|
*
|
||||||
|
* @param opcode the opcode
|
||||||
|
* @param arg1 the first argument
|
||||||
|
* @param arg2 the second argument (not applicable for `JMP`)
|
||||||
|
* @return 0 on success
|
||||||
|
*/
|
||||||
|
int opcodeJMP(char* opcode, char* arg1, char* arg2) {
|
||||||
|
int val = getArg2(arg1);
|
||||||
|
|
||||||
|
if (REGX == 0) INSP = val;
|
||||||
|
else INSP++;
|
||||||
|
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* A function to handle the `PRT` opcode
|
||||||
|
*
|
||||||
|
* Prints the value in the register indicated in `arg1`, or the integer value
|
||||||
|
* specified.
|
||||||
|
*
|
||||||
|
* @param opcode the opcode
|
||||||
|
* @param arg1 the first argument
|
||||||
|
* @param arg2 the second argument (not applicable for `PRT`)
|
||||||
|
* @return 0 on success
|
||||||
|
*/
|
||||||
|
int opcodePRT(char* opcode, char* arg1, char* arg2) {
|
||||||
|
if(!mystrncmp(arg1, "REGA", ARG_LENGTH)) printf("REGA = %d\n", REGA);
|
||||||
|
else if(!mystrncmp(arg1, "REGB", ARG_LENGTH)) printf("REGB = %d\n", REGB);
|
||||||
|
else if(!mystrncmp(arg1, "REGC", ARG_LENGTH)) printf("REGC = %d\n", REGC);
|
||||||
|
else if(!mystrncmp(arg1, "REGX", ARG_LENGTH)) printf("REGX = %d\n", REGX);
|
||||||
|
else printf(" = %d\n", atoi(arg1));
|
||||||
|
|
||||||
|
INSP++;
|
||||||
|
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* A function to return the value in the second argument of an instruction.
|
||||||
|
*
|
||||||
|
* Returns either the value in the indicated register or, as the instruction
|
||||||
|
* is parsed as a string, the integer value given. `mystrncmp()` is used
|
||||||
|
* over `mystrcmp()` because there tends to be dodgy C string magic tacked on
|
||||||
|
* to the end of the args.
|
||||||
|
*
|
||||||
|
* @param arg2 the value to parse
|
||||||
|
* @return an integer
|
||||||
|
*/
|
||||||
|
int getArg2(char* arg2) {
|
||||||
|
if (!mystrncmp(arg2, "REGA", ARG_LENGTH)) return REGA;
|
||||||
|
else if (!mystrncmp(arg2, "REGB", ARG_LENGTH)) return REGB;
|
||||||
|
else if (!mystrncmp(arg2, "REGC", ARG_LENGTH)) return REGC;
|
||||||
|
else if (!mystrncmp(arg2, "REGX", ARG_LENGTH)) return REGX;
|
||||||
|
else return atoi(arg2);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Tests if an instruction is valid.
|
||||||
|
*
|
||||||
|
* Tests that the opcode is valid and that the registers are also.
|
||||||
|
*
|
||||||
|
* @param opcode the opcode
|
||||||
|
* @param arg1 the first argument
|
||||||
|
* @param arg2 the second argument (not applicable for `PRT`)
|
||||||
|
* @return `true` if the string is valid, `false` if it is not
|
||||||
|
*/
|
||||||
|
bool isValid(char* opcode, char* arg1, char* arg2) {
|
||||||
|
bool validOpcode = false, validArg1 = false, validArg2 = false;
|
||||||
|
|
||||||
|
for (size_t i = 0; (i < MAX_OPCODE) && (!validOpcode); i++)
|
||||||
|
if (!mystrncmp(opcode, opcodeStr[i], OPCODE_LENGTH))
|
||||||
|
validOpcode = true;
|
||||||
|
|
||||||
|
if (mystrncmp(opcode, "NOP", OPCODE_LENGTH)) {
|
||||||
|
if ((!mystrncmp(arg1, "REGA", 3)) ||
|
||||||
|
(!mystrncmp(arg1, "REGB", ARG_LENGTH)) ||
|
||||||
|
(!mystrncmp(arg1, "REGC", ARG_LENGTH)) ||
|
||||||
|
(!mystrncmp(arg1, "REGX", ARG_LENGTH)) ||
|
||||||
|
(atoi(arg1) > 0)) validArg1 = true;
|
||||||
|
|
||||||
|
if ((mystrncmp(opcode, "JMP", OPCODE_LENGTH)) ||
|
||||||
|
(mystrncmp(opcode, "PRT", OPCODE_LENGTH))) {
|
||||||
|
if ((!mystrncmp(arg2, "REGA", ARG_LENGTH)) ||
|
||||||
|
(!mystrncmp(arg2, "REGB", ARG_LENGTH)) ||
|
||||||
|
(!mystrncmp(arg2, "REGC", ARG_LENGTH)) ||
|
||||||
|
(!mystrncmp(arg2, "REGX", ARG_LENGTH)) ||
|
||||||
|
((atoi(arg2) > 0) || (!mystrncmp(arg2, "0", 1)))) validArg2 = true;
|
||||||
|
} else validArg2 = true;
|
||||||
|
} else { validArg1 = true; validArg2 = true; }
|
||||||
|
|
||||||
|
return (validOpcode && validArg1 && validArg2) ? true : false;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Executes an instruction.
|
||||||
|
*
|
||||||
|
* Tests the validity of an instruction (and whether or not it's a comment),
|
||||||
|
* and if the line passes, calls the appropriate function.
|
||||||
|
*
|
||||||
|
* @param instruction the instruction to test
|
||||||
|
* @return 0 on success, -1 on failure
|
||||||
|
*/
|
||||||
|
int execInstruction(char* instruction) {
|
||||||
|
// DEBUGGING: prints the current instruction
|
||||||
|
//printf("executing line: %s", instruction);
|
||||||
|
|
||||||
|
// Skips the line if it begins with the comment symbol '#'
|
||||||
|
if (instruction[0] != '#') {
|
||||||
|
// Three arrays to hold the parsed sections of the instruction
|
||||||
|
char opcode[OPCODE_LENGTH];
|
||||||
|
char arg1[ARG_LENGTH];
|
||||||
|
char arg2[ARG_LENGTH];
|
||||||
|
size_t i = 0;
|
||||||
|
int instrSection = OPCODE;
|
||||||
|
|
||||||
|
// Reads the instruction to the end, parsing out the opcode and,
|
||||||
|
// where applicable, arg(s)
|
||||||
|
// Note: I am thick for not using fscanf() and saving 18 lines
|
||||||
|
// (I should probably stop looking at so many SO code golfs)
|
||||||
|
while (*instruction != '\0') {
|
||||||
|
if (*instruction == ' ') {
|
||||||
|
instrSection++;
|
||||||
|
i = 0;
|
||||||
|
instruction++;
|
||||||
|
}
|
||||||
|
|
||||||
|
switch (instrSection) {
|
||||||
|
case OPCODE:
|
||||||
|
opcode[i++] = *instruction++;
|
||||||
|
break;
|
||||||
|
case ARG1:
|
||||||
|
arg1[i++] = *instruction++;
|
||||||
|
break;
|
||||||
|
case ARG2:
|
||||||
|
arg2[i++] = *instruction++;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (isValid(opcode, arg1, arg2)) {
|
||||||
|
// Calls the appropriate function for the instruction
|
||||||
|
for (size_t j = 0; j < MAX_OPCODE; j++)
|
||||||
|
if (!mystrncmp(opcode, opcodeStr[j], OPCODE_LENGTH))
|
||||||
|
(*opcodeFunc[j])(opcode, arg1, arg2);
|
||||||
|
} else return -1;
|
||||||
|
} else INSP++;
|
||||||
|
|
||||||
|
programRuns++;
|
||||||
|
if (programRuns > 150) return -1;
|
||||||
|
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Executes an the program.
|
||||||
|
*
|
||||||
|
* Runs `execInstruction` on each line of the program in turn.
|
||||||
|
*
|
||||||
|
* @return 0 on success, -1 on failure
|
||||||
|
*/
|
||||||
|
int execProgram() {
|
||||||
|
INSP = 0;
|
||||||
|
printf("RUNNING PROGRAM...\n");
|
||||||
|
while (INSP < progLen) {
|
||||||
|
if (execInstruction(&prog[INSP][0]) < 0) {
|
||||||
|
printf("EXECUTION ERROR\n");
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
// DEBUGGING: displays register contents
|
||||||
|
//printf("REGS: %d %d %d %d %d\n", REGA, REGB, REGC, REGX, INSP);
|
||||||
|
}
|
||||||
|
printf("... DONE!\n");
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Loads a program.
|
||||||
|
*
|
||||||
|
* Loads the program file and reads each line into an array.
|
||||||
|
*
|
||||||
|
* @return 0 on success, -1 on failure
|
||||||
|
*/
|
||||||
|
int loadProgram() {
|
||||||
|
FILE *f;
|
||||||
|
|
||||||
|
// Reads in the program file (the .scc filetype is just for kicks;
|
||||||
|
// the program just reads text files)
|
||||||
|
f = fopen("../programs/prog.scc", "r");
|
||||||
|
if (f == NULL) {
|
||||||
|
printf("FILE OPEN ERROR\n");
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
while(fgets(&prog[progLen][0], MAX_LINE_LEN, f) != NULL) {
|
||||||
|
progLen++;
|
||||||
|
}
|
||||||
|
|
||||||
|
// DEBUGGING: print the program out
|
||||||
|
/*
|
||||||
|
printf("PROGRAM:\n");
|
||||||
|
for (int j = 0; j < progLen; j++) {
|
||||||
|
printf("%d: %s", j, &prog[j][0]);
|
||||||
|
}
|
||||||
|
*/
|
||||||
|
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Runs the program.
|
||||||
|
*
|
||||||
|
* @return 0 on success, -1 on failure
|
||||||
|
*/
|
||||||
|
int main() {
|
||||||
|
if (loadProgram() < 0) return -1;
|
||||||
|
if (execProgram() < 0) return -1;
|
||||||
|
|
||||||
|
return 0;
|
||||||
|
}
|
66
src/emulator.h
Executable file
|
@ -0,0 +1,66 @@
|
||||||
|
#ifndef EMULATOR_H_
|
||||||
|
#define EMULATOR_H_
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @file
|
||||||
|
* @author Ben Goldsworthy (rumps) <me+scc150@bengoldsworthy.net>
|
||||||
|
* @version 1.0
|
||||||
|
*
|
||||||
|
* @section LICENSE
|
||||||
|
*
|
||||||
|
* This file is free software: you can redistribute it and/or modify
|
||||||
|
* it under the terms of the GNU General Public License as published by
|
||||||
|
* the Free Software Foundation, either version 3 of the License,
|
||||||
|
* or (at your option) any later version.
|
||||||
|
*
|
||||||
|
* This file is distributed in the hope that it will be useful,
|
||||||
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
* GNU General Public License for more details.
|
||||||
|
*
|
||||||
|
* You should have received a copy of the GNU General Public License
|
||||||
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
*
|
||||||
|
* @section DESCRIPTION
|
||||||
|
*
|
||||||
|
* Header file for `emulator.c`.
|
||||||
|
*/
|
||||||
|
|
||||||
|
#include <stdio.h> // used for printf()
|
||||||
|
#include <stdlib.h> // used for atoi()
|
||||||
|
#include <stdbool.h> // used for bool data type
|
||||||
|
|
||||||
|
#define MAX_PROG_LEN 99 // The maximum length (in lines) a program can have
|
||||||
|
#define MAX_LINE_LEN 80 // The maximum length of a program line (in characters)
|
||||||
|
#define MAX_OPCODE 10 // The maximum number of opcodes that are supported
|
||||||
|
#define MAX_REGISTER 4 // The maximum number of registers (minus INSP)
|
||||||
|
#define OPCODE_LENGTH 3 // The maximum length of an opcode
|
||||||
|
#define ARG_LENGTH 4 // The maximum length of an arg
|
||||||
|
#define OPCODE 0 // Used for parsing instruction segments
|
||||||
|
#define ARG1 1
|
||||||
|
#define ARG2 2
|
||||||
|
|
||||||
|
// Opcode handling functions
|
||||||
|
int opcodeNOP(char* opcode, char* arg1, char* arg2);
|
||||||
|
int opcodeSET(char* opcode, char* arg1, char* arg2);
|
||||||
|
int opcodeAND(char* opcode, char* arg1, char* arg2);
|
||||||
|
int opcodeOR(char* opcode, char* arg1, char* arg2);
|
||||||
|
int opcodeADD(char* opcode, char* arg1, char* arg2);
|
||||||
|
int opcodeSUB(char* opcode, char* arg1, char* arg2);
|
||||||
|
int opcodeSHL(char* opcode, char* arg1, char* arg2);
|
||||||
|
int opcodeSHR(char* opcode, char* arg1, char* arg2);
|
||||||
|
int opcodeJMP(char* opcode, char* arg1, char* arg2);
|
||||||
|
int opcodePRT(char* opcode, char* arg1, char* arg2);
|
||||||
|
|
||||||
|
// Argument extraction function
|
||||||
|
int getArg2(char* arg2);
|
||||||
|
|
||||||
|
// Command validator function
|
||||||
|
bool isValid(char* opcode, char* arg1, char* arg2);
|
||||||
|
|
||||||
|
// Emulator run functions
|
||||||
|
int execInstruction(char* instruction);
|
||||||
|
int execProgram();
|
||||||
|
int loadProgram();
|
||||||
|
|
||||||
|
#endif /* EMULATOR_H_ */
|
147
src/mystring.c
Executable file
|
@ -0,0 +1,147 @@
|
||||||
|
/**
|
||||||
|
* @file
|
||||||
|
* @author Ben Goldsworthy (rumps) <me+scc150@bengoldsworthy.net>
|
||||||
|
* @version 1.0
|
||||||
|
*
|
||||||
|
* @section LICENSE
|
||||||
|
*
|
||||||
|
* This file is free software: you can redistribute it and/or modify
|
||||||
|
* it under the terms of the GNU General Public License as published by
|
||||||
|
* the Free Software Foundation, either version 3 of the License,
|
||||||
|
* or (at your option) any later version.
|
||||||
|
*
|
||||||
|
* This file is distributed in the hope that it will be useful,
|
||||||
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
* GNU General Public License for more details.
|
||||||
|
*
|
||||||
|
* You should have received a copy of the GNU General Public License
|
||||||
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
*
|
||||||
|
* @section DESCRIPTION
|
||||||
|
*
|
||||||
|
* The `mystring.h` library serves as a fairly pointless replacement
|
||||||
|
* for the perfectly good (better, even) `string.h`.
|
||||||
|
*/
|
||||||
|
|
||||||
|
#include <stddef.h> // used for size_t
|
||||||
|
|
||||||
|
#include "mystring.h"
|
||||||
|
|
||||||
|
// I prefer <type>* <name> to <type> *<name>, for the reasons laid out
|
||||||
|
// by Bjarne Stroustrup at <http://www.stroustrup.com/bs_faq2.html#whitespace>
|
||||||
|
|
||||||
|
/**
|
||||||
|
* A function to measure the length of a valid C string.
|
||||||
|
*
|
||||||
|
* Goes through the null-terminated (i.e. valid C) string `s`
|
||||||
|
* character-by-character, returning the length of the string (sans the
|
||||||
|
* null terminator).
|
||||||
|
*
|
||||||
|
* @param s the string to measure
|
||||||
|
* @return the length of the string as an `unsigned int` (`size_t` because
|
||||||
|
* apparently that's the done thing as of C99, which I'm using
|
||||||
|
* because I love for loop initial declarations to bits)
|
||||||
|
*/
|
||||||
|
size_t mystrlen(const char* s) {
|
||||||
|
int length = 0;
|
||||||
|
|
||||||
|
while (*s != '\0') {
|
||||||
|
s++;
|
||||||
|
length++;
|
||||||
|
}
|
||||||
|
|
||||||
|
return length;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* A function to compare two strings.
|
||||||
|
*
|
||||||
|
* Compares two strings, returning -1 if `s1` < `s2`, 1 if `s1` > `s2`
|
||||||
|
* and 0 if `s1` == `s2`.
|
||||||
|
*
|
||||||
|
* @param s1 the string to compare
|
||||||
|
* @param s2 the string to compare `s1` to
|
||||||
|
* @return -1 if the `s1` < `s2`; 1 if `s1` > `s2`; 0 if `s1` == `s2`
|
||||||
|
*/
|
||||||
|
int mystrcmp(const char* s1, const char* s2) {
|
||||||
|
while (*s1 != '\0') {
|
||||||
|
if (*s2 == '\0') return 1;
|
||||||
|
if (*s1 < *s2) return -1;
|
||||||
|
if (*s1 > *s2) return 1;
|
||||||
|
|
||||||
|
s1++;
|
||||||
|
s2++;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (*s2 != '\0') return -1;
|
||||||
|
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* A function to compare two strings up to a certain point.
|
||||||
|
*
|
||||||
|
* Goes through `n` characters of `s1`, comparing them to the
|
||||||
|
* matching characters of `s2`. If the characters are different,
|
||||||
|
* it returns -1 if `s1` < `s2` and 1 if `s1` > `s2`.
|
||||||
|
*
|
||||||
|
* If they're the same, it returns 0 if `s1` is the same length as `s2`
|
||||||
|
* (i.e. the same characters are both `NUL`). If the function reaches
|
||||||
|
* the `n`th character of `s1` and it remains the same as `s2`, it
|
||||||
|
* returns 0 also.
|
||||||
|
*
|
||||||
|
* @param s1 the string to compare
|
||||||
|
* @param s2 the string to compare `s1` to
|
||||||
|
* @param n the length of `s1` to compare
|
||||||
|
* @return -1/1 if the strings don't match, 0 if they do
|
||||||
|
*/
|
||||||
|
int mystrncmp(const char* s1, const char* s2, int n) {
|
||||||
|
for (; n > 0; s1++, s2++, --n) {
|
||||||
|
if (*s1 != *s2)
|
||||||
|
return (*s1 < *s2) ? -1 : 1;
|
||||||
|
else if (*s1 == '\0')
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* A function to find if a character exists in a string.
|
||||||
|
*
|
||||||
|
* Goes through the string `haystack` looking for the character `needle`.
|
||||||
|
*
|
||||||
|
* @param haystack the string to search
|
||||||
|
* @param needle the character to search for
|
||||||
|
* @return `haystack` if successful, 0 if not
|
||||||
|
*/
|
||||||
|
char* mystrchr(char* haystack, const char needle) {
|
||||||
|
while (*haystack != needle) {
|
||||||
|
if (!*haystack++) {
|
||||||
|
return NULL;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return haystack;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* A function to find if a string exists as a subset or totality of another.
|
||||||
|
*
|
||||||
|
* Goes through the string `haystack` looking for the string `needle` by
|
||||||
|
* executing `mystrchr` on each character in turn.
|
||||||
|
*
|
||||||
|
* @param haystack the string to search
|
||||||
|
* @param needle the (sub)string to search for
|
||||||
|
* @return `haystack` if successful, 0 if not
|
||||||
|
*/
|
||||||
|
char* mystrstr(char* haystack, const char* needle) {
|
||||||
|
const size_t len = mystrlen(needle);
|
||||||
|
|
||||||
|
while ((haystack = mystrchr(haystack, *needle)) != 0) {
|
||||||
|
if (mystrncmp(haystack, needle, len) == 0)
|
||||||
|
return haystack;
|
||||||
|
}
|
||||||
|
|
||||||
|
return 0;
|
||||||
|
}
|
37
src/mystring.h
Executable file
|
@ -0,0 +1,37 @@
|
||||||
|
#ifndef MYSTRING_H_
|
||||||
|
#define MYSTRING_H_
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @file
|
||||||
|
* @author Ben Goldsworthy (rumps) <me+scc150@bengoldsworthy.net>
|
||||||
|
* @version 1.0
|
||||||
|
*
|
||||||
|
* @section LICENSE
|
||||||
|
*
|
||||||
|
* This file is free software: you can redistribute it and/or modify
|
||||||
|
* it under the terms of the GNU General Public License as published by
|
||||||
|
* the Free Software Foundation, either version 3 of the License,
|
||||||
|
* or (at your option) any later version.
|
||||||
|
*
|
||||||
|
* This file is distributed in the hope that it will be useful,
|
||||||
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
* GNU General Public License for more details.
|
||||||
|
*
|
||||||
|
* You should have received a copy of the GNU General Public License
|
||||||
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
*
|
||||||
|
* @section DESCRIPTION
|
||||||
|
*
|
||||||
|
* Header file for `mystring.c`.
|
||||||
|
*/
|
||||||
|
|
||||||
|
#include <stddef.h> // used for size_t
|
||||||
|
|
||||||
|
size_t mystrlen(const char* s);
|
||||||
|
int mystrcmp(const char* s1, const char* s2);
|
||||||
|
int mystrncmp(const char* s1, const char* s2, int n);
|
||||||
|
char* mystrchr(char* haystack, const char needle);
|
||||||
|
char* mystrstr(char* haystack, const char* needle);
|
||||||
|
|
||||||
|
#endif /* MYSTRING_H_ */
|