Browse Source

oops

import/raw
doug 13 years ago
parent
commit
0864697510
  1. BIN
      branches/dwg/LSource/src/cpmtools-2.13.tar
  2. 14
      branches/dwg/LSource/src/cpmtools-2.13/.depend
  3. 676
      branches/dwg/LSource/src/cpmtools-2.13/COPYING
  4. 212
      branches/dwg/LSource/src/cpmtools-2.13/INSTALL
  5. 114
      branches/dwg/LSource/src/cpmtools-2.13/Makefile
  6. 114
      branches/dwg/LSource/src/cpmtools-2.13/Makefile.in
  7. 3
      branches/dwg/LSource/src/cpmtools-2.13/NEWS
  8. 43
      branches/dwg/LSource/src/cpmtools-2.13/README
  9. 9
      branches/dwg/LSource/src/cpmtools-2.13/README.win32-libdsk
  10. 518
      branches/dwg/LSource/src/cpmtools-2.13/README.win32.cygwin.txt
  11. 7
      branches/dwg/LSource/src/cpmtools-2.13/badfs/Makefile
  12. BIN
      branches/dwg/LSource/src/cpmtools-2.13/badfs/blocknumber
  13. BIN
      branches/dwg/LSource/src/cpmtools-2.13/badfs/doubleext
  14. BIN
      branches/dwg/LSource/src/cpmtools-2.13/badfs/extension
  15. BIN
      branches/dwg/LSource/src/cpmtools-2.13/badfs/extno
  16. BIN
      branches/dwg/LSource/src/cpmtools-2.13/badfs/hugecom
  17. BIN
      branches/dwg/LSource/src/cpmtools-2.13/badfs/label
  18. BIN
      branches/dwg/LSource/src/cpmtools-2.13/badfs/lcr
  19. BIN
      branches/dwg/LSource/src/cpmtools-2.13/badfs/multipleblocks
  20. BIN
      branches/dwg/LSource/src/cpmtools-2.13/badfs/name
  21. BIN
      branches/dwg/LSource/src/cpmtools-2.13/badfs/recordcount
  22. BIN
      branches/dwg/LSource/src/cpmtools-2.13/badfs/status
  23. BIN
      branches/dwg/LSource/src/cpmtools-2.13/badfs/timestamps
  24. 1498
      branches/dwg/LSource/src/cpmtools-2.13/config.guess
  25. 55
      branches/dwg/LSource/src/cpmtools-2.13/config.h
  26. 54
      branches/dwg/LSource/src/cpmtools-2.13/config.h.in
  27. 687
      branches/dwg/LSource/src/cpmtools-2.13/config.log
  28. 1014
      branches/dwg/LSource/src/cpmtools-2.13/config.status
  29. 1702
      branches/dwg/LSource/src/cpmtools-2.13/config.sub
  30. 5701
      branches/dwg/LSource/src/cpmtools-2.13/configure
  31. 124
      branches/dwg/LSource/src/cpmtools-2.13/configure.in
  32. 240
      branches/dwg/LSource/src/cpmtools-2.13/cpm.5
  33. 240
      branches/dwg/LSource/src/cpmtools-2.13/cpm.5.in
  34. BIN
      branches/dwg/LSource/src/cpmtools-2.13/cpmchattr
  35. 86
      branches/dwg/LSource/src/cpmtools-2.13/cpmchattr.1
  36. 86
      branches/dwg/LSource/src/cpmtools-2.13/cpmchattr.1.in
  37. 112
      branches/dwg/LSource/src/cpmtools-2.13/cpmchattr.c
  38. BIN
      branches/dwg/LSource/src/cpmtools-2.13/cpmchmod
  39. 57
      branches/dwg/LSource/src/cpmtools-2.13/cpmchmod.1
  40. 57
      branches/dwg/LSource/src/cpmtools-2.13/cpmchmod.1.in
  41. 84
      branches/dwg/LSource/src/cpmtools-2.13/cpmchmod.c
  42. BIN
      branches/dwg/LSource/src/cpmtools-2.13/cpmcp
  43. 92
      branches/dwg/LSource/src/cpmtools-2.13/cpmcp.1
  44. 92
      branches/dwg/LSource/src/cpmtools-2.13/cpmcp.1.in
  45. 284
      branches/dwg/LSource/src/cpmtools-2.13/cpmcp.c
  46. 21
      branches/dwg/LSource/src/cpmtools-2.13/cpmdir.h
  47. 1561
      branches/dwg/LSource/src/cpmtools-2.13/cpmfs.c
  48. 174
      branches/dwg/LSource/src/cpmtools-2.13/cpmfs.h
  49. BIN
      branches/dwg/LSource/src/cpmtools-2.13/cpmls
  50. 67
      branches/dwg/LSource/src/cpmtools-2.13/cpmls.1
  51. 67
      branches/dwg/LSource/src/cpmtools-2.13/cpmls.1.in
  52. 383
      branches/dwg/LSource/src/cpmtools-2.13/cpmls.c
  53. BIN
      branches/dwg/LSource/src/cpmtools-2.13/cpmrm
  54. 53
      branches/dwg/LSource/src/cpmtools-2.13/cpmrm.1
  55. 53
      branches/dwg/LSource/src/cpmtools-2.13/cpmrm.1.in
  56. 72
      branches/dwg/LSource/src/cpmtools-2.13/cpmrm.c
  57. 35
      branches/dwg/LSource/src/cpmtools-2.13/device.h
  58. 76
      branches/dwg/LSource/src/cpmtools-2.13/device_libdsk.c
  59. 77
      branches/dwg/LSource/src/cpmtools-2.13/device_posix.c
  60. 658
      branches/dwg/LSource/src/cpmtools-2.13/device_win32.c
  61. 376
      branches/dwg/LSource/src/cpmtools-2.13/diskdefs
  62. BIN
      branches/dwg/LSource/src/cpmtools-2.13/fsck.cpm
  63. 74
      branches/dwg/LSource/src/cpmtools-2.13/fsck.cpm.1
  64. 74
      branches/dwg/LSource/src/cpmtools-2.13/fsck.cpm.1.in
  65. 627
      branches/dwg/LSource/src/cpmtools-2.13/fsck.cpm.c
  66. BIN
      branches/dwg/LSource/src/cpmtools-2.13/fsed.cpm
  67. 56
      branches/dwg/LSource/src/cpmtools-2.13/fsed.cpm.1
  68. 56
      branches/dwg/LSource/src/cpmtools-2.13/fsed.cpm.1.in
  69. 732
      branches/dwg/LSource/src/cpmtools-2.13/fsed.cpm.c
  70. 1195
      branches/dwg/LSource/src/cpmtools-2.13/getopt.c
  71. 171
      branches/dwg/LSource/src/cpmtools-2.13/getopt1.c
  72. 226
      branches/dwg/LSource/src/cpmtools-2.13/getopt_.h
  73. 131
      branches/dwg/LSource/src/cpmtools-2.13/getopt_int.h
  74. 520
      branches/dwg/LSource/src/cpmtools-2.13/install-sh
  75. 89
      branches/dwg/LSource/src/cpmtools-2.13/makefile.nt
  76. BIN
      branches/dwg/LSource/src/cpmtools-2.13/mkfs.cpm
  77. 64
      branches/dwg/LSource/src/cpmtools-2.13/mkfs.cpm.1
  78. 64
      branches/dwg/LSource/src/cpmtools-2.13/mkfs.cpm.1.in
  79. 175
      branches/dwg/LSource/src/cpmtools-2.13/mkfs.cpm.c
  80. 62
      branches/dwg/LSource/src/tasm-src-3.2/Doc/CopyRight.txt
  81. 196
      branches/dwg/LSource/src/tasm-src-3.2/Doc/OrderForm.htm
  82. 20
      branches/dwg/LSource/src/tasm-src-3.2/Doc/QuickStart.txt
  83. 34
      branches/dwg/LSource/src/tasm-src-3.2/Doc/ReleaseNotes.txt
  84. 252
      branches/dwg/LSource/src/tasm-src-3.2/Doc/TasmFAQ.htm
  85. 2865
      branches/dwg/LSource/src/tasm-src-3.2/Doc/TasmManual.htm
  86. 2989
      branches/dwg/LSource/src/tasm-src-3.2/Doc/TasmTableManual.htm
  87. 162
      branches/dwg/LSource/src/tasm-src-3.2/Examples/8051.h
  88. 20
      branches/dwg/LSource/src/tasm-src-3.2/Examples/moto.h
  89. 251
      branches/dwg/LSource/src/tasm-src-3.2/Examples/test05.asm
  90. 328
      branches/dwg/LSource/src/tasm-src-3.2/Examples/test3210.asm
  91. 1363
      branches/dwg/LSource/src/tasm-src-3.2/Examples/test3225.asm
  92. 279
      branches/dwg/LSource/src/tasm-src-3.2/Examples/test48.asm
  93. 297
      branches/dwg/LSource/src/tasm-src-3.2/Examples/test51.asm
  94. 298
      branches/dwg/LSource/src/tasm-src-3.2/Examples/test65.asm
  95. 422
      branches/dwg/LSource/src/tasm-src-3.2/Examples/test68.asm
  96. 305
      branches/dwg/LSource/src/tasm-src-3.2/Examples/test70.asm
  97. 0
      branches/dwg/LSource/src/tasm-src-3.2/Examples/test80.lst
  98. 0
      branches/dwg/LSource/src/tasm-src-3.2/Examples/test80.obj
  99. 294
      branches/dwg/LSource/src/tasm-src-3.2/Examples/test85.asm
  100. 887
      branches/dwg/LSource/src/tasm-src-3.2/Examples/test96.asm

BIN
branches/dwg/LSource/src/cpmtools-2.13.tar

Binary file not shown.

14
branches/dwg/LSource/src/cpmtools-2.13/.depend

@ -1,14 +0,0 @@
cpmchattr.o: cpmchattr.c config.h getopt_.h cpmfs.h device.h
cpmchmod.o: cpmchmod.c config.h getopt_.h cpmfs.h device.h
cpmcp.o: cpmcp.c config.h getopt_.h cpmfs.h device.h
cpmfs.o: cpmfs.c config.h cpmdir.h cpmfs.h device.h
cpmls.o: cpmls.c config.h getopt_.h cpmfs.h device.h
cpmrm.o: cpmrm.c config.h getopt_.h cpmfs.h device.h
device_libdsk.o: device_libdsk.c config.h device.h
device_posix.o: device_posix.c config.h device.h
device_win32.o: device_win32.c config.h cpmdir.h cpmfs.h device.h
fsck.cpm.o: fsck.cpm.c config.h getopt_.h cpmdir.h cpmfs.h device.h
fsed.cpm.o: fsed.cpm.c config.h cpmfs.h device.h
getopt.o: getopt.c config.h getopt_.h getopt_int.h
getopt1.o: getopt1.c config.h getopt_.h getopt_int.h
mkfs.cpm.o: mkfs.cpm.c config.h getopt_.h cpmfs.h device.h

676
branches/dwg/LSource/src/cpmtools-2.13/COPYING

@ -1,676 +0,0 @@
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>.

212
branches/dwg/LSource/src/cpmtools-2.13/INSTALL

@ -1,212 +0,0 @@
Options for "./configure" include:
--with-defformat=<default-format>
Set the standard format the cpmtools will use.
Default is ibm-3740
--with-libdsk=path
Use LibDsk to access raw files, .DSK files, MYZ80
files and Unix/Windows floppy drives. This library
is available at:
http://www.seasip.demon.co.uk/Unix/LibDsk/
--with-dmalloc
Use the dmalloc library
--disable-floppy
Disable the direct floppy access in LibDsk, so that it only
contains drivers for raw files, .DSK files and MYZ80 files.
All the cpmtools that use LibDsk have an extra option: -T <type>. This
sets the drive type used by LibDsk, and is one of:
"floppy" - The computer's floppy drive (only supported on Linux and Win32)
"raw" - Raw file (or the floppy drive on other Unix systems)
"dsk" - .DSK file
"myz80" - MYZ80 hard drive file
It will normally only be necessary to include "-T" when you are
accessing a MYZ80 file, because LibDsk can detect the other file types
automatically. "-T" options are ignored if LibDsk is not being used.
Basic Installation
==================
These are generic installation instructions.
The `configure' shell script attempts to guess correct values for
various system-dependent variables used during compilation. It uses
those values to create a `Makefile' in each directory of the package.
It may also create one or more `.h' files containing system-dependent
definitions. Finally, it creates a shell script `config.status' that
you can run in the future to recreate the current configuration, a file
`config.cache' that saves the results of its tests to speed up
reconfiguring, and a file `config.log' containing compiler output
(useful mainly for debugging `configure').
If you need to do unusual things to compile the package, please try
to figure out how `configure' could check whether to do them, and mail
diffs or instructions to the address given in the `README' so they can
be considered for the next release. If at some point `config.cache'
contains results you don't want to keep, you may remove or edit it.
The file `configure.in' is used to create `configure' by a program
called `autoconf'. You only need `configure.in' if you want to change
it or regenerate `configure' using a newer version of `autoconf'.
The simplest way to compile this package is:
1. `cd' to the directory containing the package's source code and type
`./configure' to configure the package for your system. If you're
using `csh' on an old version of System V, you might need to type
`sh ./configure' instead to prevent `csh' from trying to execute
`configure' itself.
Running `configure' takes awhile. While running, it prints some
messages telling which features it is checking for.
2. Type `make' to compile the package.
3. Optionally, type `make check' to run any self-tests that come with
the package.
4. Type `make install' to install the programs and any data files and
documentation.
5. You can remove the program binaries and object files from the
source code directory by typing `make clean'. To also remove the
files that `configure' created (so you can compile the package for
a different kind of computer), type `make distclean'. There is
also a `make maintainer-clean' target, but that is intended mainly
for the package's developers. If you use it, you may have to get
all sorts of other programs in order to regenerate files that came
with the distribution.
Compilers and Options
=====================
Some systems require unusual options for compilation or linking that
the `configure' script does not know about. You can give `configure'
initial values for variables by setting them in the environment. Using
a Bourne-compatible shell, you can do that on the command line like
this:
CC=c89 CFLAGS=-O2 LIBS=-lposix ./configure
Or on systems that have the `env' program, you can do it like this:
env CPPFLAGS=-I/usr/local/include LDFLAGS=-s ./configure
Compiling For Multiple Architectures
====================================
You can compile the package for more than one kind of computer at the
same time, by placing the object files for each architecture in their
own directory. To do this, you must use a version of `make' that
supports the `VPATH' variable, such as GNU `make'. `cd' to the
directory where you want the object files and executables to go and run
the `configure' script. `configure' automatically checks for the
source code in the directory that `configure' is in and in `..'.
If you have to use a `make' that does not supports the `VPATH'
variable, you have to compile the package for one architecture at a time
in the source code directory. After you have installed the package for
one architecture, use `make distclean' before reconfiguring for another
architecture.
Installation Names
==================
By default, `make install' will install the package's files in
`/usr/local/bin', `/usr/local/man', etc. You can specify an
installation prefix other than `/usr/local' by giving `configure' the
option `--prefix=PATH'.
You can specify separate installation prefixes for
architecture-specific files and architecture-independent files. If you
give `configure' the option `--exec-prefix=PATH', the package will use
PATH as the prefix for installing programs and libraries.
Documentation and other data files will still use the regular prefix.
In addition, if you use an unusual directory layout you can give
options like `--bindir=PATH' to specify different values for particular
kinds of files. Run `configure --help' for a list of the directories
you can set and what kinds of files go in them.
If the package supports it, you can cause programs to be installed
with an extra prefix or suffix on their names by giving `configure' the
option `--program-prefix=PREFIX' or `--program-suffix=SUFFIX'.
Optional Features
=================
Some packages pay attention to `--enable-FEATURE' options to
`configure', where FEATURE indicates an optional part of the package.
They may also pay attention to `--with-PACKAGE' options, where PACKAGE
is something like `gnu-as' or `x' (for the X Window System). The
`README' should mention any `--enable-' and `--with-' options that the
package recognizes.
For packages that use the X Window System, `configure' can usually
find the X include and library files automatically, but if it doesn't,
you can use the `configure' options `--x-includes=DIR' and
`--x-libraries=DIR' to specify their locations.
Specifying the System Type
==========================
There may be some features `configure' can not figure out
automatically, but needs to determine by the type of host the package
will run on. Usually `configure' can figure that out, but if it prints
a message saying it can not guess the host type, give it the
`--host=TYPE' option. TYPE can either be a short name for the system
type, such as `sun4', or a canonical name with three fields:
CPU-COMPANY-SYSTEM
See the file `config.sub' for the possible values of each field. If
`config.sub' isn't included in this package, then this package doesn't
need to know the host type.
If you are building compiler tools for cross-compiling, you can also
use the `--target=TYPE' option to select the type of system they will
produce code for and the `--build=TYPE' option to select the type of
system on which you are compiling the package.
Sharing Defaults
================
If you want to set default values for `configure' scripts to share,
you can create a site shell script called `config.site' that gives
default values for variables like `CC', `cache_file', and `prefix'.
`configure' looks for `PREFIX/share/config.site' if it exists, then
`PREFIX/etc/config.site' if it exists. Or, you can set the
`CONFIG_SITE' environment variable to the location of the site script.
A warning: not all `configure' scripts look for a site script.
Operation Controls
==================
`configure' recognizes the following options to control how it
operates.
`--cache-file=FILE'
Use and save the results of the tests in FILE instead of
`./config.cache'. Set FILE to `/dev/null' to disable caching, for
debugging `configure'.
`--help'
Print a summary of the options to `configure', and exit.
`--quiet'
`--silent'
`-q'
Do not print messages saying which checks are being made. To
suppress all normal output, redirect it to `/dev/null' (any error
messages will still be shown).
`--srcdir=DIR'
Look for the package's source code in directory DIR. Usually
`configure' can determine that directory automatically.
`--version'
Print the version of Autoconf used to generate the `configure'
script, and exit.
`configure' also accepts some other, not widely useful, options.

114
branches/dwg/LSource/src/cpmtools-2.13/Makefile

@ -1,114 +0,0 @@
srcdir= .
libdir= ${exec_prefix}/lib
BINDIR= ${exec_prefix}/bin
MANDIR= ${datarootdir}/man
includedir= ${prefix}/include
exec_prefix= ${prefix}
prefix= /usr/local
datarootdir= ${prefix}/share
INSTALL= /usr/bin/install -c
INSTALL_DATA= ${INSTALL} -m 644
CC= gcc
CFLAGS= -g -O2 -pipe -Wall -Wno-unused -Wshadow -Wbad-function-cast -Wmissing-prototypes -Wstrict-prototypes -Wcast-align -Wcast-qual -Wpointer-arith -Wwrite-strings -Wmissing-declarations -Wnested-externs -Wundef -pedantic -fno-common
LDFLAGS= -g
DEFFORMAT= ibm-3740
DISKDEFS= ${datarootdir}/diskdefs
DEVICE= posix
FSED_CPM= fsed.cpm
EXEEXT =
OBJEXT = .o
LIBS= -lcurses
LDDEPS=
CPPFLAGS= -DDISKDEFS=\"$(DISKDEFS)\" -DFORMAT=\"$(DEFFORMAT)\"
#
# I'm only a novice and I haven't worked out how to autoconf this one
#
#MAKEDEPEND= mkdep -d
MAKEDEPEND= gcc -MM
#MAKEDEPEND= makedepend -f-
DEVICEOBJ= device_$(DEVICE)$(OBJEXT)
ALL= cpmls$(EXEEXT) cpmrm$(EXEEXT) cpmcp$(EXEEXT) \
cpmchmod$(EXEEXT) cpmchattr$(EXEEXT) mkfs.cpm$(EXEEXT) \
fsck.cpm$(EXEEXT) $(FSED_CPM)
all: $(ALL)
LibDsk/libdsk.a:
cd LibDsk && make
cpmls$(EXEEXT): cpmls$(OBJEXT) cpmfs$(OBJEXT) getopt$(OBJEXT) getopt1$(OBJEXT) $(DEVICEOBJ) $(LDDEPS)
$(CC) $(LDFLAGS) -o $@ cpmls$(OBJEXT) cpmfs$(OBJEXT) getopt$(OBJEXT) getopt1$(OBJEXT) $(DEVICEOBJ) $(LIBS)
cpmrm$(EXEEXT): cpmrm$(OBJEXT) cpmfs$(OBJEXT) getopt$(OBJEXT) getopt1$(OBJEXT) $(DEVICEOBJ) $(LDDEPS)
$(CC) $(LDFLAGS) -o $@ cpmrm$(OBJEXT) cpmfs$(OBJEXT) getopt$(OBJEXT) getopt1$(OBJEXT) $(DEVICEOBJ) $(LIBS)
cpmcp$(EXEEXT): cpmcp$(OBJEXT) cpmfs$(OBJEXT) getopt$(OBJEXT) getopt1$(OBJEXT) $(DEVICEOBJ) $(LDDEPS)
$(CC) $(LDFLAGS) -o $@ cpmcp$(OBJEXT) cpmfs$(OBJEXT) getopt$(OBJEXT) getopt1$(OBJEXT) $(DEVICEOBJ) $(LIBS)
cpmchmod$(EXEEXT): cpmchmod$(OBJEXT) cpmfs$(OBJEXT) getopt$(OBJEXT) getopt1$(OBJEXT) $(DEVICEOBJ) $(LDDEPS)
$(CC) $(LDFLAGS) -o $@ cpmchmod$(OBJEXT) cpmfs$(OBJEXT) getopt$(OBJEXT) getopt1$(OBJEXT) $(DEVICEOBJ) $(LIBS)
cpmchattr$(EXEEXT): cpmchattr$(OBJEXT) cpmfs$(OBJEXT) getopt$(OBJEXT) getopt1$(OBJEXT) $(DEVICEOBJ) $(LDDEPS)
$(CC) $(LDFLAGS) -o $@ cpmchattr$(OBJEXT) cpmfs$(OBJEXT) getopt$(OBJEXT) getopt1$(OBJEXT) $(DEVICEOBJ) $(LIBS)
mkfs.cpm$(EXEEXT): mkfs.cpm$(OBJEXT) cpmfs$(OBJEXT) getopt$(OBJEXT) getopt1$(OBJEXT) $(DEVICEOBJ) $(LDDEPS)
$(CC) $(LDFLAGS) -o $@ mkfs.cpm$(OBJEXT) cpmfs$(OBJEXT) getopt$(OBJEXT) getopt1$(OBJEXT) $(DEVICEOBJ) $(LIBS)
fsck.cpm$(EXEEXT): fsck.cpm$(OBJEXT) cpmfs$(OBJEXT) getopt$(OBJEXT) getopt1$(OBJEXT) $(DEVICEOBJ) $(LDDEPS)
$(CC) $(LDFLAGS) -o $@ fsck.cpm$(OBJEXT) cpmfs$(OBJEXT) getopt$(OBJEXT) getopt1$(OBJEXT) $(DEVICEOBJ) $(LIBS)
fsed.cpm$(EXEEXT): fsed.cpm$(OBJEXT) cpmfs$(OBJEXT) getopt$(OBJEXT) getopt1$(OBJEXT) $(DEVICEOBJ) $(LDDEPS)
$(CC) $(LDFLAGS) -o $@ fsed.cpm$(OBJEXT) cpmfs$(OBJEXT) getopt$(OBJEXT) getopt1$(OBJEXT) $(DEVICEOBJ) $(LIBS)
fsck.test: fsck.cpm
-./fsck.cpm -f ibm-3740 -n badfs/status
-./fsck.cpm -f ibm-3740 -n badfs/extno
-./fsck.cpm -f ibm-3740 -n badfs/lcr
-./fsck.cpm -f ibm-3740 -n badfs/name
-./fsck.cpm -f ibm-3740 -n badfs/extension
-./fsck.cpm -f ibm-3740 -n badfs/blocknumber
-./fsck.cpm -f ibm-3740 -n badfs/recordcount
-./fsck.cpm -f ibm-3740 -n badfs/hugecom
-./fsck.cpm -f ibm-3740 -n badfs/timestamps
-./fsck.cpm -f ibm-3740 -n badfs/multipleblocks
-./fsck.cpm -f ibm-3740 -n badfs/doubleext
-./fsck.cpm -f pcw -n badfs/label
install: all
$(INSTALL) -s -m 755 cpmls $(BINDIR)/cpmls
$(INSTALL) -s -m 755 cpmcp $(BINDIR)/cpmcp
$(INSTALL) -s -m 755 cpmrm $(BINDIR)/cpmrm
$(INSTALL) -s -m 755 cpmchmod $(BINDIR)/cpmchmod
$(INSTALL) -s -m 755 cpmchattr $(BINDIR)/cpmchattr
$(INSTALL) -s -m 755 mkfs.cpm $(BINDIR)/mkfs.cpm
$(INSTALL) -s -m 755 fsck.cpm $(BINDIR)/fsck.cpm
[ $(FSED_CPM) != '' ] && $(INSTALL) -s -m 755 fsed.cpm $(BINDIR)/fsed.cpm
$(INSTALL_DATA) diskdefs ${prefix}/share/diskdefs
$(INSTALL_DATA) cpmls.1 $(MANDIR)/man1/cpmls.1
$(INSTALL_DATA) cpmcp.1 $(MANDIR)/man1/cpmcp.1
$(INSTALL_DATA) cpmrm.1 $(MANDIR)/man1/cpmrm.1
$(INSTALL_DATA) cpmchmod.1 $(MANDIR)/man1/cpmchmod.1
$(INSTALL_DATA) cpmchattr.1 $(MANDIR)/man1/cpmchattr.1
$(INSTALL_DATA) mkfs.cpm.1 $(MANDIR)/man1/mkfs.cpm.1
$(INSTALL_DATA) fsck.cpm.1 $(MANDIR)/man1/fsck.cpm.1
$(INSTALL_DATA) fsed.cpm.1 $(MANDIR)/man1/fsed.cpm.1
$(INSTALL_DATA) cpm.5 $(MANDIR)/man5/cpm.5
clean:
rm -f *$(OBJEXT)
distclean: clean
rm -rf $(ALL) autom4te.cache config.log config.cache config.h config.status Makefile *.out
tar: distclean
(b=`pwd`; b=`basename $$b`; cd ..; tar zcvf $$b.tar.gz $$b)
depend:
$(MAKEDEPEND) $(CPPFLAGS) *.c >.depend
include .depend

114
branches/dwg/LSource/src/cpmtools-2.13/Makefile.in

@ -1,114 +0,0 @@
srcdir= @srcdir@
VPATH= @srcdir@
libdir= @libdir@
BINDIR= @bindir@
MANDIR= @mandir@
includedir= @includedir@
exec_prefix= @exec_prefix@
prefix= @prefix@
datarootdir= @datarootdir@
INSTALL= @INSTALL@
INSTALL_DATA= @INSTALL_DATA@
CC= @CC@
CFLAGS= @CFLAGS@
LDFLAGS= @LDFLAGS@
DEFFORMAT= @DEFFORMAT@
DISKDEFS= @DISKDEFS@
DEVICE= @DEVICE@
FSED_CPM= @FSED_CPM@
EXEEXT = @EXEEXT@
OBJEXT = .@OBJEXT@
LIBS= @LIBS@ @LDLIBS@
LDDEPS= @LDDEPS@
CPPFLAGS= @CPPFLAGS@ -DDISKDEFS=\"$(DISKDEFS)\" -DFORMAT=\"$(DEFFORMAT)\"
#
# I'm only a novice and I haven't worked out how to autoconf this one
#
#MAKEDEPEND= mkdep -d
MAKEDEPEND= gcc -MM
#MAKEDEPEND= makedepend -f-
DEVICEOBJ= device_$(DEVICE)$(OBJEXT)
ALL= cpmls$(EXEEXT) cpmrm$(EXEEXT) cpmcp$(EXEEXT) \
cpmchmod$(EXEEXT) cpmchattr$(EXEEXT) mkfs.cpm$(EXEEXT) \
fsck.cpm$(EXEEXT) $(FSED_CPM)
all: $(ALL)
LibDsk/libdsk.a:
cd LibDsk && make
cpmls$(EXEEXT): cpmls$(OBJEXT) cpmfs$(OBJEXT) getopt$(OBJEXT) getopt1$(OBJEXT) $(DEVICEOBJ) $(LDDEPS)
$(CC) $(LDFLAGS) -o $@ cpmls$(OBJEXT) cpmfs$(OBJEXT) getopt$(OBJEXT) getopt1$(OBJEXT) $(DEVICEOBJ) $(LIBS)
cpmrm$(EXEEXT): cpmrm$(OBJEXT) cpmfs$(OBJEXT) getopt$(OBJEXT) getopt1$(OBJEXT) $(DEVICEOBJ) $(LDDEPS)
$(CC) $(LDFLAGS) -o $@ cpmrm$(OBJEXT) cpmfs$(OBJEXT) getopt$(OBJEXT) getopt1$(OBJEXT) $(DEVICEOBJ) $(LIBS)
cpmcp$(EXEEXT): cpmcp$(OBJEXT) cpmfs$(OBJEXT) getopt$(OBJEXT) getopt1$(OBJEXT) $(DEVICEOBJ) $(LDDEPS)
$(CC) $(LDFLAGS) -o $@ cpmcp$(OBJEXT) cpmfs$(OBJEXT) getopt$(OBJEXT) getopt1$(OBJEXT) $(DEVICEOBJ) $(LIBS)
cpmchmod$(EXEEXT): cpmchmod$(OBJEXT) cpmfs$(OBJEXT) getopt$(OBJEXT) getopt1$(OBJEXT) $(DEVICEOBJ) $(LDDEPS)
$(CC) $(LDFLAGS) -o $@ cpmchmod$(OBJEXT) cpmfs$(OBJEXT) getopt$(OBJEXT) getopt1$(OBJEXT) $(DEVICEOBJ) $(LIBS)
cpmchattr$(EXEEXT): cpmchattr$(OBJEXT) cpmfs$(OBJEXT) getopt$(OBJEXT) getopt1$(OBJEXT) $(DEVICEOBJ) $(LDDEPS)
$(CC) $(LDFLAGS) -o $@ cpmchattr$(OBJEXT) cpmfs$(OBJEXT) getopt$(OBJEXT) getopt1$(OBJEXT) $(DEVICEOBJ) $(LIBS)
mkfs.cpm$(EXEEXT): mkfs.cpm$(OBJEXT) cpmfs$(OBJEXT) getopt$(OBJEXT) getopt1$(OBJEXT) $(DEVICEOBJ) $(LDDEPS)
$(CC) $(LDFLAGS) -o $@ mkfs.cpm$(OBJEXT) cpmfs$(OBJEXT) getopt$(OBJEXT) getopt1$(OBJEXT) $(DEVICEOBJ) $(LIBS)
fsck.cpm$(EXEEXT): fsck.cpm$(OBJEXT) cpmfs$(OBJEXT) getopt$(OBJEXT) getopt1$(OBJEXT) $(DEVICEOBJ) $(LDDEPS)
$(CC) $(LDFLAGS) -o $@ fsck.cpm$(OBJEXT) cpmfs$(OBJEXT) getopt$(OBJEXT) getopt1$(OBJEXT) $(DEVICEOBJ) $(LIBS)
fsed.cpm$(EXEEXT): fsed.cpm$(OBJEXT) cpmfs$(OBJEXT) getopt$(OBJEXT) getopt1$(OBJEXT) $(DEVICEOBJ) $(LDDEPS)
$(CC) $(LDFLAGS) -o $@ fsed.cpm$(OBJEXT) cpmfs$(OBJEXT) getopt$(OBJEXT) getopt1$(OBJEXT) $(DEVICEOBJ) $(LIBS)
fsck.test: fsck.cpm
-./fsck.cpm -f ibm-3740 -n badfs/status
-./fsck.cpm -f ibm-3740 -n badfs/extno
-./fsck.cpm -f ibm-3740 -n badfs/lcr
-./fsck.cpm -f ibm-3740 -n badfs/name
-./fsck.cpm -f ibm-3740 -n badfs/extension
-./fsck.cpm -f ibm-3740 -n badfs/blocknumber
-./fsck.cpm -f ibm-3740 -n badfs/recordcount
-./fsck.cpm -f ibm-3740 -n badfs/hugecom
-./fsck.cpm -f ibm-3740 -n badfs/timestamps
-./fsck.cpm -f ibm-3740 -n badfs/multipleblocks
-./fsck.cpm -f ibm-3740 -n badfs/doubleext
-./fsck.cpm -f pcw -n badfs/label
install: all
$(INSTALL) -s -m 755 cpmls $(BINDIR)/cpmls
$(INSTALL) -s -m 755 cpmcp $(BINDIR)/cpmcp
$(INSTALL) -s -m 755 cpmrm $(BINDIR)/cpmrm
$(INSTALL) -s -m 755 cpmchmod $(BINDIR)/cpmchmod
$(INSTALL) -s -m 755 cpmchattr $(BINDIR)/cpmchattr
$(INSTALL) -s -m 755 mkfs.cpm $(BINDIR)/mkfs.cpm
$(INSTALL) -s -m 755 fsck.cpm $(BINDIR)/fsck.cpm
[ $(FSED_CPM) != '' ] && $(INSTALL) -s -m 755 fsed.cpm $(BINDIR)/fsed.cpm
$(INSTALL_DATA) diskdefs @datarootdir@/diskdefs
$(INSTALL_DATA) cpmls.1 $(MANDIR)/man1/cpmls.1
$(INSTALL_DATA) cpmcp.1 $(MANDIR)/man1/cpmcp.1
$(INSTALL_DATA) cpmrm.1 $(MANDIR)/man1/cpmrm.1
$(INSTALL_DATA) cpmchmod.1 $(MANDIR)/man1/cpmchmod.1
$(INSTALL_DATA) cpmchattr.1 $(MANDIR)/man1/cpmchattr.1
$(INSTALL_DATA) mkfs.cpm.1 $(MANDIR)/man1/mkfs.cpm.1
$(INSTALL_DATA) fsck.cpm.1 $(MANDIR)/man1/fsck.cpm.1
$(INSTALL_DATA) fsed.cpm.1 $(MANDIR)/man1/fsed.cpm.1
$(INSTALL_DATA) cpm.5 $(MANDIR)/man5/cpm.5
clean:
rm -f *$(OBJEXT)
distclean: clean
rm -rf $(ALL) autom4te.cache config.log config.cache config.h config.status Makefile *.out
tar: distclean
(b=`pwd`; b=`basename $$b`; cd ..; tar zcvf $$b.tar.gz $$b)
depend:
$(MAKEDEPEND) $(CPPFLAGS) *.c >.depend
include .depend

3
branches/dwg/LSource/src/cpmtools-2.13/NEWS

@ -1,3 +0,0 @@
Changes since 2.13:
o Avoid unneccessary directory writes

43
branches/dwg/LSource/src/cpmtools-2.13/README

@ -1,43 +0,0 @@
This package allows to access CP/M file systems similar to the well-known
mtools package, which accesses MSDOS file systems. I use it for file
exchange with a Z80-PC simulator, but it works on floppy devices as well.
Currently it contains:
o cpmls - list sorted directory with output similar to ls, DIR, P2DOS
DIR and CP/M3 DIR[FULL]
o cpmcp - copy files from and to CP/M file systems
o cpmrm - erase files from CP/M file systems
o cpmchmod - change file permissions
o cpmchattr - change file attributes
o mkfs.cpm - make a CP/M file system
o fsck.cpm - check and repair a CP/M file system (only simple errors
can be repaired so far). Some images of broken file systems are provided
for testing.
o fsed.cpm - view CP/M file system
o manual pages for everything including the CP/M file system format
All CP/M file system features are supported. Password protection
is ignored, because passwords are easy to decrypt, but a pseudo file
[passwd] contains them, if you are curious what your old password has
been. The disk label is read as special file [label]. User numbers
are specified as user:file.
Cpmtools should compile and work out of the box on each POSIX compliant
system. It can be additionally compiled for Win32 systems. The source
is available as a GNU zipped tape archive from:
http://www.moria.de/~michael/cpmtools/
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, write to the Free Software Foundation, Inc.,
59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.

9
branches/dwg/LSource/src/cpmtools-2.13/README.win32-libdsk

@ -1,9 +0,0 @@
Under Windows 95/98, if a program name has more than one dot, you have to
add the ".exe" extension to the command. So you should use "fsck.cpm.exe"
rather than just "fsck.cpm".
If you have appropriate rights, the CPMTOOLS should be able to access
the floppy drive by using "A:" or "B:" as the name of the disc image.
"mkfs.cpm" and "fsed.cpm" don't have this capability.
John Elliott, 18 June 2000

518
branches/dwg/LSource/src/cpmtools-2.13/README.win32.cygwin.txt

@ -1,518 +0,0 @@
README.win32.cygwin.txt
-----------------------
Building cpmtools-2.9 in Windows XP using:
- cpmtools http://www.moria.de/~michael/cpmtools/
- cygwin and the ncurses library - http://www.cygwin.com/
"The experts will always complain about shorter documents that do do not
provide enough details to confuse the rest of us, and longer documents that
do not omit enough details to confuse the rest of us. No documentation is
needed for people of that calibre."
- Bill Buckels, November 2008
This document is provided 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. In particular, Bill Buckels has no warranty obligations
or liability resulting from its use in any way whatsoever. If you don't agree
then don't read it.
Introduction
------------
This document is intended as a general guideline. An annotated summary is
provided directly below especially for expert users followed by annotated
details.
Please review the other documentation and source code that comes with
cpmtools for more information about cpmtools. Please review the cygwin
documentation for more information about cygwin.
At time of this writing, I have used the latest versions of the packages
listed above to build the latest version of cpmtools in its entirety. I have
documented the steps I followed below.
Although there are probably other environments and compilers that can build
cpmtools for Windows I have not been successful in using the other several I
tried. Using a complete cygwin installation I had no problems and I had
cpmtools built in moments after I had cygwin installed and the cpmtools
source in place as documented below.
Intended Audience
-----------------
This document takes two tracks for installing cpmtools binary executables
after they have been built in cygwin:
1. End users who will run cpmtools from within the cygwin shell. This
includes unix users who do not want to use the native Windows command line.
2. End users who will run cpmtools from the native Windows command line. The
average Windows user does not have cygwin, and probably won't want to install
cygwin or learn a unix-like shell to use cpmtools.
The consideration here is where cpmtools looks for its CP/M disk format
definitions file (diskdefs) when not in a unix-like environment like cygwin
and this consideration will affect the way you build cpmtools since this path
is hardcoded into the binary executables.
My hope is that this document will help address the needs of both types of
Windows end users and those who wish to provide cpmtools to them.
Summary
-------
- Install cygwin with ncurses.
- Download cpmtools-2.9.tar.tar to your cygwin home directory.
- Start cygwin from the shortcut on the Windows desktop.
- Enter the following commands:
tar -xvf cpmtools.tar.tar
cd cpmtools-2.9
./configure --with-diskdefs=/usr/local/share/diskdefs
make
mkdir /usr/local/share
mkdir /usr/local/share/man
mkdir /usr/local/share/man/man1
mkdir /usr/local/share/man/man5
make install
Assumptions
-----------
The above builds cpmtools under cygwin for end users who will use cpmtools in
the cygwin shell and who will use the default installation.
I am assuming in this summary that all has gone well and that anyone who
deviates from what I have done or who has customized their cygwin
installation will be able to troubleshoot their own problems,
I therefore make the following related assumptions in this summary:
- That compiler related programs and libraries required to build cpmtools
under cygwin (including ncurses) are installed.
- That you wish to download into and work under your home directory. You may
also consider whether a better place to download is in /usr/local/src and
whether you should install in the binaries in /opt/cpmtools/ and things of
that nature.
Default Format
--------------
You can change the default format to accomodate the special needs of your
users so they don't need to type their favorite format. The following line
can be entered to configure for an apple-do default format:
./configure --with-defformat="apple-do" --with-diskdefs=/usr/local/share/diskdefs
Native Windows Installation
---------------------------
If you wish to distribute your binaries to Windows end users who will not
have the cygwin shell and who will use the Windows command line, you have 2
options:
1. Require your users to always work in the same directory as diskdefs.
- or -
2. Hardcode the default diskdefs path into your binary executables and
require your users to always use the expected directory for diskdefs.
The following line shows how to configure for an apple-do default format and
to set the default diskdefs path in a mannner that is acceptable to Windows
to a relative path from the root of the current drive:
./configure --with-defformat="apple-do" --with-diskdefs=/cpmtools/diskdefs
Cross-Cygwin Binary Installation
--------------------------------
You can still use the binaries built as above and installed using "make
install" in cygwin if you add the following line to /etc/fstab (assuming your
cygdrive is the Windows C:drive):
c:\cygwin\usr\local\share /cpmtools
Making a Zip Installation for Native Windows Users
--------------------------------------------------
If your target is the Windows user who does not have cygwin you can do the
following in cygwin in your build directory to create a zip file that will
contain the cpmtools binary executables:
- mkdir cpmtools
- cp *.exe cpmtools/.
- cp diskdefs cpmtools/.
- cp /bin/cygwin1.dll cpmtools/.
- cp /bin/cygncurses-8.dll cpmtools/.
- zip -R cpmtools/*.*
Making Documentation for Native Windows Users
---------------------------------------------
If you wish to provide the cpmtools manual pages in html format you can use
man2html to generate your html in ugly format and redirect to a file and edit
by hand. Here's an example:
man2html -r cpm.5 > cpm.html
If you wish to avoid html and provide the cpmtools manual pages in text
format you can use troff to generate your text in ugly format and redirect to
a file and edit by hand. Here's an example:
troff -a cpm.5 > cpm.txt
This concludes the summary.
Details, Alternatives, and Other Fluff
--------------------------------------
1.cygwin
--------
Cygwin gave me a complete and free environment to both configure and build
cpmtools in its entirety.
I installed cygwin from http://www.cygwin.com/ in its entirety which included
the ncurses library and when prompted to select a download site I chose
ftp://mirrors.kernel.org/sourceware/cygwin/
The site you pick will depend on your own preference and how much of cygwin
you decide to install will be up to you. I have a good Internet connection
and a large hard disk so installing ALL of cygwin was no problem for me.
Those who don't may wish to attempt an incremental installation which I
personally found to be annoying and tedious.
It is not necessary to install ALL cygwin options. Another alternative is to
take the minimalistic approach and just install the compiler related
programs and libraries required to build cpmtools (including ncurses). If you
have missed something you will still be able to select additional components
via Cygwin Setup.
By default cygwin installs into c:\cygwin and puts a shortcut on the Windows
desktop. By default the cygwin shell starts in your cygwin home directory
under c:\cygwin\home\. I used the cygwin default paths for my installation of
cygwin.
2. cpmtoools
------------
I then downloaded Download cpmtools-2.9 from
http://www.moria.de/~michael/cpmtools/
and used WinRAR to extract cpmtools-2.9 to
C:\cygwin\home\bbuckels\cpmtools-2.9\
I have noted in the summary that tar can be used. Use whatever you are
comfortable with to handle things from unix of a tarball nature.
3. Building
-----------
3.1. I started cygwin by clicking on the cygwin shortcut on my desktop which
placed me into my cygwin home directory in the cygwin shell.
3.2 Now in the cygwin shell, I changed to the cpmtools directory by typing
the following and pressing the [Enter] key:
cd cpmtools-2.9
3.3 Running the configure script
--------------------------------
Before making cpmtools, the configure script must be run to create the
cpmtools makefile and the config.h header file required by cpmtools.
I ran the configure script with two options; to set the default format for
cpmtools to Apple II DOS 3.3 disk images and to tell cpmtools where to find
the diskdefs format definitions file (which is required to run cpmtools. See
far below.)
3.3.2 Building for use in the cygwin shell
------------------------------------------
If I was building for use in the cygwin shell and I was using the default
paths used by "make install" noted far below, to be certain that my diskdefs
file would be found and to set my default format to "apple-do" I would type
the following and press the [Enter] key:
./configure --with-defformat="apple-do" --with-diskdefs=/usr/local/share/diskdefs
3.3.1 Building for the Native Windows command line
---------------------------------------------------
To set the default format to "apple-do" and to provide a relative path for
native Windows to my diskefs file which I would later copy to C:\cpmtools\ ,
I typed the following and pressed the [Enter] key:
./configure --with-defformat="apple-do" --with-diskdefs=/cpmtools/diskdefs
Note: Windows paths are typed into the Windows native command line with
backslashes in the MS- DOS tradition. Historically the forward slash used by
unix as a path separator was used as a switch character in MS-DOS utilities
and this has carried forward with the commands that come with Windows. But in
a program, local Windows paths can be used with forward slashes instead and
they still work. Backslashes will cause problems for configure so use forward
slashes.
3.4. The configure script created my cpmtools makefile and config.h with the
options I chose. I then ran make by typing the following and pressing the
[Enter] Key.
make
This concludes the first part of the details section of this document and I
have covered the basic steps that I followed to build cpmtools. What you do
will likely be a close variation.
4. Installing
-------------
4.1 Some of this is also noted in the summary. Also keep in mind that if
cpmtools is used outside of cygwin access to the documentation which is in
the form of unix-style man pages will not be available unless reformatted to
a media type that Windows users are familiar with.
4.1.1 Installing for the cygwin shell
-----------------------------------
You can review the summary and the cpmtools INSTALL document for more
information on unix-like installations. Installation of cpmtools for use in
the cygwin shell follows those conventions.
If installing cpmtools to be used in cygwin using the cpmtools defaults and
assuming the directories below don't already exist, you will need to manually
create the following directories using the mkdir command as follows:
mkdir /usr/local/share
mkdir /usr/local/share/man
mkdir /usr/local/share/man/man1
mkdir /usr/local/share/man/man5
This is because the manual pages (man pages) will not be installed if you
don't. If you install the man pages, then when you need help on cpmtools in
cygwin, you can just enter "man cpmls" or "man cpmchmod", etc.
After you make the directories above enter the following command:
make install
Assuming all has gone well, cpmtools is now part of your cygwin installation
and can be used wherever you work in cygwin.
4.1.2 Installing for Use Outside Cygwin
---------------------------------------
Please also read the summary.
The requirements of my installation were to create a directory structure for
a binary executable version of cpmtools targetted at Apple II disk image
users that would run at the native Windows cmd prompt. I offer the following
for general reference. The cygwin paths are based on my installation of
cygwin and are presented using conventional windows pathname notation.
4.1.2.1 Dll's
-------------
Two dll's from the c:\cygwin\bin\ directory were required:
cygwin1.dll
cygncurses-8.dll
Regardless of installation, for this cygwin and this ncurses version access
to these dll's will be required by this version of the cpmtools excecutables.
4.2 Manually Placing Files for Use Outside Cygwin
-------------------------------------------------
I did my installation by hand.
My executables were created in c:\cygwin\home\bbuckels\cpmtools-2.9\ (my
cygwin home directory) which is also where the diskdefs file was.
I used Windows Explorer to manually do the following:
4.2.1 create c:\cpmtools\ directory.
4.2.2 copy all 8 exes into c:\cpmtools\
4.2.3 copy both dll's listed above into c:\cpmtools\
4.2.4 copy diskdefs into c:\cpmtools\
This gave me my directory structure and files for testing and distribution.
I also placed an Apple II CP/M disk image called EXMPLCPM.dsk in c:\cpmtools\
as a test target.
5. Additional Notes
-------------------
5.1 diskdefs - CP/M disk format definitions
--------------------------------------------
The diskdefs file is a plain ascii text file that serves as a database of
disk and disk image format definitions. It can be reviewed for available CP/M
formats and their names. For Apple II CP/M 80 users the disk image formats
apple-do and apple-po are available.
The possible locations where cpmtools first looks for the diskdefs file:
- Can vary depending on the preferences of the person who builds the cpmtools
binaries (executables) from the source code.
- The location is also installation dependent and the diskdefs file may also
have been renamed (but we hope not).
If it's not found the current (work) directory is then searched for a file
called diskdefs.
On a unix-like system, a ${prefix}/share/ style path like /usr/local/share/
is a possible place that cpmtools could be made to first look for diskdefs.
In a Win32 system sometimes unix-like shells like cygwin are used to run
cpmtools instead of Windows cmd. For those installations unix-like
conventions probably should apply.
For cpmtools installations targetted at the average Windows user who does not
have a unix-like shell and uses the Windows cmd prompt to run cpmtools there
is no standard shared place that cpmtools can be made to first look for
diskdefs. Pathed File names like \cpm\diskdefs or even c:\cpmtools\diskdefs
are possible.
5.2 Difficulties in using the Windows File System
---------------------------------------------------
This is not a troubleshooting guide. Unless you wish to find-out for yourself
as I did just how many problems you can face with all of this, or you are
really an expert, please do yourself a favour and try to stay within what I
am suggesting as standard or alternative ways of building cpmtools.
Missing libaries and compiler tools can be solved by trial and error and
reading the cygwin and cpmtools documentation.
There are however some things about path names and file names that you need
to be aware of, some of which I have mentioned throughout this document and
some which I deliberately did not mention yet, like avoiding absolute paths
and drive letters.
If you use a drive letter like C: when hardcoding a path to diskdefs you are
making several assumptions:
First off, you are assuming that your build of cpmtools will only be run from
within Windows cmd shell on the local drive C:, (not from a bash-like shell
like cygwin which doesn't support drive letters the same way Windows cmd and
Windows itself does), and that diskdefs will not be on another drive, and
that drive C: exists in the first place, and that diskdefs is not on a
Windows network either unless drive C:,X:,Y:,Z:,etc is a mapped network
drive. It is questionable whether cpmtools build process for diskdefs pathing
supports UNC pathing anyway. I couldn't get \\ to work since the first slash
disappears in the configure script and the second slash becomes an escape
sequence for the next letter.
Relative pathing will work and if you want to use conventions like
/cpmtools-2.9/diskedefs this will work. Environments like ${USERPROFILE}
aren't a good idea even if I could have got them to work since they are not
portable for several reasons and I will say no more on this except I
recommend that any path that you decide to use for diskdefs will only be
almost portable between shells if off the root directory and contains forward
slashes and no drive letters or colons.
I hope what I have said proved less confusing to read than to write if you
have bothered to read it. If you are not confused yet read further.
- Since cpmtools has special meanings for A: and B: as command line targets
it probably isn't a good idea to use these drives especially.
- Some programmers and users have no difficulty in shifts between unix-like
and Windows pathing. Some will be familiar with how colons are used on
systems like Mac OSX. I think the only point to be made here is to consider
your target audience and all the things you can anticipate going wrong with
interoperability of all of this, (cpmtools being a set of command line
tools), and build cpmtools accordingly for the needs of you or your users,
then test what you have built with all this in mind.
5.3 Testing your build of cpmtools
----------------------------------
To test what you have built I suggest you start with cpmls and cpmcp and an
apple disk image or equivalent.
John Elliot said "If you have appropriate rights, the CPMTOOLS should be able
to access the floppy drive by using "A:" or "B:" as the name of the disc
image.". I say don't bother mucking with your physical disk drive unless you
have a physical CP/M disk of a format supported by cpmtools safely in the
drive.
Get an apple CP/M disk image and use it for testing is what I suggest. The
following examples assume you have an Apple II DOS 3.3 order disk image
called EXMPLCPM.dsk for testing.
To list the files:
cpmls -f apple-do EXMPLCPM.dsk
The following example shows how to copy a file from an Apple II DOS 3.3 order
cpm disk image to the current directory:
cpmcp -f apple-do EXMPLCPM.dsk bhead.c 0:bhead.c
The following example shows how to copy a file to an Apple II DOS 3.3 order
cpm disk image from the current directory:
cpmcp -f apple-do EXMPLCPM.dsk 0:bhead.c bhead.c
To test the other utilities in cpmtools like cpmrm, cpmchattr, cpmchmod,
fsck.cpm and fsed.cpm, review the appropriate manpages for usage.
Those are simple tests as well using an apple-do format disk image. For
mkfs.cpm I will leave it to those more capable than I to decide what to do
there. Compared to them I am merely dangerous.
Acknowledgements and Stuff
--------------------------
Michael Haardt - for cpmtools in the first place and for his tireless and
ongoing efforts in supporting cpmtools in the second.
John Elliot - for bringing cpmtools to Windows.
My focus is on Windows XP (and other Windows) users and making this available
to them. At this point in time my focus is also on Apple II Z80 Softcard
users. Thankfully Michael Haardt has considered Apple II disk images in
cpmtools. My focus is also on the Aztec C Z80 MS-DOS cross-compiler which
creates Apple II CP/M programs in Windows XP.
Between Michael and John, with cpmtools I can now easily get these onto an
Apple disk image and transfer the disk image over to my real Apple II which
has a Z80 softcard clone using my Microdrive with a CF card and make a real
CP/M disk from the image with DISKMAKER.8 or DSK2FILE then run my Aztec C
CP/M programs using the real thing. I can also use the emulator that came
with Apple II Oasis to run the disk image.
Apparently nothing is missing from cpmtools for Windows XP that is available
on cpmtools for unix-like systems and I am thankful for that. Hopefully you
will be too.
I would also like to acknowledge the following individuals from the
comp.os.cpm and apple2.sys usenet newsgroups who gave their experience,
thoughts and encouragement during my adventure with all of this and in no
particular order:
David Schmidt - for cygwin feedback.
Udo Munk - for cygwin feedback.
Peter Dassow - for cygwin feedback.
Stevo Tarkin - for msys feedback.
Volker Pohlers - for msys and pdcurses feedback.
Rolf Harmann - for linux feedback.
Richard Brady - who may or may not know watfor:)
If I missed anyone, I thank them too. I am somewhat new to some of this and
needed all the help I received. cygwin is now my friend.
Bill Buckels
bbuckels@mts.net
November 2008

7
branches/dwg/LSource/src/cpmtools-2.13/badfs/Makefile

@ -1,7 +0,0 @@
#
# Dummy makefile
#
all:
clean:
distclean:

BIN
branches/dwg/LSource/src/cpmtools-2.13/badfs/blocknumber

Binary file not shown.

BIN
branches/dwg/LSource/src/cpmtools-2.13/badfs/doubleext

Binary file not shown.

BIN
branches/dwg/LSource/src/cpmtools-2.13/badfs/extension

Binary file not shown.

BIN
branches/dwg/LSource/src/cpmtools-2.13/badfs/extno

Binary file not shown.

BIN
branches/dwg/LSource/src/cpmtools-2.13/badfs/hugecom

Binary file not shown.

BIN
branches/dwg/LSource/src/cpmtools-2.13/badfs/label

Binary file not shown.

BIN
branches/dwg/LSource/src/cpmtools-2.13/badfs/lcr

Binary file not shown.

BIN
branches/dwg/LSource/src/cpmtools-2.13/badfs/multipleblocks

Binary file not shown.

BIN
branches/dwg/LSource/src/cpmtools-2.13/badfs/name

Binary file not shown.

BIN
branches/dwg/LSource/src/cpmtools-2.13/badfs/recordcount

Binary file not shown.

BIN
branches/dwg/LSource/src/cpmtools-2.13/badfs/status

Binary file not shown.

BIN
branches/dwg/LSource/src/cpmtools-2.13/badfs/timestamps

Binary file not shown.

1498
branches/dwg/LSource/src/cpmtools-2.13/config.guess

File diff suppressed because it is too large

55
branches/dwg/LSource/src/cpmtools-2.13/config.h

@ -1,55 +0,0 @@
/* config.h. Generated from config.h.in by configure. */
#define HAVE_FCNTL_H 1
#define HAVE_LIMITS_H 1
#define HAVE_UNISTD_H 1
#define HAVE_WINDOWS_H 0
#define HAVE_WINIOCTL_H 0
#define HAVE_LIBDSK_H 0
#define HAVE_SYS_TYPES_H 1
#define HAVE_SYS_STAT_H 1
#define HAVE_MODE_T 0
#if HAVE_SYS_STAT_H
#include <sys/stat.h>
#endif
#if HAVE_SYS_TYPES_H
#include <sys/types.h>
#endif
#if HAVE_LIMITS_H
#include <limits.h>
#endif
#if HAVE_UNISTD_H
#include <unistd.h>
#endif
#if HAVE_WINDOWS_H
#include <windows.h>
#endif
#if HAVE_WINIOCTL_H
#include <winioctl.h>
#endif
#if HAVE_LIBDSK_H
#include <libdsk.h>
#endif
#if HAVE_FCNTL_H
#include <fcntl.h>
#endif
#ifndef _POSIX_PATH_MAX
#define _POSIX_PATH_MAX _MAX_PATH
#endif
#include <time.h>
/* Define either for large file support, if your OS needs them. */
/* #undef _FILE_OFFSET_BITS */
/* #undef _LARGE_FILES */
/* Define if using dmalloc */
/* #undef USE_DMALLOC */

54
branches/dwg/LSource/src/cpmtools-2.13/config.h.in

@ -1,54 +0,0 @@
#define HAVE_FCNTL_H 0
#define HAVE_LIMITS_H 0
#define HAVE_UNISTD_H 0
#define HAVE_WINDOWS_H 0
#define HAVE_WINIOCTL_H 0
#define HAVE_LIBDSK_H 0
#define HAVE_SYS_TYPES_H 0
#define HAVE_SYS_STAT_H 0
#define HAVE_MODE_T 0
#if HAVE_SYS_STAT_H
#include <sys/stat.h>
#endif
#if HAVE_SYS_TYPES_H
#include <sys/types.h>
#endif
#if HAVE_LIMITS_H
#include <limits.h>
#endif
#if HAVE_UNISTD_H
#include <unistd.h>
#endif
#if HAVE_WINDOWS_H
#include <windows.h>
#endif
#if HAVE_WINIOCTL_H
#include <winioctl.h>
#endif
#if HAVE_LIBDSK_H
#include <libdsk.h>
#endif
#if HAVE_FCNTL_H
#include <fcntl.h>
#endif
#ifndef _POSIX_PATH_MAX
#define _POSIX_PATH_MAX _MAX_PATH
#endif
#include <time.h>
/* Define either for large file support, if your OS needs them. */
#undef _FILE_OFFSET_BITS
#undef _LARGE_FILES
/* Define if using dmalloc */
#undef USE_DMALLOC

687
branches/dwg/LSource/src/cpmtools-2.13/config.log

@ -1,687 +0,0 @@
This file contains any messages produced by compilers while
running configure, to aid debugging if configure makes a mistake.
It was created by configure, which was
generated by GNU Autoconf 2.65. Invocation command line was
$ ./configure
## --------- ##
## Platform. ##
## --------- ##
hostname = goodall
uname -m = x86_64
uname -r = 2.6.32-279.11.1.el6.x86_64
uname -s = Linux
uname -v = #1 SMP Tue Oct 16 11:16:02 CDT 2012
/usr/bin/uname -p = unknown
/bin/uname -X = unknown
/bin/arch = x86_64
/usr/bin/arch -k = unknown
/usr/convex/getsysinfo = unknown
/usr/bin/hostinfo = unknown
/bin/machine = unknown
/usr/bin/oslevel = unknown
/bin/universe = unknown
PATH: /usr/lib64/qt-3.3/bin
PATH: /usr/local/bin
PATH: /bin
PATH: /usr/bin
PATH: /usr/local/sbin
PATH: /usr/sbin
PATH: /sbin
PATH: /home/doug/depot_tools
PATH: /home/doug/bin
## ----------- ##
## Core tests. ##
## ----------- ##
configure:2174: checking build system type
configure:2188: result: x86_64-unknown-linux-gnu
configure:2208: checking host system type
configure:2221: result: x86_64-unknown-linux-gnu
configure:2305: checking for gcc
configure:2321: found /usr/bin/gcc
configure:2332: result: gcc
configure:2561: checking for C compiler version
configure:2570: gcc --version >&5
gcc (GCC) 4.4.6 20120305 (Red Hat 4.4.6-4)
Copyright (C) 2010 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
configure:2581: $? = 0
configure:2570: gcc -v >&5
Using built-in specs.
Target: x86_64-redhat-linux
Configured with: ../configure --prefix=/usr --mandir=/usr/share/man --infodir=/usr/share/info --with-bugurl=http://bugzilla.redhat.com/bugzilla --enable-bootstrap --enable-shared --enable-threads=posix --enable-checking=release --with-system-zlib --enable-__cxa_atexit --disable-libunwind-exceptions --enable-gnu-unique-object --enable-languages=c,c++,objc,obj-c++,java,fortran,ada --enable-java-awt=gtk --disable-dssi --with-java-home=/usr/lib/jvm/java-1.5.0-gcj-1.5.0.0/jre --enable-libgcj-multifile --enable-java-maintainer-mode --with-ecj-jar=/usr/share/java/eclipse-ecj.jar --disable-libjava-multilib --with-ppl --with-cloog --with-tune=generic --with-arch_32=i686 --build=x86_64-redhat-linux
Thread model: posix
gcc version 4.4.6 20120305 (Red Hat 4.4.6-4) (GCC)
configure:2581: $? = 0
configure:2570: gcc -V >&5
gcc: '-V' option must have argument
configure:2581: $? = 1
configure:2570: gcc -qversion >&5
gcc: unrecognized option '-qversion'
gcc: no input files
configure:2581: $? = 1
configure:2601: checking whether the C compiler works
configure:2623: gcc conftest.c >&5
configure:2627: $? = 0
configure:2676: result: yes
configure:2679: checking for C compiler default output file name
configure:2681: result: a.out
configure:2687: checking for suffix of executables
configure:2694: gcc -o conftest conftest.c >&5
configure:2698: $? = 0
configure:2720: result:
configure:2742: checking whether we are cross compiling
configure:2750: gcc -o conftest conftest.c >&5
configure:2754: $? = 0
configure:2761: ./conftest
configure:2765: $? = 0
configure:2780: result: no
configure:2785: checking for suffix of object files
configure:2807: gcc -c conftest.c >&5
configure:2811: $? = 0
configure:2832: result: o
configure:2836: checking whether we are using the GNU C compiler
configure:2855: gcc -c conftest.c >&5
configure:2855: $? = 0
configure:2864: result: yes
configure:2873: checking whether gcc accepts -g
configure:2893: gcc -c -g conftest.c >&5
configure:2893: $? = 0
configure:2934: result: yes
configure:2951: checking for gcc option to accept ISO C89
configure:3015: gcc -c -g -O2 conftest.c >&5
configure:3015: $? = 0
configure:3028: result: none needed
configure:3062: checking for a BSD-compatible install
configure:3130: result: /usr/bin/install -c
configure:3146: checking how to run the C preprocessor
configure:3177: gcc -E conftest.c
configure:3177: $? = 0
configure:3191: gcc -E conftest.c
conftest.c:9:28: error: ac_nonexistent.h: No such file or directory
configure:3191: $? = 1
configure: failed program was:
| /* confdefs.h */
| #define PACKAGE_NAME ""
| #define PACKAGE_TARNAME ""
| #define PACKAGE_VERSION ""
| #define PACKAGE_STRING ""
| #define PACKAGE_BUGREPORT ""
| #define PACKAGE_URL ""
| /* end confdefs.h. */
| #include <ac_nonexistent.h>
configure:3216: result: gcc -E
configure:3236: gcc -E conftest.c
configure:3236: $? = 0
configure:3250: gcc -E conftest.c
conftest.c:9:28: error: ac_nonexistent.h: No such file or directory
configure:3250: $? = 1
configure: failed program was:
| /* confdefs.h */
| #define PACKAGE_NAME ""
| #define PACKAGE_TARNAME ""
| #define PACKAGE_VERSION ""
| #define PACKAGE_STRING ""
| #define PACKAGE_BUGREPORT ""
| #define PACKAGE_URL ""
| /* end confdefs.h. */
| #include <ac_nonexistent.h>
configure:3351: checking for printw in -lcurses
configure:3376: gcc -o conftest -g -O2 -pipe -Wall -Wno-unused -Wshadow -Wbad-function-cast -Wmissing-prototypes -Wstrict-prototypes -Wcast-align -Wcast-qual -Wpointer-arith -Wwrite-strings -Wmissing-declarations -Wnested-externs -Wundef -pedantic -fno-common -g conftest.c -lcurses >&5
conftest.c:16: warning: function declaration isn't a prototype
conftest.c:19: warning: function declaration isn't a prototype
configure:3376: $? = 0
configure:3385: result: yes
configure:3800: checking for ANSI C header files
configure:3820: gcc -c -g -O2 -pipe -Wall -Wno-unused -Wshadow -Wbad-function-cast -Wmissing-prototypes -Wstrict-prototypes -Wcast-align -Wcast-qual -Wpointer-arith -Wwrite-strings -Wmissing-declarations -Wnested-externs -Wundef -pedantic -fno-common conftest.c >&5
conftest.c:16: warning: function declaration isn't a prototype
configure:3820: $? = 0
configure:3904: result: no
configure:3915: checking fcntl.h usability
configure:3915: gcc -c -g -O2 -pipe -Wall -Wno-unused -Wshadow -Wbad-function-cast -Wmissing-prototypes -Wstrict-prototypes -Wcast-align -Wcast-qual -Wpointer-arith -Wwrite-strings -Wmissing-declarations -Wnested-externs -Wundef -pedantic -fno-common conftest.c >&5
configure:3915: $? = 0
configure:3915: result: yes
configure:3915: checking fcntl.h presence
configure:3915: gcc -E conftest.c
configure:3915: $? = 0
configure:3915: result: yes
configure:3915: checking for fcntl.h
configure:3915: result: yes
configure:3915: checking sys/types.h usability
configure:3915: gcc -c -g -O2 -pipe -Wall -Wno-unused -Wshadow -Wbad-function-cast -Wmissing-prototypes -Wstrict-prototypes -Wcast-align -Wcast-qual -Wpointer-arith -Wwrite-strings -Wmissing-declarations -Wnested-externs -Wundef -pedantic -fno-common conftest.c >&5
configure:3915: $? = 0
configure:3915: result: yes
configure:3915: checking sys/types.h presence
configure:3915: gcc -E conftest.c
configure:3915: $? = 0
configure:3915: result: yes
configure:3915: checking for sys/types.h
configure:3915: result: yes
configure:3915: checking sys/stat.h usability
configure:3915: gcc -c -g -O2 -pipe -Wall -Wno-unused -Wshadow -Wbad-function-cast -Wmissing-prototypes -Wstrict-prototypes -Wcast-align -Wcast-qual -Wpointer-arith -Wwrite-strings -Wmissing-declarations -Wnested-externs -Wundef -pedantic -fno-common conftest.c >&5
configure:3915: $? = 0
configure:3915: result: yes
configure:3915: checking sys/stat.h presence
configure:3915: gcc -E conftest.c
configure:3915: $? = 0
configure:3915: result: yes
configure:3915: checking for sys/stat.h
configure:3915: result: yes
configure:3915: checking limits.h usability
configure:3915: gcc -c -g -O2 -pipe -Wall -Wno-unused -Wshadow -Wbad-function-cast -Wmissing-prototypes -Wstrict-prototypes -Wcast-align -Wcast-qual -Wpointer-arith -Wwrite-strings -Wmissing-declarations -Wnested-externs -Wundef -pedantic -fno-common conftest.c >&5
configure:3915: $? = 0
configure:3915: result: yes
configure:3915: checking limits.h presence
configure:3915: gcc -E conftest.c
configure:3915: $? = 0
configure:3915: result: yes
configure:3915: checking for limits.h
configure:3915: result: yes
configure:3915: checking unistd.h usability
configure:3915: gcc -c -g -O2 -pipe -Wall -Wno-unused -Wshadow -Wbad-function-cast -Wmissing-prototypes -Wstrict-prototypes -Wcast-align -Wcast-qual -Wpointer-arith -Wwrite-strings -Wmissing-declarations -Wnested-externs -Wundef -pedantic -fno-common conftest.c >&5
configure:3915: $? = 0
configure:3915: result: yes
configure:3915: checking unistd.h presence
configure:3915: gcc -E conftest.c
configure:3915: $? = 0
configure:3915: result: yes
configure:3915: checking for unistd.h
configure:3915: result: yes
configure:3927: checking for an ANSI C-conforming const
configure:3992: gcc -c -g -O2 -pipe -Wall -Wno-unused -Wshadow -Wbad-function-cast -Wmissing-prototypes -Wstrict-prototypes -Wcast-align -Wcast-qual -Wpointer-arith -Wwrite-strings -Wmissing-declarations -Wnested-externs -Wundef -pedantic -fno-common conftest.c >&5
conftest.c:17: warning: function declaration isn't a prototype
conftest.c: In function 'main':
conftest.c:37: warning: cast discards qualifiers from pointer target type
conftest.c:43: warning: 't' is used uninitialized in this function
conftest.c:59: warning: 'b' is used uninitialized in this function
conftest.c:22: warning: 'cs[0]' is used uninitialized in this function
configure:3992: $? = 0
configure:3999: result: yes
configure:4007: checking for mode_t
configure:4007: gcc -c -g -O2 -pipe -Wall -Wno-unused -Wshadow -Wbad-function-cast -Wmissing-prototypes -Wstrict-prototypes -Wcast-align -Wcast-qual -Wpointer-arith -Wwrite-strings -Wmissing-declarations -Wnested-externs -Wundef -pedantic -fno-common conftest.c >&5
conftest.c:49: warning: function declaration isn't a prototype
configure:4007: $? = 0
configure:4007: gcc -c -g -O2 -pipe -Wall -Wno-unused -Wshadow -Wbad-function-cast -Wmissing-prototypes -Wstrict-prototypes -Wcast-align -Wcast-qual -Wpointer-arith -Wwrite-strings -Wmissing-declarations -Wnested-externs -Wundef -pedantic -fno-common conftest.c >&5
conftest.c:49: warning: function declaration isn't a prototype
conftest.c: In function 'main':
conftest.c:50: error: expected expression before ')' token
configure:4007: $? = 1
configure: failed program was:
| /* confdefs.h */
| #define PACKAGE_NAME ""
| #define PACKAGE_TARNAME ""
| #define PACKAGE_VERSION ""
| #define PACKAGE_STRING ""
| #define PACKAGE_BUGREPORT ""
| #define PACKAGE_URL ""
| #define HAVE_FCNTL_H 1
| #define HAVE_SYS_TYPES_H 1
| #define HAVE_SYS_STAT_H 1
| #define HAVE_LIMITS_H 1
| #define HAVE_UNISTD_H 1
| /* end confdefs.h. */
| #include <stdio.h>
| #ifdef HAVE_SYS_TYPES_H
| # include <sys/types.h>
| #endif
| #ifdef HAVE_SYS_STAT_H
| # include <sys/stat.h>
| #endif
| #ifdef STDC_HEADERS
| # include <stdlib.h>
| # include <stddef.h>
| #else
| # ifdef HAVE_STDLIB_H
| # include <stdlib.h>
| # endif
| #endif
| #ifdef HAVE_STRING_H
| # if !defined STDC_HEADERS && defined HAVE_MEMORY_H
| # include <memory.h>
| # endif
| # include <string.h>
| #endif
| #ifdef HAVE_STRINGS_H
| # include <strings.h>
| #endif
| #ifdef HAVE_INTTYPES_H
| # include <inttypes.h>
| #endif
| #ifdef HAVE_STDINT_H
| # include <stdint.h>
| #endif
| #ifdef HAVE_UNISTD_H
| # include <unistd.h>
| #endif
| int
| main ()
| {
| if (sizeof ((mode_t)))
| return 0;
| ;
| return 0;
| }
configure:4007: result: yes
configure:4018: checking for off_t
configure:4018: gcc -c -g -O2 -pipe -Wall -Wno-unused -Wshadow -Wbad-function-cast -Wmissing-prototypes -Wstrict-prototypes -Wcast-align -Wcast-qual -Wpointer-arith -Wwrite-strings -Wmissing-declarations -Wnested-externs -Wundef -pedantic -fno-common conftest.c >&5
conftest.c:49: warning: function declaration isn't a prototype
configure:4018: $? = 0
configure:4018: gcc -c -g -O2 -pipe -Wall -Wno-unused -Wshadow -Wbad-function-cast -Wmissing-prototypes -Wstrict-prototypes -Wcast-align -Wcast-qual -Wpointer-arith -Wwrite-strings -Wmissing-declarations -Wnested-externs -Wundef -pedantic -fno-common conftest.c >&5
conftest.c:49: warning: function declaration isn't a prototype
conftest.c: In function 'main':
conftest.c:50: error: expected expression before ')' token
configure:4018: $? = 1
configure: failed program was:
| /* confdefs.h */
| #define PACKAGE_NAME ""
| #define PACKAGE_TARNAME ""
| #define PACKAGE_VERSION ""
| #define PACKAGE_STRING ""
| #define PACKAGE_BUGREPORT ""
| #define PACKAGE_URL ""
| #define HAVE_FCNTL_H 1
| #define HAVE_SYS_TYPES_H 1
| #define HAVE_SYS_STAT_H 1
| #define HAVE_LIMITS_H 1
| #define HAVE_UNISTD_H 1
| /* end confdefs.h. */
| #include <stdio.h>
| #ifdef HAVE_SYS_TYPES_H
| # include <sys/types.h>
| #endif
| #ifdef HAVE_SYS_STAT_H
| # include <sys/stat.h>
| #endif
| #ifdef STDC_HEADERS
| # include <stdlib.h>
| # include <stddef.h>
| #else
| # ifdef HAVE_STDLIB_H
| # include <stdlib.h>
| # endif
| #endif
| #ifdef HAVE_STRING_H
| # if !defined STDC_HEADERS && defined HAVE_MEMORY_H
| # include <memory.h>
| # endif
| # include <string.h>
| #endif
| #ifdef HAVE_STRINGS_H
| # include <strings.h>
| #endif
| #ifdef HAVE_INTTYPES_H
| # include <inttypes.h>
| #endif
| #ifdef HAVE_STDINT_H
| # include <stdint.h>
| #endif
| #ifdef HAVE_UNISTD_H
| # include <unistd.h>
| #endif
| int
| main ()
| {
| if (sizeof ((off_t)))
| return 0;
| ;
| return 0;
| }
configure:4018: result: yes
configure:4029: checking for pid_t
configure:4029: gcc -c -g -O2 -pipe -Wall -Wno-unused -Wshadow -Wbad-function-cast -Wmissing-prototypes -Wstrict-prototypes -Wcast-align -Wcast-qual -Wpointer-arith -Wwrite-strings -Wmissing-declarations -Wnested-externs -Wundef -pedantic -fno-common conftest.c >&5
conftest.c:49: warning: function declaration isn't a prototype
configure:4029: $? = 0
configure:4029: gcc -c -g -O2 -pipe -Wall -Wno-unused -Wshadow -Wbad-function-cast -Wmissing-prototypes -Wstrict-prototypes -Wcast-align -Wcast-qual -Wpointer-arith -Wwrite-strings -Wmissing-declarations -Wnested-externs -Wundef -pedantic -fno-common conftest.c >&5
conftest.c:49: warning: function declaration isn't a prototype
conftest.c: In function 'main':
conftest.c:50: error: expected expression before ')' token
configure:4029: $? = 1
configure: failed program was:
| /* confdefs.h */
| #define PACKAGE_NAME ""
| #define PACKAGE_TARNAME ""
| #define PACKAGE_VERSION ""
| #define PACKAGE_STRING ""
| #define PACKAGE_BUGREPORT ""
| #define PACKAGE_URL ""
| #define HAVE_FCNTL_H 1
| #define HAVE_SYS_TYPES_H 1
| #define HAVE_SYS_STAT_H 1
| #define HAVE_LIMITS_H 1
| #define HAVE_UNISTD_H 1
| /* end confdefs.h. */
| #include <stdio.h>
| #ifdef HAVE_SYS_TYPES_H
| # include <sys/types.h>
| #endif
| #ifdef HAVE_SYS_STAT_H
| # include <sys/stat.h>
| #endif
| #ifdef STDC_HEADERS
| # include <stdlib.h>
| # include <stddef.h>
| #else
| # ifdef HAVE_STDLIB_H
| # include <stdlib.h>
| # endif
| #endif
| #ifdef HAVE_STRING_H
| # if !defined STDC_HEADERS && defined HAVE_MEMORY_H
| # include <memory.h>
| # endif
| # include <string.h>
| #endif
| #ifdef HAVE_STRINGS_H
| # include <strings.h>
| #endif
| #ifdef HAVE_INTTYPES_H
| # include <inttypes.h>
| #endif
| #ifdef HAVE_STDINT_H
| # include <stdint.h>
| #endif
| #ifdef HAVE_UNISTD_H
| # include <unistd.h>
| #endif
| int
| main ()
| {
| if (sizeof ((pid_t)))
| return 0;
| ;
| return 0;
| }
configure:4029: result: yes
configure:4040: checking for size_t
configure:4040: gcc -c -g -O2 -pipe -Wall -Wno-unused -Wshadow -Wbad-function-cast -Wmissing-prototypes -Wstrict-prototypes -Wcast-align -Wcast-qual -Wpointer-arith -Wwrite-strings -Wmissing-declarations -Wnested-externs -Wundef -pedantic -fno-common conftest.c >&5
conftest.c:49: warning: function declaration isn't a prototype
configure:4040: $? = 0
configure:4040: gcc -c -g -O2 -pipe -Wall -Wno-unused -Wshadow -Wbad-function-cast -Wmissing-prototypes -Wstrict-prototypes -Wcast-align -Wcast-qual -Wpointer-arith -Wwrite-strings -Wmissing-declarations -Wnested-externs -Wundef -pedantic -fno-common conftest.c >&5
conftest.c:49: warning: function declaration isn't a prototype
conftest.c: In function 'main':
conftest.c:50: error: expected expression before ')' token
configure:4040: $? = 1
configure: failed program was:
| /* confdefs.h */
| #define PACKAGE_NAME ""
| #define PACKAGE_TARNAME ""
| #define PACKAGE_VERSION ""
| #define PACKAGE_STRING ""
| #define PACKAGE_BUGREPORT ""
| #define PACKAGE_URL ""
| #define HAVE_FCNTL_H 1
| #define HAVE_SYS_TYPES_H 1
| #define HAVE_SYS_STAT_H 1
| #define HAVE_LIMITS_H 1
| #define HAVE_UNISTD_H 1
| /* end confdefs.h. */
| #include <stdio.h>
| #ifdef HAVE_SYS_TYPES_H
| # include <sys/types.h>
| #endif
| #ifdef HAVE_SYS_STAT_H
| # include <sys/stat.h>
| #endif
| #ifdef STDC_HEADERS
| # include <stdlib.h>
| # include <stddef.h>
| #else
| # ifdef HAVE_STDLIB_H
| # include <stdlib.h>
| # endif
| #endif
| #ifdef HAVE_STRING_H
| # if !defined STDC_HEADERS && defined HAVE_MEMORY_H
| # include <memory.h>
| # endif
| # include <string.h>
| #endif
| #ifdef HAVE_STRINGS_H
| # include <strings.h>
| #endif
| #ifdef HAVE_INTTYPES_H
| # include <inttypes.h>
| #endif
| #ifdef HAVE_STDINT_H
| # include <stdint.h>
| #endif
| #ifdef HAVE_UNISTD_H
| # include <unistd.h>
| #endif
| int
| main ()
| {
| if (sizeof ((size_t)))
| return 0;
| ;
| return 0;
| }
configure:4040: result: yes
configure:4051: checking whether struct tm is in sys/time.h or time.h
configure:4071: gcc -c -g -O2 -pipe -Wall -Wno-unused -Wshadow -Wbad-function-cast -Wmissing-prototypes -Wstrict-prototypes -Wcast-align -Wcast-qual -Wpointer-arith -Wwrite-strings -Wmissing-declarations -Wnested-externs -Wundef -pedantic -fno-common conftest.c >&5
conftest.c:19: warning: function declaration isn't a prototype
configure:4071: $? = 0
configure:4078: result: time.h
configure:4095: checking for special C compiler options needed for large files
configure:4140: result: no
configure:4146: checking for _FILE_OFFSET_BITS value needed for large files
configure:4171: gcc -c -g -O2 -pipe -Wall -Wno-unused -Wshadow -Wbad-function-cast -Wmissing-prototypes -Wstrict-prototypes -Wcast-align -Wcast-qual -Wpointer-arith -Wwrite-strings -Wmissing-declarations -Wnested-externs -Wundef -pedantic -fno-common conftest.c >&5
conftest.c:25: warning: function declaration isn't a prototype
configure:4171: $? = 0
configure:4203: result: no
configure:4291: checking for working memcmp
configure:4334: gcc -o conftest -g -O2 -pipe -Wall -Wno-unused -Wshadow -Wbad-function-cast -Wmissing-prototypes -Wstrict-prototypes -Wcast-align -Wcast-qual -Wpointer-arith -Wwrite-strings -Wmissing-declarations -Wnested-externs -Wundef -pedantic -fno-common -g conftest.c -lcurses >&5
conftest.c:49: warning: function declaration isn't a prototype
conftest.c: In function 'main':
conftest.c:53: warning: implicit declaration of function 'memcmp'
conftest.c:67: warning: implicit declaration of function 'strcpy'
conftest.c:67: warning: incompatible implicit declaration of built-in function 'strcpy'
configure:4334: $? = 0
configure:4334: ./conftest
configure:4334: $? = 0
configure:4344: result: yes
configure:4355: checking for strftime
configure:4355: gcc -o conftest -g -O2 -pipe -Wall -Wno-unused -Wshadow -Wbad-function-cast -Wmissing-prototypes -Wstrict-prototypes -Wcast-align -Wcast-qual -Wpointer-arith -Wwrite-strings -Wmissing-declarations -Wnested-externs -Wundef -pedantic -fno-common -g conftest.c -lcurses >&5
conftest.c:37: warning: function declaration isn't a prototype
conftest.c:37: warning: conflicting types for built-in function 'strftime'
conftest.c:47: warning: function declaration isn't a prototype
configure:4355: $? = 0
configure:4355: result: yes
configure:4411: checking for mktime
configure:4411: gcc -o conftest -g -O2 -pipe -Wall -Wno-unused -Wshadow -Wbad-function-cast -Wmissing-prototypes -Wstrict-prototypes -Wcast-align -Wcast-qual -Wpointer-arith -Wwrite-strings -Wmissing-declarations -Wnested-externs -Wundef -pedantic -fno-common -g conftest.c -lcurses >&5
conftest.c:38: warning: function declaration isn't a prototype
conftest.c:48: warning: function declaration isn't a prototype
configure:4411: $? = 0
configure:4411: result: yes
configure:4411: checking for strerror
configure:4411: gcc -o conftest -g -O2 -pipe -Wall -Wno-unused -Wshadow -Wbad-function-cast -Wmissing-prototypes -Wstrict-prototypes -Wcast-align -Wcast-qual -Wpointer-arith -Wwrite-strings -Wmissing-declarations -Wnested-externs -Wundef -pedantic -fno-common -g conftest.c -lcurses >&5
conftest.c:39: warning: function declaration isn't a prototype
conftest.c:49: warning: function declaration isn't a prototype
configure:4411: $? = 0
configure:4411: result: yes
configure:4535: creating ./config.status
## ---------------------- ##
## Running config.status. ##
## ---------------------- ##
This file was extended by config.status, which was
generated by GNU Autoconf 2.65. Invocation command line was
CONFIG_FILES =
CONFIG_HEADERS =
CONFIG_LINKS =
CONFIG_COMMANDS =
$ ./config.status
on goodall
config.status:828: creating Makefile
config.status:828: creating cpm.5
config.status:828: creating cpmchattr.1
config.status:828: creating cpmchmod.1
config.status:828: creating cpmcp.1
config.status:828: creating cpmls.1
config.status:828: creating cpmrm.1
config.status:828: creating fsck.cpm.1
config.status:828: creating fsed.cpm.1
config.status:828: creating mkfs.cpm.1
config.status:828: creating config.h
## ---------------- ##
## Cache variables. ##
## ---------------- ##
ac_cv_build=x86_64-unknown-linux-gnu
ac_cv_c_compiler_gnu=yes
ac_cv_c_const=yes
ac_cv_env_CC_set=
ac_cv_env_CC_value=
ac_cv_env_CFLAGS_set=
ac_cv_env_CFLAGS_value=
ac_cv_env_CPPFLAGS_set=
ac_cv_env_CPPFLAGS_value=
ac_cv_env_CPP_set=
ac_cv_env_CPP_value=
ac_cv_env_LDFLAGS_set=
ac_cv_env_LDFLAGS_value=
ac_cv_env_LIBS_set=
ac_cv_env_LIBS_value=
ac_cv_env_build_alias_set=
ac_cv_env_build_alias_value=
ac_cv_env_host_alias_set=
ac_cv_env_host_alias_value=
ac_cv_env_target_alias_set=
ac_cv_env_target_alias_value=
ac_cv_func_memcmp_working=yes
ac_cv_func_mktime=yes
ac_cv_func_strerror=yes
ac_cv_func_strftime=yes
ac_cv_header_fcntl_h=yes
ac_cv_header_limits_h=yes
ac_cv_header_stdc=no
ac_cv_header_sys_stat_h=yes
ac_cv_header_sys_types_h=yes
ac_cv_header_unistd_h=yes
ac_cv_host=x86_64-unknown-linux-gnu
ac_cv_lib_curses_printw=yes
ac_cv_objext=o
ac_cv_path_install='/usr/bin/install -c'
ac_cv_prog_CPP='gcc -E'
ac_cv_prog_ac_ct_CC=gcc
ac_cv_prog_cc_c89=
ac_cv_prog_cc_g=yes
ac_cv_struct_tm=time.h
ac_cv_sys_file_offset_bits=no
ac_cv_sys_largefile_CC=no
ac_cv_type_mode_t=yes
ac_cv_type_off_t=yes
ac_cv_type_pid_t=yes
ac_cv_type_size_t=yes
## ----------------- ##
## Output variables. ##
## ----------------- ##
CC='gcc'
CFLAGS='-g -O2 -pipe -Wall -Wno-unused -Wshadow -Wbad-function-cast -Wmissing-prototypes -Wstrict-prototypes -Wcast-align -Wcast-qual -Wpointer-arith -Wwrite-strings -Wmissing-declarations -Wnested-externs -Wundef -pedantic -fno-common'
CPP='gcc -E'
CPPFLAGS=''
DATADIR='${prefix}/share'
DEFFORMAT='ibm-3740'
DEFS='-DHAVE_CONFIG_H'
DEVICE='posix'
DISKDEFS='${datarootdir}/diskdefs'
ECHO_C=''
ECHO_N='-n'
ECHO_T=''
EGREP=''
EXEEXT=''
FSED_CPM='fsed.cpm'
GREP=''
INSTALL_DATA='${INSTALL} -m 644'
INSTALL_PROGRAM='${INSTALL}'
INSTALL_SCRIPT='${INSTALL}'
LDDEPS=''
LDFLAGS=' -g'
LDLIBS=''
LIBOBJS=''
LIBS='-lcurses '
LTLIBOBJS=''
OBJEXT='o'
PACKAGE_BUGREPORT=''
PACKAGE_NAME=''
PACKAGE_STRING=''
PACKAGE_TARNAME=''
PACKAGE_URL=''
PACKAGE_VERSION=''
PATH_SEPARATOR=':'
SHELL='/bin/sh'
UPDATED='March 30, 2010'
ac_ct_CC='gcc'
bindir='${exec_prefix}/bin'
build='x86_64-unknown-linux-gnu'
build_alias=''
build_cpu='x86_64'
build_os='linux-gnu'
build_vendor='unknown'
datadir='${datarootdir}'
datarootdir='${prefix}/share'
docdir='${datarootdir}/doc/${PACKAGE}'
dvidir='${docdir}'
exec_prefix='${prefix}'
host='x86_64-unknown-linux-gnu'
host_alias=''
host_cpu='x86_64'
host_os='linux-gnu'
host_vendor='unknown'
htmldir='${docdir}'
includedir='${prefix}/include'
infodir='${datarootdir}/info'
libdir='${exec_prefix}/lib'
libexecdir='${exec_prefix}/libexec'
localedir='${datarootdir}/locale'
localstatedir='${prefix}/var'
mandir='${datarootdir}/man'
oldincludedir='/usr/include'
pdfdir='${docdir}'
prefix='/usr/local'
program_transform_name='s,x,x,'
psdir='${docdir}'
sbindir='${exec_prefix}/sbin'
sharedstatedir='${prefix}/com'
sysconfdir='${prefix}/etc'
target_alias=''
## ----------- ##
## confdefs.h. ##
## ----------- ##
/* confdefs.h */
#define PACKAGE_NAME ""
#define PACKAGE_TARNAME ""
#define PACKAGE_VERSION ""
#define PACKAGE_STRING ""
#define PACKAGE_BUGREPORT ""
#define PACKAGE_URL ""
#define HAVE_FCNTL_H 1
#define HAVE_SYS_TYPES_H 1
#define HAVE_SYS_STAT_H 1
#define HAVE_LIMITS_H 1
#define HAVE_UNISTD_H 1
#define HAVE_STRFTIME 1
#define HAVE_MKTIME 1
#define HAVE_STRERROR 1
configure: exit 0

1014
branches/dwg/LSource/src/cpmtools-2.13/config.status

File diff suppressed because it is too large

1702
branches/dwg/LSource/src/cpmtools-2.13/config.sub

File diff suppressed because it is too large

5701
branches/dwg/LSource/src/cpmtools-2.13/configure

File diff suppressed because it is too large

124
branches/dwg/LSource/src/cpmtools-2.13/configure.in

@ -1,124 +0,0 @@
AC_INIT(cpmfs.c)
AC_CONFIG_HEADER(config.h)
AC_CANONICAL_HOST
VERSION=2.13
UPDATED='March 30, 2010'
DEVICE="posix"
if test "$prefix" = NONE
then
case $host in
*-linux-*)
;;
*-pc-mingw32)
CFLAGS_LIBDSK=-DNOTWINDLL
;;
esac
fi
AC_PROG_CC
AC_PROG_INSTALL
AC_PROG_CPP
if test "$GCC" = yes
then
CFLAGS="${CFLAGS} ${EXTRA_GCFLAGS}-pipe -Wall -Wno-unused -Wshadow -Wbad-function-cast -Wmissing-prototypes -Wstrict-prototypes -Wcast-align -Wcast-qual -Wpointer-arith -Wwrite-strings -Wmissing-declarations -Wnested-externs -Wundef -pedantic -fno-common"
LDFLAGS="${LDFLAGS} ${EXTRA_GLDFLAGS}-g"
else
CFLAGS="${CFLAGS} ${EXTRA_CFLAGS}"
LDFLAGS="${LDFLAGS} ${EXTRA_LDFLAGS}"
fi
AC_CYGWIN
AC_MINGW32
dnl Choose between posix and win32 drivers...
DEVICE="posix"
DISKDEFS='${datarootdir}/diskdefs'
if test "$CYGWIN" = "yes"
then
DEVICE="win32"
# DISKDEFS='%USERPROFILE%/diskdefs'
fi
if test "$MINGW32" = "yes"
then
DEVICE="win32"
# DISKDEFS='%USERPROFILE%\\diskdefs'
fi
AC_ARG_WITH(diskdefs,[ --with-diskdefs Specify diskdefs location],
[DISKDEFS="$withval"], [DISKDEFS="$DISKDEFS"])
AC_ARG_WITH(defformat,[ --with-defformat Specify default format (ibm-3740)],
[DEFFORMAT="$withval"], [DEFFORMAT="ibm-3740"])
AC_ARG_WITH(libdsk, [ --with-libdsk Specify path to libdsk library],
[LIBDSK="$withval"], [LIBDSK=""])
AC_ARG_WITH(dmalloc, [ --with-dmalloc Specify path to dmalloc library],
[CPPFLAGS="$CPPFLAGS -I$with_dmalloc/include"
LDFLAGS="$LDFLAGS -L$with_dmalloc/lib"
LIBS="$LIBS -ldmalloc"
AC_DEFINE(USE_DMALLOC)])
dnl Check for curses. If not found, don't build fsed.cpm
dnl Try both curses and ncurses
AC_CHECK_LIB(curses, printw, FSED_CPM=fsed.cpm LIBS="-lcurses $LIBS", FSED_CPM=)
if test x"$FSED_CPM" = x""; then
AC_CHECK_LIB(ncurses, printw, FSED_CPM=fsed.cpm LIBS="-lncurses $LIBS", FSED_CPM=)
fi
dnl If using libdsk, check it's available.
if test "$LIBDSK" != ""; then
DEVICE="libdsk"
CPPFLAGS="$CPPFLAGS -I$LIBDSK/include"
CFLAGS="$CFLAGS -I$LIBDSK/include $CFLAGS_LIBDSK"
LDFLAGS="$LDFLAGS -L$LIBDSK/lib"
AC_CHECK_LIB(dsk, dsk_open)
AC_CHECK_HEADERS(libdsk.h, ,[echo "No libdsk.h - aborting"; exit 1])
fi
dnl If using win32, check it's available.
if test x"$DEVICE" = x"win32"; then
AC_CHECK_HEADERS(windows.h, ,[echo "Device win32, but <windows.h> not found - aborting"; exit 1] )
AC_CHECK_HEADERS(winioctl.h, ,[echo "Device win32, but <winioctl.h> not found - aborting"; exit 1],
[#ifdef HAVE_WINDOWS_H
#include <windows.h>
#endif
])
fi
dnl Checks for header files.
AC_HEADER_STDC
AC_CHECK_HEADERS(fcntl.h sys/types.h sys/stat.h limits.h unistd.h)
dnl Checks for typedefs, structures, and compiler characteristics.
AC_C_CONST
AC_TYPE_MODE_T
AC_TYPE_OFF_T
AC_TYPE_PID_T
AC_TYPE_SIZE_T
AC_STRUCT_TM
AC_EXEEXT
AC_OBJEXT
AC_SYS_LARGEFILE
dnl add EXE extension to fsed.cpm
if test x"$FSED_CPM" != x""; then
FSED_CPM="$FSED_CPM$EXEEXT"
fi
dnl Checks for library functions.
AC_FUNC_MEMCMP
AC_FUNC_STRFTIME
AC_CHECK_FUNCS(mktime strerror)
AC_SUBST(LDLIBS)
AC_SUBST(LDDEPS)
AC_SUBST(DEVICE)
eval DATADIR=$datadir
AC_SUBST(DATADIR)
AC_SUBST(DISKDEFS)
AC_SUBST(DEFFORMAT)
AC_SUBST(FSED_CPM)
AC_SUBST(UPDATED)
AC_OUTPUT(Makefile cpm.5 cpmchattr.1 cpmchmod.1 cpmcp.1 cpmls.1 cpmrm.1 fsck.cpm.1 fsed.cpm.1 mkfs.cpm.1 )

240
branches/dwg/LSource/src/cpmtools-2.13/cpm.5

@ -1,240 +0,0 @@
.\" Believe it or not, reportedly there are nroffs which do not know \(en
.if n .ds en -
.if t .ds en \(en
.TH CPM 5 "March 30, 2010" "CP/M tools" "File formats"
.SH NAME \"{{{roff}}}\"{{{
cpm \- CP/M disk and file system format
.\"}}}
.SH DESCRIPTION \"{{{
.SS "Characteristic sizes" \"{{{
Each CP/M disk format is described by the following specific sizes:
.RS
.sp
Sector size in bytes
.br
Number of tracks
.br
Number of sectors
.br
Block size
.br
Number of directory entries
.br
Logical sector skew
.br
Number of reserved system tracks
.sp
.RE
A block is the smallest allocatable storage unit. CP/M supports block
sizes of 1024, 2048, 4096, 8192 and 16384 bytes. Unfortunately, this
format specification is not stored on the disk and there are lots of
formats. Accessing a block is performed by accessing its sectors, which
are stored with the given software skew.
.\"}}}
.SS "Device areas" \"{{{
A CP/M disk contains three areas:
.RS
.sp
System tracks (optional)
.br
Directory
.br
Data
.sp
.RE
The system tracks store the boot loader and CP/M itself. In order to save
disk space, there are non-bootable formats which omit those system tracks.
The term \fIdisk capacity\fP always excludes the space for system tracks.
Note that there is no bitmap or list for free blocks. When accessing a
drive for the first time, CP/M builds this bitmap in core from the directory.
.\"}}}
.SS "Directory entries" \"{{{
The directory is a sequence of directory entries (also called extents),
which contain 32 bytes of the following structure:
.RS
.sp
.ta 3n 6n 9n 12n 15n 18n 21n 24n 27n 30n 33n 36n 39n 42n 45n
St F0 F1 F2 F3 F4 F5 F6 F7 E0 E1 E2 Xl Bc Xh Rc
.br
Al Al Al Al Al Al Al Al Al Al Al Al Al Al Al Al
.sp
.RE
.\"{{{ St = status
\fBSt\fP is the status; possible values are:
.RS
.sp
0\*(en15: used for file, status is the user number
.br
16\*(en31: used for file, status is the user number (P2DOS)
or used for password extent (CP/M 3 or higher)
.br
32: disc label
.br
33: time stamp (P2DOS)
.br
0xE5: unused
.sp
.RE
.\"}}}
.LP
.\"{{{ F0-E2 = file name and extension
\fBF0\*(enE2\fP are the file name and its extension. They may consist of
any printable 7 bit ASCII character but: \fB< > . , ; : = ? * [ ]\fP.
The file name must not be empty, the extension may be empty. Both are
padded with blanks. The highest bit of each character of the file name
and extension is used as attribute. The attributes have the following
meaning:
.RS
.sp
F0: requires set wheel byte (Backgrounder II)
.br
F1: public file (P2DOS, ZSDOS), forground-only command (Backgrounder II)
.br
F2: date stamp (ZSDOS), background-only commands (Backgrounder II)
.br
F7: wheel protect (ZSDOS)
.br
E0: read-only
.br
E1: system file
.br
E2: archived
.sp
.RE
Public files (visible under each user number) are not supported by CP/M
2.2, but there is a patch and some free CP/M clones support them without
any patches.
.LP
The wheel byte is (by default) the memory location at 0x4b. If it is
zero, only non-privileged commands may be executed.
.\"}}}
.LP
.\"{{{ Xl, Xh = extent number
\fBXl\fP and \fBXh\fP store the extent number. A file may use more than
one directory entry, if it contains more blocks than an extent can hold.
In this case, more extents are allocated and each of them is numbered
sequentially with an extent number. If a physical extent stores more than
16k, it is considered to contain multiple logical extents, each pointing
to 16k data, and the extent number of the last used logical extent
is stored. Note: Some formats decided to always store only one logical
extent in a physical extent, thus wasting extent space. CP/M 2.2 allows
512 extents per file, CP/M 3 and higher allow up to 2048. Bit 5\*(en7 of
Xl are 0, bit 0\*(en4 store the lower bits of the extent number. Bit 6
and 7 of Xh are 0, bit 0\*(en5 store the higher bits of the extent number.
.\"}}}
.LP
.\"{{{ Rc, Bc = record count, byte count
\fBRc\fP and \fBBc\fP determine the length of the data used by this extent. The
physical extent is divided into logical extents, each of them being 16k
in size (a physical extent must hold at least one logical extent, e.g. a
blocksize of 1024 byte with two-byte block pointers is not allowed).
Rc stores the number of 128 byte records of the last used logical extent.
Bc stores the number of bytes in the last used record. The value 0 means
128 for backward compatibility with CP/M 2.2, which did not support Bc.
.\"}}}
.LP
.\"{{{ Al = allocated blocks
\fBAl\fP stores block pointers. If the disk capacity is less than 256 blocks,
Al is interpreted as 16 byte-values, otherwise as 8 double-byte-values.
A block pointer of 0 marks a hole in the file. If a hole
covers the range of a full extent, the extent will not be allocated. In particular,
the first extent of a file does not neccessarily have extent number 0.
A file may not share blocks with other files, as its blocks would be freed
if the other files is erased without a following disk system reset. CP/M returns
EOF when it reaches a hole, whereas UNIX returns zero-value bytes, which makes
holes invisible.
.\"}}}
.\"}}}
.SS "Time stamps" \"{{{
P2DOS and CP/M Plus support time stamps, which are stored in each fourth
directory entry. This entry contains the time stamps for
the extents using the previous three directory entries. Note that you
really have time stamps for each extent, no matter if it is the first
extent of a file or not. The structure of time stamp entries is:
.RS
.sp
1 byte status 0x21
.br
8 bytes time stamp for third-last directory entry
.br
2 bytes unused
.br
8 bytes time stamp for second-last directory entry
.br
2 bytes unused
.br
8 bytes time stamp for last directory entry
.sp
.RE
A time stamp consists of two dates: Creation and modification date (the
latter being recorded when the file is closed). CP/M Plus further
allows optionally to record the access instead of creation date as first
time stamp.
.RS
.sp
2 bytes (little-endian) days starting with 1 at 01-01-1978
.br
1 byte hour in BCD format
.br
1 byte minute in BCD format
.sp
.RE
.\"}}}
.SS "Disc labels" \"{{{
CP/M Plus support disc labels, which are stored in an arbitrary directory
entry.
The structure of disc labels is:
.RS
.sp
1 byte status 0x20
.br
\fBF0\*(enE2\fP are the disc label
.br
1 byte mode: bit 7 activates password protection, bit 6 causes time stamps on
access, but 5 causes time stamps on modifications, bit 4 causes time stamps on
creation and bit 0 is set when a label exists. Bit 4 and 6 are exclusively set.
.br
1 byte password decode byte: To decode the password, xor this byte with the password
bytes in reverse order. To encode a password, add its characters to get the
decode byte.
.br
2 reserved bytes
.br
8 password bytes
.br
4 bytes label creation time stamp
.br
4 bytes label modification time stamp
.sp
.RE
.\"}}}
.SS "Passwords" \"{{{
CP/M Plus supports passwords, which are stored in an arbitrary directory
entry.
The structure of these entries is:
.RS
.sp
1 byte status (user number plus 16)
.br
\fBF0\*(enE2\fP are the file name and its extension.
.br
1 byte password mode: bit 7 means password required for reading, bit 6 for writing
and bit 5 for deleting.
.br
1 byte password decode byte: To decode the password, xor this byte with the password
bytes in reverse order. To encode a password, add its characters to get the
decode byte.
.br
2 reserved bytes
.br
8 password bytes
.sp
.RE
.\"}}}
.\"}}}
.SH "SEE ALSO" \"{{{
.IR mkfs.cpm (1),
.IR fsck.cpm (1),
.IR fsed.cpm (1),
.IR cpmls (1)
.\"}}}

240
branches/dwg/LSource/src/cpmtools-2.13/cpm.5.in

@ -1,240 +0,0 @@
.\" Believe it or not, reportedly there are nroffs which do not know \(en
.if n .ds en -
.if t .ds en \(en
.TH CPM 5 "@UPDATED@" "CP/M tools" "File formats"
.SH NAME \"{{{roff}}}\"{{{
cpm \- CP/M disk and file system format
.\"}}}
.SH DESCRIPTION \"{{{
.SS "Characteristic sizes" \"{{{
Each CP/M disk format is described by the following specific sizes:
.RS
.sp
Sector size in bytes
.br
Number of tracks
.br
Number of sectors
.br
Block size
.br
Number of directory entries
.br
Logical sector skew
.br
Number of reserved system tracks
.sp
.RE
A block is the smallest allocatable storage unit. CP/M supports block
sizes of 1024, 2048, 4096, 8192 and 16384 bytes. Unfortunately, this
format specification is not stored on the disk and there are lots of
formats. Accessing a block is performed by accessing its sectors, which
are stored with the given software skew.
.\"}}}
.SS "Device areas" \"{{{
A CP/M disk contains three areas:
.RS
.sp
System tracks (optional)
.br
Directory
.br
Data
.sp
.RE
The system tracks store the boot loader and CP/M itself. In order to save
disk space, there are non-bootable formats which omit those system tracks.
The term \fIdisk capacity\fP always excludes the space for system tracks.
Note that there is no bitmap or list for free blocks. When accessing a
drive for the first time, CP/M builds this bitmap in core from the directory.
.\"}}}
.SS "Directory entries" \"{{{
The directory is a sequence of directory entries (also called extents),
which contain 32 bytes of the following structure:
.RS
.sp
.ta 3n 6n 9n 12n 15n 18n 21n 24n 27n 30n 33n 36n 39n 42n 45n
St F0 F1 F2 F3 F4 F5 F6 F7 E0 E1 E2 Xl Bc Xh Rc
.br
Al Al Al Al Al Al Al Al Al Al Al Al Al Al Al Al
.sp
.RE
.\"{{{ St = status
\fBSt\fP is the status; possible values are:
.RS
.sp
0\*(en15: used for file, status is the user number
.br
16\*(en31: used for file, status is the user number (P2DOS)
or used for password extent (CP/M 3 or higher)
.br
32: disc label
.br
33: time stamp (P2DOS)
.br
0xE5: unused
.sp
.RE
.\"}}}
.LP
.\"{{{ F0-E2 = file name and extension
\fBF0\*(enE2\fP are the file name and its extension. They may consist of
any printable 7 bit ASCII character but: \fB< > . , ; : = ? * [ ]\fP.
The file name must not be empty, the extension may be empty. Both are
padded with blanks. The highest bit of each character of the file name
and extension is used as attribute. The attributes have the following
meaning:
.RS
.sp
F0: requires set wheel byte (Backgrounder II)
.br
F1: public file (P2DOS, ZSDOS), forground-only command (Backgrounder II)
.br
F2: date stamp (ZSDOS), background-only commands (Backgrounder II)
.br
F7: wheel protect (ZSDOS)
.br
E0: read-only
.br
E1: system file
.br
E2: archived
.sp
.RE
Public files (visible under each user number) are not supported by CP/M
2.2, but there is a patch and some free CP/M clones support them without
any patches.
.LP
The wheel byte is (by default) the memory location at 0x4b. If it is
zero, only non-privileged commands may be executed.
.\"}}}
.LP
.\"{{{ Xl, Xh = extent number
\fBXl\fP and \fBXh\fP store the extent number. A file may use more than
one directory entry, if it contains more blocks than an extent can hold.
In this case, more extents are allocated and each of them is numbered
sequentially with an extent number. If a physical extent stores more than
16k, it is considered to contain multiple logical extents, each pointing
to 16k data, and the extent number of the last used logical extent
is stored. Note: Some formats decided to always store only one logical
extent in a physical extent, thus wasting extent space. CP/M 2.2 allows
512 extents per file, CP/M 3 and higher allow up to 2048. Bit 5\*(en7 of
Xl are 0, bit 0\*(en4 store the lower bits of the extent number. Bit 6
and 7 of Xh are 0, bit 0\*(en5 store the higher bits of the extent number.
.\"}}}
.LP
.\"{{{ Rc, Bc = record count, byte count
\fBRc\fP and \fBBc\fP determine the length of the data used by this extent. The
physical extent is divided into logical extents, each of them being 16k
in size (a physical extent must hold at least one logical extent, e.g. a
blocksize of 1024 byte with two-byte block pointers is not allowed).
Rc stores the number of 128 byte records of the last used logical extent.
Bc stores the number of bytes in the last used record. The value 0 means
128 for backward compatibility with CP/M 2.2, which did not support Bc.
.\"}}}
.LP
.\"{{{ Al = allocated blocks
\fBAl\fP stores block pointers. If the disk capacity is less than 256 blocks,
Al is interpreted as 16 byte-values, otherwise as 8 double-byte-values.
A block pointer of 0 marks a hole in the file. If a hole
covers the range of a full extent, the extent will not be allocated. In particular,
the first extent of a file does not neccessarily have extent number 0.
A file may not share blocks with other files, as its blocks would be freed
if the other files is erased without a following disk system reset. CP/M returns
EOF when it reaches a hole, whereas UNIX returns zero-value bytes, which makes
holes invisible.
.\"}}}
.\"}}}
.SS "Time stamps" \"{{{
P2DOS and CP/M Plus support time stamps, which are stored in each fourth
directory entry. This entry contains the time stamps for
the extents using the previous three directory entries. Note that you
really have time stamps for each extent, no matter if it is the first
extent of a file or not. The structure of time stamp entries is:
.RS
.sp
1 byte status 0x21
.br
8 bytes time stamp for third-last directory entry
.br
2 bytes unused
.br
8 bytes time stamp for second-last directory entry
.br
2 bytes unused
.br
8 bytes time stamp for last directory entry
.sp
.RE
A time stamp consists of two dates: Creation and modification date (the
latter being recorded when the file is closed). CP/M Plus further
allows optionally to record the access instead of creation date as first
time stamp.
.RS
.sp
2 bytes (little-endian) days starting with 1 at 01-01-1978
.br
1 byte hour in BCD format
.br
1 byte minute in BCD format
.sp
.RE
.\"}}}
.SS "Disc labels" \"{{{
CP/M Plus support disc labels, which are stored in an arbitrary directory
entry.
The structure of disc labels is:
.RS
.sp
1 byte status 0x20
.br
\fBF0\*(enE2\fP are the disc label
.br
1 byte mode: bit 7 activates password protection, bit 6 causes time stamps on
access, but 5 causes time stamps on modifications, bit 4 causes time stamps on
creation and bit 0 is set when a label exists. Bit 4 and 6 are exclusively set.
.br
1 byte password decode byte: To decode the password, xor this byte with the password
bytes in reverse order. To encode a password, add its characters to get the
decode byte.
.br
2 reserved bytes
.br
8 password bytes
.br
4 bytes label creation time stamp
.br
4 bytes label modification time stamp
.sp
.RE
.\"}}}
.SS "Passwords" \"{{{
CP/M Plus supports passwords, which are stored in an arbitrary directory
entry.
The structure of these entries is:
.RS
.sp
1 byte status (user number plus 16)
.br
\fBF0\*(enE2\fP are the file name and its extension.
.br
1 byte password mode: bit 7 means password required for reading, bit 6 for writing
and bit 5 for deleting.
.br
1 byte password decode byte: To decode the password, xor this byte with the password
bytes in reverse order. To encode a password, add its characters to get the
decode byte.
.br
2 reserved bytes
.br
8 password bytes
.sp
.RE
.\"}}}
.\"}}}
.SH "SEE ALSO" \"{{{
.IR mkfs.cpm (1),
.IR fsck.cpm (1),
.IR fsed.cpm (1),
.IR cpmls (1)
.\"}}}

BIN
branches/dwg/LSource/src/cpmtools-2.13/cpmchattr

Binary file not shown.

86
branches/dwg/LSource/src/cpmtools-2.13/cpmchattr.1

@ -1,86 +0,0 @@
.TH CPMCHATTR 1 "March 30, 2010" "CP/M tools" "User commands"
.SH NAME \"{{{roff}}}\"{{{
cpmchattr \- change file attributes on CP/M files
.\"}}}
.SH SYNOPSIS \"{{{
.ad l
.B cpmchattr
.RB [ \-f
.IR format ]
.I image
.I attrib
.I file-pattern
\&...
.ad b
.\"}}}
.SH DESCRIPTION \"{{{
\fBCpmchattr\fP changes the file attributes for files on CP/M disks.
.\"}}}
.SH OPTIONS \"{{{
.IP "\fB\-f\fP \fIformat\fP"
Use the given CP/M disk \fIformat\fP instead of the default format.
.IP "\fIattrib\fP"
Set the file attributes as given.
.\"}}}
.SH "FILE ATTRIBUTES" \"{{{
The file attribute string can contain the characters
1,2,3,4,r,s,a,n and m.
The meanings of these are:
.TP
.B 1-4
The CP/M "user attributes" F1-F4. CP/M does not assign any
meaning to these attributes, though MP/M does.
.TP
.B r
The file is read-only. This is the same as using
.I cpmchmod(1)
to revoke write permissions.
.TP
.B s
The file is a system file. This attribute can also be set by
.I cpmchmod(1).
.TP
.B a
The file has been backed up.
.TP
.B n
Reset all attributes to zero. So the string "n1r" resets all attributes and
then sets F1 and Read-Only.
.TP
.B m
Attributes after an m are unset rather than set. The string "12m34" sets
atttributes F1 and F2, and unsets F3 and F4.
.\"}}}
.SH "RETURN VALUE" \"{{{
Upon successful completion, exit code 0 is returned.
.\"}}}
.SH ERRORS \"{{{
Any errors are indicated by exit code 1.
.\"}}}
.SH FILES \"{{{
${prefix}/share/diskdefs CP/M disk format definitions
.\"}}}
.SH AUTHORS \"{{{
This program is copyright 1997\(en2010 Michael Haardt
<michael@moria.de> and copyright 2000, 2001 John Elliott
<jce@seasip.demon.co.uk>.
.PP
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.
.PP
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.
.PP
You should have received a copy of the GNU General Public License along
with this program. If not, write to the Free Software Foundation, Inc.,
59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
.\"}}}
.SH "SEE ALSO" \"{{{
.IR cpmls (1),
.IR cpmchmod (1),
.IR cpm (5)
.\"}}}

86
branches/dwg/LSource/src/cpmtools-2.13/cpmchattr.1.in

@ -1,86 +0,0 @@
.TH CPMCHATTR 1 "@UPDATED@" "CP/M tools" "User commands"
.SH NAME \"{{{roff}}}\"{{{
cpmchattr \- change file attributes on CP/M files
.\"}}}
.SH SYNOPSIS \"{{{
.ad l
.B cpmchattr
.RB [ \-f
.IR format ]
.I image
.I attrib
.I file-pattern
\&...
.ad b
.\"}}}
.SH DESCRIPTION \"{{{
\fBCpmchattr\fP changes the file attributes for files on CP/M disks.
.\"}}}
.SH OPTIONS \"{{{
.IP "\fB\-f\fP \fIformat\fP"
Use the given CP/M disk \fIformat\fP instead of the default format.
.IP "\fIattrib\fP"
Set the file attributes as given.
.\"}}}
.SH "FILE ATTRIBUTES" \"{{{
The file attribute string can contain the characters
1,2,3,4,r,s,a,n and m.
The meanings of these are:
.TP
.B 1-4
The CP/M "user attributes" F1-F4. CP/M does not assign any
meaning to these attributes, though MP/M does.
.TP
.B r
The file is read-only. This is the same as using
.I cpmchmod(1)
to revoke write permissions.
.TP
.B s
The file is a system file. This attribute can also be set by
.I cpmchmod(1).
.TP
.B a
The file has been backed up.
.TP
.B n
Reset all attributes to zero. So the string "n1r" resets all attributes and
then sets F1 and Read-Only.
.TP
.B m
Attributes after an m are unset rather than set. The string "12m34" sets
atttributes F1 and F2, and unsets F3 and F4.
.\"}}}
.SH "RETURN VALUE" \"{{{
Upon successful completion, exit code 0 is returned.
.\"}}}
.SH ERRORS \"{{{
Any errors are indicated by exit code 1.
.\"}}}
.SH FILES \"{{{
@DATADIR@/diskdefs CP/M disk format definitions
.\"}}}
.SH AUTHORS \"{{{
This program is copyright 1997\(en2010 Michael Haardt
<michael@moria.de> and copyright 2000, 2001 John Elliott
<jce@seasip.demon.co.uk>.
.PP
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.
.PP
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.
.PP
You should have received a copy of the GNU General Public License along
with this program. If not, write to the Free Software Foundation, Inc.,
59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
.\"}}}
.SH "SEE ALSO" \"{{{
.IR cpmls (1),
.IR cpmchmod (1),
.IR cpm (5)
.\"}}}

112
branches/dwg/LSource/src/cpmtools-2.13/cpmchattr.c

@ -1,112 +0,0 @@
/* #includes */ /*{{{C}}}*//*{{{*/
#include "config.h"
#include <ctype.h>
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include "getopt_.h"
#include "cpmfs.h"
#ifdef USE_DMALLOC
#include <dmalloc.h>
#endif
/*}}}*/
const char cmd[]="cpmchattr";
int main(int argc, char *argv[]) /*{{{*/
{
/* variables */ /*{{{*/
const char *err;
const char *image;
const char *format=FORMAT;
const char *devopts=NULL;
int c,i,usage=0,exitcode=0;
struct cpmSuperBlock drive;
struct cpmInode root;
int gargc;
char **gargv;
const char *attrs;
/*}}}*/
/* parse options */ /*{{{*/
while ((c=getopt(argc,argv,"T:f:h?"))!=EOF) switch(c)
{
case 'T': devopts=optarg; break;
case 'f': format=optarg; break;
case 'h':
case '?': usage=1; break;
}
if (optind>=(argc-2)) usage=1;
else
{
image=argv[optind++];
attrs = argv[optind++];
}
if (usage)
{
fprintf(stderr,"Usage: %s [-f format] [-T dsktype] image [NMrsa1234] pattern ...\n",cmd);
exit(1);
}
/*}}}*/
/* open image */ /*{{{*/
if ((err=Device_open(&drive.dev, image, O_RDWR, devopts)))
{
fprintf(stderr,"%s: can not open %s (%s)\n",cmd,image,err);
exit(1);
}
cpmReadSuper(&drive,&root,format);
/*}}}*/
cpmglob(optind,argc,argv,&root,&gargc,&gargv);
for (i=0; i<gargc; ++i)
{
struct cpmInode ino;
int rc;
cpm_attr_t attrib;
rc = cpmNamei(&root,gargv[i], &ino)==-1;
if (!rc) rc = cpmAttrGet(&ino, &attrib);
if (!rc)
{
int n, m;
m = 0;
for (n = 0; n < strlen(attrs); n++)
{
int mask = 0;
switch (attrs[n])
{
case 'n':
case 'N': mask = 0; attrib = 0; break;
case 'm':
case 'M': mask = 0; m = !m; break;
case '1': mask = CPM_ATTR_F1; break;
case '2': mask = CPM_ATTR_F2; break;
case '3': mask = CPM_ATTR_F3; break;
case '4': mask = CPM_ATTR_F4; break;
case 'r':
case 'R': mask = CPM_ATTR_RO; break;
case 's':
case 'S': mask = CPM_ATTR_SYS; break;
case 'a':
case 'A': mask = CPM_ATTR_ARCV; break;
default: fprintf(stderr, "%s: Unknown attribute %c\n", cmd, attrs[n]);
exit(1);
}
if (m) attrib &= ~mask; else attrib |= mask;
}
rc = cpmAttrSet(&ino, attrib);
}
if (rc)
{
fprintf(stderr,"%s: can not set attributes for %s: %s\n",cmd,gargv[i],boo);
exitcode=1;
}
}
cpmUmount(&drive);
exit(exitcode);
}
/*}}}*/

BIN
branches/dwg/LSource/src/cpmtools-2.13/cpmchmod

Binary file not shown.

57
branches/dwg/LSource/src/cpmtools-2.13/cpmchmod.1

@ -1,57 +0,0 @@
.TH CPMCHMOD 1 "March 30, 2010" "CP/M tools" "User commands"
.SH NAME \"{{{roff}}}\"{{{
cpmchmod \- change file mode on CP/M files
.\"}}}
.SH SYNOPSIS \"{{{
.ad l
.B cpmchmod
.RB [ \-f
.IR format ]
.I image
.I mode
.I file-pattern
\&...
.ad b
.\"}}}
.SH DESCRIPTION \"{{{
\fBCpmchmod\fP changes the file mode for files on CP/M files.
.\"}}}
.SH OPTIONS \"{{{
.IP "\fB\-f\fP \fIformat\fP"
Use the given CP/M disk \fIformat\fP instead of the default format.
.IP "\fImode\fP"
Octal file mode, as used in \fIchmod\fP(1).
.\"}}}
.SH "RETURN VALUE" \"{{{
Upon successful completion, exit code 0 is returned.
.\"}}}
.SH ERRORS \"{{{
Any errors are indicated by exit code 1.
.\"}}}
.SH FILES \"{{{
${prefix}/share/diskdefs CP/M disk format definitions
.\"}}}
.SH AUTHORS \"{{{
This program is copyright 1997\(en2010 Michael Haardt
<michael@moria.de> and copyright 2000, 2001 John Elliott
<jce@seasip.demon.co.uk>.
.PP
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.
.PP
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.
.PP
You should have received a copy of the GNU General Public License along
with this program. If not, write to the Free Software Foundation, Inc.,
59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
.\"}}}
.SH "SEE ALSO" \"{{{
.IR cpmls (1),
.IR chmod (1),
.IR cpm (5)
.\"}}}

57
branches/dwg/LSource/src/cpmtools-2.13/cpmchmod.1.in

@ -1,57 +0,0 @@
.TH CPMCHMOD 1 "@UPDATED@" "CP/M tools" "User commands"
.SH NAME \"{{{roff}}}\"{{{
cpmchmod \- change file mode on CP/M files
.\"}}}
.SH SYNOPSIS \"{{{
.ad l
.B cpmchmod
.RB [ \-f
.IR format ]
.I image
.I mode
.I file-pattern
\&...
.ad b
.\"}}}
.SH DESCRIPTION \"{{{
\fBCpmchmod\fP changes the file mode for files on CP/M files.
.\"}}}
.SH OPTIONS \"{{{
.IP "\fB\-f\fP \fIformat\fP"
Use the given CP/M disk \fIformat\fP instead of the default format.
.IP "\fImode\fP"
Octal file mode, as used in \fIchmod\fP(1).
.\"}}}
.SH "RETURN VALUE" \"{{{
Upon successful completion, exit code 0 is returned.
.\"}}}
.SH ERRORS \"{{{
Any errors are indicated by exit code 1.
.\"}}}
.SH FILES \"{{{
@DATADIR@/diskdefs CP/M disk format definitions
.\"}}}
.SH AUTHORS \"{{{
This program is copyright 1997\(en2010 Michael Haardt
<michael@moria.de> and copyright 2000, 2001 John Elliott
<jce@seasip.demon.co.uk>.
.PP
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.
.PP
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.
.PP
You should have received a copy of the GNU General Public License along
with this program. If not, write to the Free Software Foundation, Inc.,
59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
.\"}}}
.SH "SEE ALSO" \"{{{
.IR cpmls (1),
.IR chmod (1),
.IR cpm (5)
.\"}}}

84
branches/dwg/LSource/src/cpmtools-2.13/cpmchmod.c

@ -1,84 +0,0 @@
/* #includes */ /*{{{C}}}*//*{{{*/
#include "config.h"
#include <ctype.h>
#include <errno.h>
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include "getopt_.h"
#include "cpmfs.h"
#ifdef USE_DMALLOC
#include <dmalloc.h>
#endif
/*}}}*/
const char cmd[]="cpmchmod";
int main(int argc, char *argv[]) /*{{{*/
{
/* variables */ /*{{{*/
const char *err;
const char *image;
const char *format=FORMAT;
const char *devopts=NULL;
int c,i,usage=0,exitcode=0;
struct cpmSuperBlock drive;
struct cpmInode root;
int gargc;
char **gargv;
unsigned int mode;
/*}}}*/
/* parse options */ /*{{{*/
while ((c=getopt(argc,argv,"T:f:h?"))!=EOF) switch(c)
{
case 'T': devopts=optarg; break;
case 'f': format=optarg; break;
case 'h':
case '?': usage=1; break;
}
if (optind>=(argc-2)) usage=1;
else
{
image=argv[optind++];
if (!sscanf(argv[optind++], "%o", &mode)) usage=1;
}
if (usage)
{
fprintf(stderr,"Usage: %s [-f format] image mode pattern ...\n",cmd);
exit(1);
}
/*}}}*/
/* open image */ /*{{{*/
if ((err=Device_open(&drive.dev, image, O_RDWR, devopts)))
{
fprintf(stderr,"%s: can not open %s (%s)\n",cmd,image,err);
exit(1);
}
cpmReadSuper(&drive,&root,format);
/*}}}*/
cpmglob(optind,argc,argv,&root,&gargc,&gargv);
for (i=0; i<gargc; ++i)
{
struct cpmInode ino;
if (cpmNamei(&root,gargv[i], &ino)==-1)
{
fprintf(stderr,"%s: can not find %s: %s\n",cmd,gargv[i],boo);
exitcode=1;
}
else if (cpmChmod(&ino, mode) == -1)
{
fprintf(stderr,"%s: Failed to set attributes for %s: %s\n",cmd,gargv[i],boo);
exitcode=1;
}
}
cpmUmount(&drive);
exit(exitcode);
}
/*}}}*/

BIN
branches/dwg/LSource/src/cpmtools-2.13/cpmcp

Binary file not shown.

92
branches/dwg/LSource/src/cpmtools-2.13/cpmcp.1

@ -1,92 +0,0 @@
.TH CPMCP 1 "March 30, 2010" "CP/M tools" "User commands"
.SH NAME \"{{{roff}}}\"{{{
cpmcp \- copy files from and to CP/M disks
.\"}}}
.SH SYNOPSIS \"{{{
.ad l
.B cpmcp
.RB [ \-f
.IR format ]
.RB [ \-p ]
.RB [ \-t ]
.I image
\fIuser\fP\fB:\fP\fIfile\fP \fIfile\fP
.br
.B cpmcp
.RB [ \-f
.IR format ]
.RB [ \-p ]
.RB [ \-t ]
.I image
\fIuser\fP\fB:\fP\fIfile\fP ... \fIdirectory\fP
.br
.B cpmcp
.RB [ \-f
.IR format ]
.RB [ \-p ]
.RB [ \-t ]
.I image
\fIfile\fP \fIuser\fP\fB:\fP\fIfile\fP
.br
.B cpmcp
.RB [ \-f
.IR format ]
.RB [ \-p ]
.RB [ \-t ]
.I image
\fIfile\fP ... \fIuser\fP\fB:\fP
.ad b
.\"}}}
.SH DESCRIPTION \"{{{
\fBcpmcp\fP copies one or more files to or from a CP/M disk. When copying
multiple files, the last argument must be a drive or directory. The drive
letter does not matter because the device is specified by the image, it is
only used to specify which direction you want to copy. The user number is
specified after the drive letter, if omitted user 0 is used.
.PP
You can use \fB*\fP and \fB?\fP in CP/M file names, which have the same
meaning in
.IR sh (1)
file name patterns.
.\"}}}
.SH OPTIONS \"{{{
.IP "\fB\-f\fP \fIformat\fP"
Use the given CP/M disk \fIformat\fP instead of the default format.
.IP \fB\-p\fP
Preserve time stamps when copying files from CP/M to UNIX (not
implemented for copying the other way so far).
.IP \fB\-t\fP
Convert text files between CP/M and UNIX conventions.
.\"}}}
.SH "RETURN VALUE" \"{{{
Upon successful completion, exit code 0 is returned.
.\"}}}
.SH ERRORS \"{{{
Any errors are indicated by exit code 1.
.\"}}}
.SH FILES \"{{{
${prefix}/share/diskdefs CP/M disk format definitions
.\"}}}
.SH AUTHORS \"{{{
This program is copyright 1997\(en2010 Michael Haardt
<michael@moria.de>. The Windows port is copyright 2000, 2001 John Elliott
<jce@seasip.demon.co.uk>.
.PP
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.
.PP
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.
.PP
You should have received a copy of the GNU General Public License along
with this program. If not, write to the Free Software Foundation, Inc.,
59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
.\"}}}
.SH "SEE ALSO" \"{{{
.IR cpmls (1),
.IR cpm (5)
.\"}}}

92
branches/dwg/LSource/src/cpmtools-2.13/cpmcp.1.in

@ -1,92 +0,0 @@
.TH CPMCP 1 "@UPDATED@" "CP/M tools" "User commands"
.SH NAME \"{{{roff}}}\"{{{
cpmcp \- copy files from and to CP/M disks
.\"}}}
.SH SYNOPSIS \"{{{
.ad l
.B cpmcp
.RB [ \-f
.IR format ]
.RB [ \-p ]
.RB [ \-t ]
.I image
\fIuser\fP\fB:\fP\fIfile\fP \fIfile\fP
.br
.B cpmcp
.RB [ \-f
.IR format ]
.RB [ \-p ]
.RB [ \-t ]
.I image
\fIuser\fP\fB:\fP\fIfile\fP ... \fIdirectory\fP
.br
.B cpmcp
.RB [ \-f
.IR format ]
.RB [ \-p ]
.RB [ \-t ]
.I image
\fIfile\fP \fIuser\fP\fB:\fP\fIfile\fP
.br
.B cpmcp
.RB [ \-f
.IR format ]
.RB [ \-p ]
.RB [ \-t ]
.I image
\fIfile\fP ... \fIuser\fP\fB:\fP
.ad b
.\"}}}
.SH DESCRIPTION \"{{{
\fBcpmcp\fP copies one or more files to or from a CP/M disk. When copying
multiple files, the last argument must be a drive or directory. The drive
letter does not matter because the device is specified by the image, it is
only used to specify which direction you want to copy. The user number is
specified after the drive letter, if omitted user 0 is used.
.PP
You can use \fB*\fP and \fB?\fP in CP/M file names, which have the same
meaning in
.IR sh (1)
file name patterns.
.\"}}}
.SH OPTIONS \"{{{
.IP "\fB\-f\fP \fIformat\fP"
Use the given CP/M disk \fIformat\fP instead of the default format.
.IP \fB\-p\fP
Preserve time stamps when copying files from CP/M to UNIX (not
implemented for copying the other way so far).
.IP \fB\-t\fP
Convert text files between CP/M and UNIX conventions.
.\"}}}
.SH "RETURN VALUE" \"{{{
Upon successful completion, exit code 0 is returned.
.\"}}}
.SH ERRORS \"{{{
Any errors are indicated by exit code 1.
.\"}}}
.SH FILES \"{{{
@DATADIR@/diskdefs CP/M disk format definitions
.\"}}}
.SH AUTHORS \"{{{
This program is copyright 1997\(en2010 Michael Haardt
<michael@moria.de>. The Windows port is copyright 2000, 2001 John Elliott
<jce@seasip.demon.co.uk>.
.PP
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.
.PP
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.
.PP
You should have received a copy of the GNU General Public License along
with this program. If not, write to the Free Software Foundation, Inc.,
59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
.\"}}}
.SH "SEE ALSO" \"{{{
.IR cpmls (1),
.IR cpm (5)
.\"}}}

284
branches/dwg/LSource/src/cpmtools-2.13/cpmcp.c

@ -1,284 +0,0 @@
/* #includes */ /*{{{C}}}*//*{{{*/
#include "config.h"
#include <sys/stat.h>
#include <sys/types.h>
#include <ctype.h>
#include <errno.h>
#include <stdio.h>
#include <string.h>
#include <fcntl.h>
#include <limits.h>
#include <stdlib.h>
#include <utime.h>
#include "getopt_.h"
#include "cpmfs.h"
#ifdef USE_DMALLOC
#include <dmalloc.h>
#endif
/*}}}*/
const char cmd[]="cpmcp";
static int text=0;
static int preserve=0;
/**
* Return the user number.
* @param s CP/M filename in 0[0]:aaaaaaaa.bbb format.
* @returns The user number or -1 for no match.
*/
static int userNumber(const char *s) /*{{{*/
{
if (isdigit(*s) && *(s+1)==':') return (*s-'0');
if (isdigit(*s) && isdigit(*(s+1)) && *(s+2)==':') return (10*(*s-'0')+(*(s+1)));
return -1;
}
/*}}}*/
/**
* Copy one file from CP/M to UNIX.
* @param root The inode for the root directory.
* @param src The CP/M filename in 00aaaaaaaabbb format.
* @param dest The UNIX filename.
* @returns 0 for success, 1 for error.
*/
static int cpmToUnix(const struct cpmInode *root, const char *src, const char *dest) /*{{{*/
{
struct cpmInode ino;
int exitcode=0;
if (cpmNamei(root,src,&ino)==-1) { fprintf(stderr,"%s: can not open `%s': %s\n",cmd,src,boo); exitcode=1; }
else
{
struct cpmFile file;
FILE *ufp;
cpmOpen(&ino,&file,O_RDONLY);
if ((ufp=fopen(dest,text ? "w" : "wb"))==(FILE*)0) { fprintf(stderr,"%s: can not create %s: %s\n",cmd,dest,strerror(errno)); exitcode=1; }
else
{
int crpending=0;
int ohno=0;
int res;
char buf[4096];
while ((res=cpmRead(&file,buf,sizeof(buf)))!=0)
{
int j;
for (j=0; j<res; ++j)
{
if (text)
{
if (buf[j]=='\032') goto endwhile;
if (crpending)
{
if (buf[j]=='\n')
{
if (putc('\n',ufp)==EOF) { fprintf(stderr,"%s: can not write %s: %s\n",cmd,dest,strerror(errno)); exitcode=1; ohno=1; goto endwhile; }
crpending=0;
}
else if (putc('\r',ufp)==EOF) { fprintf(stderr,"%s: can not write %s: %s\n",cmd,dest,strerror(errno)); exitcode=1; ohno=1; goto endwhile; }
crpending=(buf[j]=='\r');
}
else
{
if (buf[j]=='\r') crpending=1;
else if (putc(buf[j],ufp)==EOF) { fprintf(stderr,"%s: can not write %s: %s\n",cmd,dest,strerror(errno)); exitcode=1; ohno=1; goto endwhile; }
}
}
else if (putc(buf[j],ufp)==EOF) { fprintf(stderr,"%s: can not write %s: %s\n",cmd,dest,strerror(errno)); exitcode=1; ohno=1; goto endwhile; }
}
}
endwhile:
if (fclose(ufp)==EOF && !ohno) { fprintf(stderr,"%s: can not close %s: %s\n",cmd,dest,strerror(errno)); exitcode=1; ohno=1; }
if (preserve && !ohno && (ino.atime || ino.mtime))
{
struct utimbuf ut;
if (ino.atime) ut.actime=ino.atime; else time(&ut.actime);
if (ino.mtime) ut.modtime=ino.mtime; else time(&ut.modtime);
if (utime(dest,&ut)==-1) { fprintf(stderr,"%s: can change timestamps of %s: %s\n",cmd,dest,strerror(errno)); exitcode=1; ohno=1; }
}
}
cpmClose(&file);
}
return exitcode;
}
/*}}}*/
static void usage(void) /*{{{*/
{
fprintf(stderr,"Usage: %s [-f format] [-p] [-t] image user:file file\n",cmd);
fprintf(stderr," %s [-f format] [-p] [-t] image user:file ... directory\n",cmd);
fprintf(stderr," %s [-f format] [-p] [-t] image file user:file\n",cmd);
fprintf(stderr," %s [-f format] [-p] [-t] image file ... user:\n",cmd);
exit(1);
}
/*}}}*/
int main(int argc, char *argv[])
{
/* variables */ /*{{{*/
const char *err;
const char *image;
const char *format=FORMAT;
const char *devopts=NULL;
int c,readcpm=-1,todir=-1;
struct cpmInode root;
struct cpmSuperBlock super;
int exitcode=0;
int gargc;
char **gargv;
/*}}}*/
/* parse options */ /*{{{*/
while ((c=getopt(argc,argv,"T:f:h?pt"))!=EOF) switch(c)
{
case 'T': devopts=optarg; break;
case 'f': format=optarg; break;
case 'h':
case '?': usage(); break;
case 'p': preserve=1; break;
case 't': text=1; break;
}
/*}}}*/
/* parse arguments */ /*{{{*/
if ((optind+2)>=argc) usage();
image=argv[optind++];
if (userNumber(argv[optind])>=0) /* cpm -> unix? */ /*{{{*/
{
int i;
struct stat statbuf;
for (i=optind; i<(argc-1); ++i) if (userNumber(argv[i])==-1) usage();
todir=((argc-optind)>2);
if (stat(argv[argc-1],&statbuf)==-1) { if (todir) usage(); }
else if (S_ISDIR(statbuf.st_mode)) todir=1; else if (todir) usage();
readcpm=1;
}
/*}}}*/
else if (userNumber(argv[argc-1])>=0) /* unix -> cpm */ /*{{{*/
{
int i;
todir=0;
for (i=optind; i<(argc-1); ++i) if (userNumber(argv[i])>=0) usage();
if ((argc-optind)>2 && *(strchr(argv[argc-1],':')+1)!='\0') usage();
if (*(strchr(argv[argc-1],':')+1)=='\0') todir=1;
readcpm=0;
}
/*}}}*/
else usage();
/*}}}*/
/* open image file */ /*{{{*/
if ((err=Device_open(&super.dev,image,readcpm ? O_RDONLY : O_RDWR, devopts)))
{
fprintf(stderr,"%s: can not open %s (%s)\n",cmd,image,err);
exit(1);
}
cpmReadSuper(&super,&root,format);
/*}}}*/
if (readcpm) /* copy from CP/M to UNIX */ /*{{{*/
{
int i;
char *last=argv[argc-1];
cpmglob(optind,argc-1,argv,&root,&gargc,&gargv);
/* trying to copy multiple files to a file? */
if (gargc>1 && !todir) usage();
for (i=0; i<gargc; ++i)
{
char dest[_POSIX_PATH_MAX];
if (todir)
{
strcpy(dest,last);
strcat(dest,"/");
strcat(dest,gargv[i]+2);
}
else strcpy(dest,last);
if (cpmToUnix(&root,gargv[i],dest)) exitcode=1;
}
}
/*}}}*/
else /* copy from UNIX to CP/M */ /*{{{*/
{
int i;
for (i=optind; i<(argc-1); ++i)
{
/* variables */ /*{{{*/
char *dest=(char*)0;
FILE *ufp;
/*}}}*/
if ((ufp=fopen(argv[i],"rb"))==(FILE*)0) /* cry a little */ /*{{{*/
{
fprintf(stderr,"%s: can not open %s: %s\n",cmd,argv[i],strerror(errno));
exitcode=1;
}
/*}}}*/
else
{
struct cpmInode ino;
char cpmname[2+8+1+3+1]; /* 00foobarxy.zzy\0 */
if (todir)
{
if ((dest=strrchr(argv[i],'/'))!=(char*)0) ++dest; else dest=argv[i];
sprintf(cpmname,"%02d%s",userNumber(argv[argc-1]),dest);
}
else
{
sprintf(cpmname,"%02d%s",userNumber(argv[argc-1]),strchr(argv[argc-1],':')+1);
}
if (cpmCreat(&root,cpmname,&ino,0666)==-1) /* just cry */ /*{{{*/
{
fprintf(stderr,"%s: can not create %s: %s\n",cmd,cpmname,boo);
exitcode=1;
}
/*}}}*/
else
{
struct cpmFile file;
int ohno=0;
char buf[4096+1];
cpmOpen(&ino,&file,O_WRONLY);
do
{
int j;
for (j=0; j<(sizeof(buf)/2) && (c=getc(ufp))!=EOF; ++j)
{
if (text && c=='\n') buf[j++]='\r';
buf[j]=c;
}
if (text && c==EOF) buf[j++]='\032';
if (cpmWrite(&file,buf,j)!=j)
{
fprintf(stderr,"%s: can not write %s: %s\n",cmd,dest,boo);
ohno=1;
exitcode=1;
break;
}
} while (c!=EOF);
if (cpmClose(&file)==EOF && !ohno) /* I just can't hold back the tears */ /*{{{*/
{
fprintf(stderr,"%s: can not close %s: %s\n",cmd,dest,boo);
exitcode=1;
}
/*}}}*/
}
fclose(ufp);
}
}
}
/*}}}*/
cpmUmount(&super);
exit(exitcode);
}

21
branches/dwg/LSource/src/cpmtools-2.13/cpmdir.h

@ -1,21 +0,0 @@
#ifndef CPMDIR_H
#define CPMDIR_H
struct PhysDirectoryEntry
{
char status;
char name[8];
char ext[3];
char extnol;
char lrc;
char extnoh;
char blkcnt;
char pointers[16];
};
#define ISFILECHAR(notFirst,c) (((notFirst) || (c)!=' ') && (c)>=' ' && !((c)&~0x7f) && (c)!='<' && (c)!='>' && (c)!='.' && (c)!=',' && (c)!=';' && (c)!=':' && (c)!='=' && (c)!='?' && (c)!='*' && (c)!= '[' && (c)!=']')
#define EXTENT(low,high) (((low)&0x1f)|(((high)&0x3f)<<5))
#define EXTENTL(extent) ((extent)&0x1f)
#define EXTENTH(extent) (((extent>>5))&0x3f)
#endif

1561
branches/dwg/LSource/src/cpmtools-2.13/cpmfs.c

File diff suppressed because it is too large

174
branches/dwg/LSource/src/cpmtools-2.13/cpmfs.h

@ -1,174 +0,0 @@
#ifndef CPMFS_H
#define CPMFS_H
#include <sys/stat.h>
#include <sys/types.h>
#ifdef _WIN32
#include <windows.h>
#include <winioctl.h>
/* To make it compile on NT: extracts from Linux 2.0 *
* <statbuf.h> and <sys/stat.h> */
#define __S_IFMT 0170000 /* These bits determine file type. */
#define __S_IFDIR 0040000 /* Directory. */
#define __S_IFREG 0100000 /* Regular file. */
#define __S_IWUSR 0000200 /* Writable for user. */
#define __S_IWGRP 0000200 /* Writable for group. */
#define __S_IWOTH 0000200 /* Writable for others. */
#define __S_ISTYPE(mode, mask) (((mode) & __S_IFMT) == (mask))
#define __S_ISTYPE(mode, mask) (((mode) & __S_IFMT) == (mask))
/* These bits are defined in Borland C++ 5 but not in MS Visual C++ */
#ifndef S_ISDIR
# define S_ISDIR(mode) __S_ISTYPE((mode), __S_IFDIR)
#endif
#ifndef S_ISREG
# define S_ISREG(mode) __S_ISTYPE((mode), __S_IFREG)
#endif
#ifndef S_IWUSR
#define S_IWUSR __S_IWUSR
#endif
#ifndef S_IWGRP
#define S_IWGRP __S_IWGRP
#endif
#ifndef S_IWOTH
#define S_IWOTH __S_IWOTH
#endif
#include <io.h> /* For open(), lseek() etc. */
#ifndef HAVE_MODE_T
typedef int mode_t;
#endif
#endif
#ifdef __cplusplus
extern "C" {
#endif
#include "device.h"
/* CP/M file attributes */
#define CPM_ATTR_F1 1
#define CPM_ATTR_F2 2
#define CPM_ATTR_F3 4
#define CPM_ATTR_F4 8
/* F5-F8 are banned in CP/M 2 & 3, F7 is used by ZSDOS */
#define CPM_ATTR_RO 256 /* Read-only */
#define CPM_ATTR_SYS 512 /* System */
#define CPM_ATTR_ARCV 1024 /* Archive */
#define CPM_ATTR_PWDEL 2048 /* Password required to delete */
#define CPM_ATTR_PWWRITE 4096 /* Password required to write */
#define CPM_ATTR_PWREAD 8192 /* Password required to read */
typedef int cpm_attr_t;
struct cpmInode
{
ino_t ino;
mode_t mode;
off_t size;
cpm_attr_t attr;
time_t atime;
time_t mtime;
time_t ctime;
struct cpmSuperBlock *sb;
};
struct cpmFile
{
mode_t mode;
off_t pos;
struct cpmInode *ino;
};
struct cpmDirent
{
ino_t ino;
off_t off;
size_t reclen;
char name[2+8+1+3+1]; /* 00foobarxy.zzy\0 */
};
struct cpmStat
{
ino_t ino;
mode_t mode;
off_t size;
time_t atime;
time_t mtime;
time_t ctime;
};
#define CPMFS_DR22 0
#define CPMFS_P2DOS 1
#define CPMFS_DR3 2
struct cpmSuperBlock
{
struct Device dev;
int secLength;
int tracks;
int sectrk;
int blksiz;
int maxdir;
int skew;
int boottrk;
int type;
int size;
int extents; /* logical extents per physical extent */
struct PhysDirectoryEntry *dir;
int alvSize;
int *alv;
int *skewtab;
int cnotatime;
char *label;
size_t labelLength;
char *passwd;
size_t passwdLength;
struct cpmInode *root;
int dirtyDirectory;
};
struct cpmStatFS
{
long f_bsize;
long f_blocks;
long f_bfree;
long f_bused;
long f_bavail;
long f_files;
long f_ffree;
long f_namelen;
};
extern const char cmd[];
extern const char *boo;
int match(const char *a, const char *pattern);
void cpmglob(int opti, int argc, char * const argv[], struct cpmInode *root, int *gargc, char ***gargv);
int cpmReadSuper(struct cpmSuperBlock *drive, struct cpmInode *root, const char *format);
int cpmNamei(const struct cpmInode *dir, const char *filename, struct cpmInode *i);
void cpmStatFS(const struct cpmInode *ino, struct cpmStatFS *buf);
int cpmUnlink(const struct cpmInode *dir, const char *fname);
int cpmRename(const struct cpmInode *dir, const char *old, const char *newname);
int cpmOpendir(struct cpmInode *dir, struct cpmFile *dirp);
int cpmReaddir(struct cpmFile *dir, struct cpmDirent *ent);
void cpmStat(const struct cpmInode *ino, struct cpmStat *buf);
int cpmAttrGet(struct cpmInode *ino, cpm_attr_t *attrib);
int cpmAttrSet(struct cpmInode *ino, cpm_attr_t attrib);
int cpmChmod(struct cpmInode *ino, mode_t mode);
int cpmOpen(struct cpmInode *ino, struct cpmFile *file, mode_t mode);
int cpmRead(struct cpmFile *file, char *buf, int count);
int cpmWrite(struct cpmFile *file, const char *buf, int count);
int cpmClose(struct cpmFile *file);
int cpmCreat(struct cpmInode *dir, const char *fname, struct cpmInode *ino, mode_t mode);
int cpmSync(struct cpmSuperBlock *sb);
void cpmUmount(struct cpmSuperBlock *sb);
#ifdef __cplusplus
}
#endif
#endif

BIN
branches/dwg/LSource/src/cpmtools-2.13/cpmls

Binary file not shown.

67
branches/dwg/LSource/src/cpmtools-2.13/cpmls.1

@ -1,67 +0,0 @@
.TH CPMLS 1 "March 30, 2010" "CP/M tools" "User commands"
.SH NAME \"{{{roff}}}\"{{{
cpmls \- list sorted contents of directory
.\"}}}
.SH SYNOPSIS \"{{{
.ad l
.B cpmls
.RB [ \-d | \-D | \-F | \-A | \-l [ \-c ][ \-i ]]
.RB [ \-f
.IR format ]
.I image
.RI [ file-pattern "...]"
.ad b
.\"}}}
.SH DESCRIPTION \"{{{
\fBCpmls\fP lists the sorted contents of the directory.
.\"}}}
.SH OPTIONS \"{{{
.IP "\fB\-f\fP \fIformat\fP"
Use the given CP/M disk \fIformat\fP instead of the default format.
.IP \fB\-d\fP
Old CP/M 2.2 dir output.
.IP \fB\-D\fP
P2DOS 2.3 ddir-like output.
.IP \fB\-F\fp
CP/M 3.x dir output.
.IP \fB\-A\fp
E2fs lsattr-like output.
.IP \fB\-l\fP
Long UNIX-style directory listing including size, time stamp and user number.
.IP \fB\-c\fP
Output the creation time, not the modification time.
.IP \fB\-i\fP
Print index number of each file.
.\"}}}
.SH "RETURN VALUE" \"{{{
Upon successful completion, exit code 0 is returned.
.\"}}}
.SH ERRORS \"{{{
Any errors are indicated by exit code 1.
.\"}}}
.SH FILES \"{{{
${prefix}/share/diskdefs CP/M disk format definitions
.\"}}}
.SH AUTHORS \"{{{
This program is copyright 1997\(en2010 Michael Haardt
<michael@moria.de>. The Windows port is copyright 2000, 2001 John Elliott
<jce@seasip.demon.co.uk>.
.PP
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.
.PP
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.
.PP
You should have received a copy of the GNU General Public License along
with this program. If not, write to the Free Software Foundation, Inc.,
59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
.\"}}}
.SH "SEE ALSO" \"{{{
.IR cpmcp (1),
.IR cpm (5)
.\"}}}

67
branches/dwg/LSource/src/cpmtools-2.13/cpmls.1.in

@ -1,67 +0,0 @@
.TH CPMLS 1 "@UPDATED@" "CP/M tools" "User commands"
.SH NAME \"{{{roff}}}\"{{{
cpmls \- list sorted contents of directory
.\"}}}
.SH SYNOPSIS \"{{{
.ad l
.B cpmls
.RB [ \-d | \-D | \-F | \-A | \-l [ \-c ][ \-i ]]
.RB [ \-f
.IR format ]
.I image
.RI [ file-pattern "...]"
.ad b
.\"}}}
.SH DESCRIPTION \"{{{
\fBCpmls\fP lists the sorted contents of the directory.
.\"}}}
.SH OPTIONS \"{{{
.IP "\fB\-f\fP \fIformat\fP"
Use the given CP/M disk \fIformat\fP instead of the default format.
.IP \fB\-d\fP
Old CP/M 2.2 dir output.
.IP \fB\-D\fP
P2DOS 2.3 ddir-like output.
.IP \fB\-F\fp
CP/M 3.x dir output.
.IP \fB\-A\fp
E2fs lsattr-like output.
.IP \fB\-l\fP
Long UNIX-style directory listing including size, time stamp and user number.
.IP \fB\-c\fP
Output the creation time, not the modification time.
.IP \fB\-i\fP
Print index number of each file.
.\"}}}
.SH "RETURN VALUE" \"{{{
Upon successful completion, exit code 0 is returned.
.\"}}}
.SH ERRORS \"{{{
Any errors are indicated by exit code 1.
.\"}}}
.SH FILES \"{{{
@DATADIR@/diskdefs CP/M disk format definitions
.\"}}}
.SH AUTHORS \"{{{
This program is copyright 1997\(en2010 Michael Haardt
<michael@moria.de>. The Windows port is copyright 2000, 2001 John Elliott
<jce@seasip.demon.co.uk>.
.PP
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.
.PP
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.
.PP
You should have received a copy of the GNU General Public License along
with this program. If not, write to the Free Software Foundation, Inc.,
59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
.\"}}}
.SH "SEE ALSO" \"{{{
.IR cpmcp (1),
.IR cpm (5)
.\"}}}

383
branches/dwg/LSource/src/cpmtools-2.13/cpmls.c

@ -1,383 +0,0 @@
/* #includes */ /*{{{C}}}*//*{{{*/
#include "config.h"
#include <ctype.h>
#include <errno.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include "getopt_.h"
#include "cpmfs.h"
#ifdef USE_DMALLOC
#include <dmalloc.h>
#endif
/*}}}*/
/* variables */ /*{{{*/
static const char * const month[12]={"Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec" };
/*}}}*/
/* namecmp -- compare two entries */ /*{{{*/
static int namecmp(const void *a, const void *b)
{
if (**((const char * const *)a)=='[') return -1;
return strcmp(*((const char * const *)a),*((const char * const *)b));
}
/*}}}*/
/* olddir -- old style output */ /*{{{*/
static void olddir(char **dirent, int entries)
{
int i,j,k,l,user,announce;
announce=0;
for (user=0; user<32; ++user)
{
for (i=l=0; i<entries; ++i)
{
if (dirent[i][0]=='0'+user/10 && dirent[i][1]=='0'+user%10)
{
if (announce==1)
{
printf("User %d\n",user);
}
announce=2;
if (l%4) printf(" : ");
for (j=2; dirent[i][j] && dirent[i][j]!='.'; ++j) putchar(toupper(dirent[i][j]));
k=j; while (k<11) { putchar(' '); ++k; }
if (dirent[i][j]=='.') ++j;
for (k=0; dirent[i][j]; ++j,++k) putchar(toupper(dirent[i][j]));
for (; k<3; ++k) putchar(' ');
++l;
}
if (l && (l%4)==0) {
l = 0;
putchar('\n');
}
}
if (l%4) {
putchar('\n');
}
if (announce==2) announce=1;
}
if (entries==0) printf("No files\n");
}
/*}}}*/
/* oldddir -- old style long output */ /*{{{*/
static void oldddir(char **dirent, int entries, struct cpmInode *ino)
{
struct cpmStatFS buf;
struct cpmStat statbuf;
struct cpmInode file;
if (entries)
{
int i,j,k,l,announce,user;
qsort(dirent,entries,sizeof(char*),namecmp);
cpmStatFS(ino,&buf);
printf(" Name Bytes Recs Attr update create\n");
printf("------------ ------ ------ ---- ----------------- -----------------\n");
announce=0;
for (l=user=0; user<32; ++user)
{
for (i=0; i<entries; ++i)
{
struct tm *tmp;
if (dirent[i][0]=='0'+user/10 && dirent[i][1]=='0'+user%10)
{
if (announce==1)
{
printf("\nUser %d:\n\n",user);
printf(" Name Bytes Recs Attr update create\n");
printf("------------ ------ ------ ---- ----------------- -----------------\n");
}
announce=2;
for (j=2; dirent[i][j] && dirent[i][j]!='.'; ++j) putchar(toupper(dirent[i][j]));
k=j; while (k<10) { putchar(' '); ++k; }
putchar('.');
if (dirent[i][j]=='.') ++j;
for (k=0; dirent[i][j]; ++j,++k) putchar(toupper(dirent[i][j]));
for (; k<3; ++k) putchar(' ');
cpmNamei(ino,dirent[i],&file);
cpmStat(&file,&statbuf);
printf(" %5.1ldK",(long) (statbuf.size+buf.f_bsize-1) /
buf.f_bsize*(buf.f_bsize/1024));
printf(" %6.1ld ",(long)(statbuf.size/128));
putchar(statbuf.mode&0200 ? ' ' : 'R');
putchar(statbuf.mode&01000 ? 'S' : ' ');
putchar(' ');
if (statbuf.mtime)
{
tmp=localtime(&statbuf.mtime);
printf(" %02d-%s-%04d %02d:%02d",tmp->tm_mday,month[tmp->tm_mon],tmp->tm_year+1900,tmp->tm_hour,tmp->tm_min);
tmp=localtime(&statbuf.ctime);
printf(" %02d-%s-%04d %02d:%02d",tmp->tm_mday,month[tmp->tm_mon],tmp->tm_year+1900,tmp->tm_hour,tmp->tm_min);
}
putchar('\n');
++l;
}
}
if (announce==2) announce=1;
}
printf("%5.1d Files occupying %6.1ldK",l,(buf.f_bused*buf.f_bsize)/1024);
printf(", %7.1ldK Free.\n",(buf.f_bfree*buf.f_bsize)/1024);
}
else printf("No files found\n");
}
/*}}}*/
/* old3dir -- old CP/M Plus style long output */ /*{{{*/
static void old3dir(char **dirent, int entries, struct cpmInode *ino)
{
struct cpmStatFS buf;
struct cpmStat statbuf;
struct cpmInode file;
if (entries)
{
int i,j,k,l,announce,user, attrib;
int totalBytes=0,totalRecs=0;
qsort(dirent,entries,sizeof(char*),namecmp);
cpmStatFS(ino,&buf);
announce=1;
for (l=0,user=0; user<32; ++user)
{
for (i=0; i<entries; ++i)
{
struct tm *tmp;
if (dirent[i][0]=='0'+user/10 && dirent[i][1]=='0'+user%10)
{
cpmNamei(ino,dirent[i],&file);
cpmStat(&file,&statbuf);
cpmAttrGet(&file, &attrib);
if (announce==1)
{
if (user) putchar('\n');
printf("Directory For Drive A: User %2.1d\n\n",user);
printf(" Name Bytes Recs Attributes Prot Update Create\n");
printf("------------ ------ ------ ------------ ------ -------------- --------------\n\n");
}
announce=2;
for (j=2; dirent[i][j] && dirent[i][j]!='.'; ++j) putchar(toupper(dirent[i][j]));
k=j; while (k<10) { putchar(' '); ++k; }
putchar(' ');
if (dirent[i][j]=='.') ++j;
for (k=0; dirent[i][j]; ++j,++k) putchar(toupper(dirent[i][j]));
for (; k<3; ++k) putchar(' ');
totalBytes+=statbuf.size;
totalRecs+=(statbuf.size+127)/128;
printf(" %5.1ldk",(long) (statbuf.size+buf.f_bsize-1) /
buf.f_bsize*(buf.f_bsize/1024));
printf(" %6.1ld ",(long)(statbuf.size/128));
putchar((attrib & CPM_ATTR_F1) ? '1' : ' ');
putchar((attrib & CPM_ATTR_F2) ? '2' : ' ');
putchar((attrib & CPM_ATTR_F3) ? '3' : ' ');
putchar((attrib & CPM_ATTR_F4) ? '4' : ' ');
putchar((statbuf.mode&(S_IWUSR|S_IWGRP|S_IWOTH)) ? ' ' : 'R');
putchar((attrib & CPM_ATTR_SYS) ? 'S' : ' ');
putchar((attrib & CPM_ATTR_ARCV) ? 'A' : ' ');
printf(" ");
if (attrib & CPM_ATTR_PWREAD) printf("Read ");
else if (attrib & CPM_ATTR_PWWRITE) printf("Write ");
else if (attrib & CPM_ATTR_PWDEL) printf("Delete ");
else printf("None ");
tmp=localtime(&statbuf.mtime);
printf("%02d/%02d/%02d %02d:%02d ",tmp->tm_mon+1,tmp->tm_mday,tmp->tm_year%100,tmp->tm_hour,tmp->tm_min);
tmp=localtime(&statbuf.ctime);
printf("%02d/%02d/%02d %02d:%02d",tmp->tm_mon+1,tmp->tm_mday,tmp->tm_year%100,tmp->tm_hour,tmp->tm_min);
putchar('\n');
++l;
}
}
if (announce==2) announce=1;
}
printf("\nTotal Bytes = %6.1dk ",(totalBytes+1023)/1024);
printf("Total Records = %7.1d ",totalRecs);
printf("Files Found = %4.1d\n",l);
printf("Total 1k Blocks = %6.1ld ",(buf.f_bused*buf.f_bsize)/1024);
printf("Used/Max Dir Entries For Drive A: %4.1ld/%4.1ld\n",buf.f_files-buf.f_ffree,buf.f_files);
}
else printf("No files found\n");
}
/*}}}*/
/* ls -- UNIX style output */ /*{{{*/
static void ls(char **dirent, int entries, struct cpmInode *ino, int l, int c, int iflag)
{
int i,user,announce,any;
time_t now;
struct cpmStat statbuf;
struct cpmInode file;
time(&now);
qsort(dirent,entries,sizeof(char*),namecmp);
announce=0;
any=0;
for (user=0; user<32; ++user)
{
announce=0;
for (i=0; i<entries; ++i) if (dirent[i][0]!='.')
{
if (dirent[i][0]=='0'+user/10 && dirent[i][1]=='0'+user%10)
{
if (announce==0)
{
if (any) putchar('\n');
printf("%d:\n",user);
announce=1;
}
any=1;
if (iflag || l)
{
cpmNamei(ino,dirent[i],&file);
cpmStat(&file,&statbuf);
}
if (iflag) printf("%4ld ",(long) statbuf.ino);
if (l)
{
struct tm *tmp;
putchar(S_ISDIR(statbuf.mode) ? 'd' : '-');
putchar(statbuf.mode&0400 ? 'r' : '-');
putchar(statbuf.mode&0200 ? 'w' : '-');
putchar(statbuf.mode&0100 ? 'x' : '-');
putchar(statbuf.mode&0040 ? 'r' : '-');
putchar(statbuf.mode&0020 ? 'w' : '-');
putchar(statbuf.mode&0010 ? 'x' : '-');
putchar(statbuf.mode&0004 ? 'r' : '-');
putchar(statbuf.mode&0002 ? 'w' : '-');
putchar(statbuf.mode&0001 ? 'x' : '-');
#if 0
putchar(statbuf.flags&FLAG_PUBLIC ? 'p' : '-');
putchar(dir[i].flags&FLAG_SYSTEM ? 's' : '-');
printf(" %-2d ",dir[i].user);
#endif
printf("%8.1ld ",(long)statbuf.size);
tmp=localtime(c ? &statbuf.ctime : &statbuf.mtime);
printf("%s %02d ",month[tmp->tm_mon],tmp->tm_mday);
if ((c ? statbuf.ctime : statbuf.mtime)<(now-182*24*3600)) printf("%04d ",tmp->tm_year+1900);
else printf("%02d:%02d ",tmp->tm_hour,tmp->tm_min);
}
printf("%s\n",dirent[i]+2);
}
}
}
}
/*}}}*/
/* lsattr -- output something like e2fs lsattr */ /*{{{*/
static void lsattr(char **dirent, int entries, struct cpmInode *ino)
{
int i,user,announce,any;
struct cpmStat statbuf;
struct cpmInode file;
cpm_attr_t attrib;
qsort(dirent,entries,sizeof(char*),namecmp);
announce=0;
any=0;
for (user=0; user<32; ++user)
{
announce=0;
for (i=0; i<entries; ++i) if (dirent[i][0]!='.')
{
if (dirent[i][0]=='0'+user/10 && dirent[i][1]=='0'+user%10)
{
if (announce==0)
{
if (any) putchar('\n');
printf("%d:\n",user);
announce=1;
}
any=1;
cpmNamei(ino,dirent[i],&file);
cpmStat(&file,&statbuf);
cpmAttrGet(&file, &attrib);
putchar ((attrib & CPM_ATTR_F1) ? '1' : '-');
putchar ((attrib & CPM_ATTR_F2) ? '2' : '-');
putchar ((attrib & CPM_ATTR_F3) ? '3' : '-');
putchar ((attrib & CPM_ATTR_F4) ? '4' : '-');
putchar ((attrib & CPM_ATTR_SYS) ? 's' : '-');
putchar ((attrib & CPM_ATTR_ARCV) ? 'a' : '-');
putchar ((attrib & CPM_ATTR_PWREAD) ? 'r' : '-');
putchar ((attrib & CPM_ATTR_PWWRITE) ? 'w' : '-');
putchar ((attrib & CPM_ATTR_PWDEL) ? 'e' : '-');
printf(" %s\n",dirent[i]+2);
}
}
}
}
/*}}}*/
const char cmd[]="cpmls";
int main(int argc, char *argv[])
{
/* variables */ /*{{{*/
const char *err;
const char *image;
const char *format=FORMAT;
const char *devopts=NULL;
int c,usage=0;
struct cpmSuperBlock drive;
struct cpmInode root;
int style=0;
int changetime=0;
int inode=0;
char **gargv;
int gargc;
static char starlit[2]="*";
static char * const star[]={starlit};
/*}}}*/
/* parse options */ /*{{{*/
while ((c=getopt(argc,argv,"cT:f:ih?dDFlA"))!=EOF) switch(c)
{
case 'f': format=optarg; break;
case 'T': devopts=optarg; break;
case 'h':
case '?': usage=1; break;
case 'd': style=1; break;
case 'D': style=2; break;
case 'F': style=3; break;
case 'l': style=4; break;
case 'A': style=5; break;
case 'c': changetime=1; break;
case 'i': inode=1; break;
}
if (optind==argc) usage=1;
else image=argv[optind++];
if (usage)
{
fprintf(stderr,"Usage: %s [-f format] [-T libdsk-type] [-d|-D|-F|-A|[-l][-c][-i]] image [file ...]\n",cmd);
exit(1);
}
/*}}}*/
/* open image */ /*{{{*/
if ((err=Device_open(&drive.dev,image,O_RDONLY,devopts)))
{
fprintf(stderr,"%s: can not open %s (%s)\n",cmd,image,err);
exit(1);
}
cpmReadSuper(&drive,&root,format);
/*}}}*/
if (optind<argc) cpmglob(optind,argc,argv,&root,&gargc,&gargv);
else cpmglob(0,1,star,&root,&gargc,&gargv);
if (style==1) olddir(gargv,gargc);
else if (style==2) oldddir(gargv,gargc,&root);
else if (style==3) old3dir(gargv,gargc,&root);
else if (style==5) lsattr(gargv, gargc, &root);
else ls(gargv,gargc,&root,style==4,changetime,inode);
exit(0);
}

BIN
branches/dwg/LSource/src/cpmtools-2.13/cpmrm

Binary file not shown.

53
branches/dwg/LSource/src/cpmtools-2.13/cpmrm.1

@ -1,53 +0,0 @@
.TH CPMRM 1 "March 30, 2010" "CP/M tools" "User commands"
.SH NAME \"{{{roff}}}\"{{{
cpmrm \- remove files on CP/M disks
.\"}}}
.SH SYNOPSIS \"{{{
.ad l
.B cpmrm
.RB [ \-f
.IR format ]
.I image
.I file-pattern
\&...
.ad b
.\"}}}
.SH DESCRIPTION \"{{{
\fBcpmrm\fP removes files from CP/M disks.
.\"}}}
.SH OPTIONS \"{{{
.IP "\fB\-f\fP \fIformat\fP"
Use the given CP/M disk \fIformat\fP instead of the default format.
.\"}}}
.SH "RETURN VALUE" \"{{{
Upon successful completion, exit code 0 is returned.
.\"}}}
.SH ERRORS \"{{{
Any errors are indicated by exit code 1.
.\"}}}
.SH FILES \"{{{
${prefix}/share/diskdefs CP/M disk format definitions
.\"}}}
.SH AUTHORS \"{{{
This program is copyright 1997\(en2010 Michael Haardt
<michael@moria.de>. The Windows port is copyright 2000, 2001 John Elliott
<jce@seasip.demon.co.uk>.
.PP
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.
.PP
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.
.PP
You should have received a copy of the GNU General Public License along
with this program. If not, write to the Free Software Foundation, Inc.,
59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
.\"}}}
.SH "SEE ALSO" \"{{{
.IR cpmls (1),
.IR cpm (5)
.\"}}}

53
branches/dwg/LSource/src/cpmtools-2.13/cpmrm.1.in

@ -1,53 +0,0 @@
.TH CPMRM 1 "@UPDATED@" "CP/M tools" "User commands"
.SH NAME \"{{{roff}}}\"{{{
cpmrm \- remove files on CP/M disks
.\"}}}
.SH SYNOPSIS \"{{{
.ad l
.B cpmrm
.RB [ \-f
.IR format ]
.I image
.I file-pattern
\&...
.ad b
.\"}}}
.SH DESCRIPTION \"{{{
\fBcpmrm\fP removes files from CP/M disks.
.\"}}}
.SH OPTIONS \"{{{
.IP "\fB\-f\fP \fIformat\fP"
Use the given CP/M disk \fIformat\fP instead of the default format.
.\"}}}
.SH "RETURN VALUE" \"{{{
Upon successful completion, exit code 0 is returned.
.\"}}}
.SH ERRORS \"{{{
Any errors are indicated by exit code 1.
.\"}}}
.SH FILES \"{{{
@DATADIR@/diskdefs CP/M disk format definitions
.\"}}}
.SH AUTHORS \"{{{
This program is copyright 1997\(en2010 Michael Haardt
<michael@moria.de>. The Windows port is copyright 2000, 2001 John Elliott
<jce@seasip.demon.co.uk>.
.PP
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.
.PP
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.
.PP
You should have received a copy of the GNU General Public License along
with this program. If not, write to the Free Software Foundation, Inc.,
59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
.\"}}}
.SH "SEE ALSO" \"{{{
.IR cpmls (1),
.IR cpm (5)
.\"}}}

72
branches/dwg/LSource/src/cpmtools-2.13/cpmrm.c

@ -1,72 +0,0 @@
/* #includes */ /*{{{C}}}*//*{{{*/
#include "config.h"
#include <ctype.h>
#include <errno.h>
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include "getopt_.h"
#include "cpmfs.h"
#ifdef USE_DMALLOC
#include <dmalloc.h>
#endif
/*}}}*/
const char cmd[]="cpmrm";
int main(int argc, char *argv[]) /*{{{*/
{
/* variables */ /*{{{*/
const char *err;
const char *image;
const char *format=FORMAT;
const char *devopts=NULL;
int c,i,usage=0,exitcode=0;
struct cpmSuperBlock drive;
struct cpmInode root;
int gargc;
char **gargv;
/*}}}*/
/* parse options */ /*{{{*/
while ((c=getopt(argc,argv,"T:f:h?"))!=EOF) switch(c)
{
case 'T': devopts=optarg; break;
case 'f': format=optarg; break;
case 'h':
case '?': usage=1; break;
}
if (optind>=(argc-1)) usage=1;
else image=argv[optind++];
if (usage)
{
fprintf(stderr,"Usage: %s [-f format] [-T dsktype] image pattern ...\n",cmd);
exit(1);
}
/*}}}*/
/* open image */ /*{{{*/
if ((err=Device_open(&drive.dev, image, O_RDWR, devopts)))
{
fprintf(stderr,"%s: can not open %s (%s)\n",cmd,image,err);
exit(1);
}
cpmReadSuper(&drive,&root,format);
/*}}}*/
cpmglob(optind,argc,argv,&root,&gargc,&gargv);
for (i=0; i<gargc; ++i)
{
if (cpmUnlink(&root,gargv[i])==-1)
{
fprintf(stderr,"%s: can not erase %s: %s\n",cmd,gargv[i],boo);
exitcode=1;
}
}
cpmUmount(&drive);
exit(exitcode);
}
/*}}}*/

35
branches/dwg/LSource/src/cpmtools-2.13/device.h

@ -1,35 +0,0 @@
#ifndef DEVICE_H
#define DEVICE_H
#ifdef _WIN32
/* The type of device the file system is on: */
#define CPMDRV_FILE 0 /* Regular file or Unix block device */
#define CPMDRV_WIN95 1 /* Windows 95 floppy drive accessed via VWIN32 */
#define CPMDRV_WINNT 2 /* Windows NT floppy drive accessed via CreateFile */
#endif
struct Device
{
int opened;
int secLength;
int tracks;
int sectrk;
#if HAVE_LIBDSK_H
DSK_PDRIVER dev;
DSK_GEOMETRY geom;
#endif
#if HAVE_WINDOWS_H
int drvtype;
HANDLE hdisk;
#endif
int fd;
};
const char *Device_open(struct Device *self, const char *filename, int mode, const char *deviceOpts);
void Device_setGeometry(struct Device *self, int secLength, int sectrk, int tracks);
const char *Device_close(struct Device *self);
const char *Device_readSector(const struct Device *self, int track, int sector, char *buf);
const char *Device_writeSector(const struct Device *self, int track, int sector, const char *buf);
#endif

76
branches/dwg/LSource/src/cpmtools-2.13/device_libdsk.c

@ -1,76 +0,0 @@
/* #includes */ /*{{{C}}}*//*{{{*/
#include "config.h"
#include <assert.h>
#include <errno.h>
#include <stdlib.h>
#include <string.h>
#include "device.h"
#ifdef USE_DMALLOC
#include <dmalloc.h>
#endif
/*}}}*/
/* Device_open -- Open an image file */ /*{{{*/
const char *Device_open(struct Device *this, const char *filename, int mode, const char *deviceOpts)
{
dsk_err_t e = dsk_open(&this->dev, filename, deviceOpts, NULL);
this->opened = 0;
if (e) return dsk_strerror(e);
this->opened = 1;
dsk_getgeom(this->dev, &this->geom);
return NULL;
}
/*}}}*/
/* Device_setGeometry -- Set disk geometry */ /*{{{*/
void Device_setGeometry(struct Device *this, int secLength, int sectrk, int tracks)
{
this->secLength=secLength;
this->sectrk=sectrk;
this->tracks=tracks;
this->geom.dg_secsize = secLength;
this->geom.dg_sectors = sectrk;
/* Did the autoprobe guess right about the number of sectors & cylinders? */
if (this->geom.dg_cylinders * this->geom.dg_heads == tracks) return;
/* Otherwise we guess: <= 43 tracks: single-sided. Else double. This
* fails for 80-track single-sided if there are any such beasts */
if (tracks <= 43)
{
this->geom.dg_cylinders = tracks;
this->geom.dg_heads = 1;
}
else
{
this->geom.dg_cylinders = tracks/2;
this->geom.dg_heads = 2;
}
}
/*}}}*/
/* Device_close -- Close an image file */ /*{{{*/
const char *Device_close(struct Device *this)
{
dsk_err_t e;
this->opened=0;
e = dsk_close(&this->dev);
return (e?dsk_strerror(e):(const char*)0);
}
/*}}}*/
/* Device_readSector -- read a physical sector */ /*{{{*/
const char *Device_readSector(const struct Device *this, int track, int sector, char *buf)
{
dsk_err_t e;
e = dsk_lread(this->dev, &this->geom, buf, (track * this->sectrk) + sector);
return (e?dsk_strerror(e):(const char*)0);
}
/*}}}*/
/* Device_writeSector -- write physical sector */ /*{{{*/
const char *Device_writeSector(const struct Device *this, int track, int sector, const char *buf)
{
dsk_err_t e;
e = dsk_lwrite(this->dev, &this->geom, buf, (track * this->sectrk) + sector);
return (e?dsk_strerror(e):(const char*)0);
}
/*}}}*/

77
branches/dwg/LSource/src/cpmtools-2.13/device_posix.c

@ -1,77 +0,0 @@
/* #includes */ /*{{{C}}}*//*{{{*/
#include "config.h"
#include <assert.h>
#include <errno.h>
#include <stdlib.h>
#include <string.h>
#include "device.h"
#ifdef USE_DMALLOC
#include <dmalloc.h>
#endif
/*}}}*/
/* Device_open -- Open an image file */ /*{{{*/
const char *Device_open(struct Device *this, const char *filename, int mode, const char *deviceOpts)
{
this->fd=open(filename,mode);
this->opened=(this->fd==-1?0:1);
return ((this->fd==-1)?strerror(errno):(const char*)0);
}
/*}}}*/
/* Device_setGeometry -- Set disk geometry */ /*{{{*/
void Device_setGeometry(struct Device *this, int secLength, int sectrk, int tracks)
{
this->secLength=secLength;
this->sectrk=sectrk;
this->tracks=tracks;
}
/*}}}*/
/* Device_close -- Close an image file */ /*{{{*/
const char *Device_close(struct Device *this)
{
this->opened=0;
return ((close(this->fd)==-1)?strerror(errno):(const char*)0);
}
/*}}}*/
/* Device_readSector -- read a physical sector */ /*{{{*/
const char *Device_readSector(const struct Device *this, int track, int sector, char *buf)
{
int res;
assert(sector>=0);
assert(sector<this->sectrk);
assert(track>=0);
assert(track<this->tracks);
if (lseek(this->fd,(off_t)(sector+track*this->sectrk)*this->secLength,SEEK_SET)==-1)
{
return strerror(errno);
}
if ((res=read(this->fd, buf, this->secLength)) != this->secLength)
{
if (res==-1)
{
return strerror(errno);
}
else memset(buf+res,0,this->secLength-res); /* hit end of disk image */
}
return (const char*)0;
}
/*}}}*/
/* Device_writeSector -- write physical sector */ /*{{{*/
const char *Device_writeSector(const struct Device *this, int track, int sector, const char *buf)
{
assert(sector>=0);
assert(sector<this->sectrk);
assert(track>=0);
assert(track<this->tracks);
if (lseek(this->fd,(off_t)(sector+track*this->sectrk)*this->secLength, SEEK_SET)==-1)
{
return strerror(errno);
}
if (write(this->fd, buf, this->secLength) == this->secLength) return (const char*)0;
return strerror(errno);
}
/*}}}*/

658
branches/dwg/LSource/src/cpmtools-2.13/device_win32.c

@ -1,658 +0,0 @@
/* #includes */ /*{{{C}}}*//*{{{*/
#include "config.h"
#include <assert.h>
#include <errno.h>
#include <ctype.h>
#include <stdio.h>
#include "cpmdir.h"
#include "cpmfs.h"
#ifdef USE_DMALLOC
#include <dmalloc.h>
#endif
/*}}}*/
/* types */ /*{{{*/
#define PHYSICAL_SECTOR_1 1 /* First physical sector */
/* Use the INT13 interface rather than INT25/INT26. This appears to
* improve performance, but is less well tested. */
#define USE_INT13
/* Windows 95 disk I/O functions - based on Stan Mitchell's DISKDUMP.C */
#define VWIN32_DIOC_DOS_IOCTL 1 /* DOS ioctl calls 4400h-4411h */
#define VWIN32_DIOC_DOS_INT25 2 /* absolute disk read, DOS int 25h */
#define VWIN32_DIOC_DOS_INT26 3 /* absolute disk write, DOS int 26h */
#define VWIN32_DIOC_DOS_INT13 4 /* BIOS INT13 functions */
typedef struct _DIOC_REGISTERS {
DWORD reg_EBX;
DWORD reg_EDX;
DWORD reg_ECX;
DWORD reg_EAX;
DWORD reg_EDI;
DWORD reg_ESI;
DWORD reg_Flags;
}
DIOC_REGISTERS, *PDIOC_REGISTERS;
#define LEVEL0_LOCK 0
#define LEVEL1_LOCK 1
#define LEVEL2_LOCK 2
#define LEVEL3_LOCK 3
#define LEVEL1_LOCK_MAX_PERMISSION 0x0001
#define DRIVE_IS_REMOTE 0x1000
#define DRIVE_IS_SUBST 0x8000
/*********************************************************
**** Note: all MS-DOS data structures must be packed ****
**** on a one-byte boundary. ****
*********************************************************/
#pragma pack(1)
typedef struct _DISKIO {
DWORD diStartSector; /* sector number to start at */
WORD diSectors; /* number of sectors */
DWORD diBuffer; /* address of buffer */
}
DISKIO, *PDISKIO;
typedef struct MID {
WORD midInfoLevel; /* information level, must be 0 */
DWORD midSerialNum; /* serial number for the medium */
char midVolLabel[11]; /* volume label for the medium */
char midFileSysType[8]; /* type of file system as 8-byte ASCII */
}
MID, *PMID;
typedef struct driveparams { /* Disk geometry */
BYTE special;
BYTE devicetype;
WORD deviceattrs;
WORD cylinders;
BYTE mediatype;
/* BPB starts here */
WORD bytespersector;
BYTE sectorspercluster;
WORD reservedsectors;
BYTE numberofFATs;
WORD rootdirsize;
WORD totalsectors;
BYTE mediaid;
WORD sectorsperfat;
WORD sectorspertrack;
WORD heads;
DWORD hiddensectors;
DWORD bigtotalsectors;
BYTE reserved[6];
/* BPB ends here */
WORD sectorcount;
WORD sectortable[80];
} DRIVEPARAMS, *PDRIVEPARAMS;
/*}}}*/
static char *strwin32error(void) /*{{{*/
{
static char buffer[1024];
FormatMessage(FORMAT_MESSAGE_FROM_SYSTEM | FORMAT_MESSAGE_IGNORE_INSERTS,
NULL,
GetLastError(),
MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT), /* Default language */
(LPTSTR)buffer,
1023, NULL);
return buffer;
}
/*}}}*/
static BOOL LockVolume( HANDLE hDisk ) /*{{{*/
{
DWORD ReturnedByteCount;
return DeviceIoControl( hDisk, FSCTL_LOCK_VOLUME, NULL, 0, NULL,
0, &ReturnedByteCount, NULL );
}
/*}}}*/
static BOOL UnlockVolume( HANDLE hDisk ) /*{{{*/
{
DWORD ReturnedByteCount;
return DeviceIoControl( hDisk, FSCTL_UNLOCK_VOLUME, NULL, 0, NULL,
0, &ReturnedByteCount, NULL );
}
/*}}}*/
static BOOL DismountVolume( HANDLE hDisk ) /*{{{*/
{
DWORD ReturnedByteCount;
return DeviceIoControl( hDisk, FSCTL_DISMOUNT_VOLUME, NULL, 0, NULL,
0, &ReturnedByteCount, NULL );
}
/*}}}*/
static int GetDriveParams( HANDLE hVWin32Device, int volume, DRIVEPARAMS* pParam ) /*{{{*/
{
DIOC_REGISTERS reg;
BOOL bResult;
DWORD cb;
reg.reg_EAX = 0x440d; /* IOCTL for block device */
reg.reg_EBX = volume; /* one-based drive number */
reg.reg_ECX = 0x0860; /* Get Device params */
reg.reg_EDX = (DWORD)pParam;
reg.reg_Flags = 1; /* preset the carry flag */
bResult = DeviceIoControl( hVWin32Device, VWIN32_DIOC_DOS_IOCTL,
&reg, sizeof( reg ), &reg, sizeof( reg ), &cb, 0 );
if ( !bResult || (reg.reg_Flags & 1) )
return (reg.reg_EAX & 0xffff);
return 0;
}
/*}}}*/
static int SetDriveParams( HANDLE hVWin32Device, int volume, DRIVEPARAMS* pParam ) /*{{{*/
{
DIOC_REGISTERS reg;
BOOL bResult;
DWORD cb;
reg.reg_EAX = 0x440d; /* IOCTL for block device */
reg.reg_EBX = volume; /* one-based drive number */
reg.reg_ECX = 0x0840; /* Set Device params */
reg.reg_EDX = (DWORD)pParam;
reg.reg_Flags = 1; /* preset the carry flag */
bResult = DeviceIoControl( hVWin32Device, VWIN32_DIOC_DOS_IOCTL,
&reg, sizeof( reg ), &reg, sizeof( reg ), &cb, 0 );
if ( !bResult || (reg.reg_Flags & 1) )
return (reg.reg_EAX & 0xffff);
return 0;
}
/*}}}*/
static int GetMediaID( HANDLE hVWin32Device, int volume, MID* pMid ) /*{{{*/
{
DIOC_REGISTERS reg;
BOOL bResult;
DWORD cb;
reg.reg_EAX = 0x440d; /* IOCTL for block device */
reg.reg_EBX = volume; /* one-based drive number */
reg.reg_ECX = 0x0866; /* Get Media ID */
reg.reg_EDX = (DWORD)pMid;
reg.reg_Flags = 1; /* preset the carry flag */
bResult = DeviceIoControl( hVWin32Device, VWIN32_DIOC_DOS_IOCTL,
&reg, sizeof( reg ), &reg, sizeof( reg ), &cb, 0 );
if ( !bResult || (reg.reg_Flags & 1) )
return (reg.reg_EAX & 0xffff);
return 0;
}
/*}}}*/
static int VolumeCheck(HANDLE hVWin32Device, int volume, WORD* flags ) /*{{{*/
{
DIOC_REGISTERS reg;
BOOL bResult;
DWORD cb;
reg.reg_EAX = 0x4409; /* Is Drive Remote */
reg.reg_EBX = volume; /* one-based drive number */
reg.reg_Flags = 1; /* preset the carry flag */
bResult = DeviceIoControl( hVWin32Device, VWIN32_DIOC_DOS_IOCTL,
&reg, sizeof( reg ), &reg, sizeof( reg ), &cb, 0 );
if ( !bResult || (reg.reg_Flags & 1) )
return (reg.reg_EAX & 0xffff);
*flags = (WORD)(reg.reg_EDX & 0xffff);
return 0;
}
/*}}}*/
static int LockLogicalVolume(HANDLE hVWin32Device, int volume, int lock_level, int permissions) /*{{{*/
{
DIOC_REGISTERS reg;
BOOL bResult;
DWORD cb;
reg.reg_EAX = 0x440d; /* generic IOCTL */
reg.reg_ECX = 0x084a; /* lock logical volume */
reg.reg_EBX = volume | (lock_level << 8);
reg.reg_EDX = permissions;
reg.reg_Flags = 1; /* preset the carry flag */
bResult = DeviceIoControl( hVWin32Device, VWIN32_DIOC_DOS_IOCTL,
&reg, sizeof( reg ), &reg, sizeof( reg ), &cb, 0 );
if ( !bResult || (reg.reg_Flags & 1) )
return (reg.reg_EAX & 0xffff);
return 0;
}
/*}}}*/
static int UnlockLogicalVolume( HANDLE hVWin32Device, int volume ) /*{{{*/
{
DIOC_REGISTERS reg;
BOOL bResult;
DWORD cb;
reg.reg_EAX = 0x440d;
reg.reg_ECX = 0x086a; /* lock logical volume */
reg.reg_EBX = volume;
reg.reg_Flags = 1; /* preset the carry flag */
bResult = DeviceIoControl( hVWin32Device, VWIN32_DIOC_DOS_IOCTL,
&reg, sizeof( reg ), &reg, sizeof( reg ), &cb, 0 );
if ( !bResult || (reg.reg_Flags & 1) ) return -1;
return 0;
}
/*}}}*/
static int w32mode(int mode) /*{{{*/
{
switch(mode)
{
case O_RDONLY: return GENERIC_READ;
case O_WRONLY: return GENERIC_WRITE;
}
return GENERIC_READ | GENERIC_WRITE;
}
/*}}}*/
/* Device_open -- Open an image file */ /*{{{*/
const char *Device_open(struct Device *sb, const char *filename, int mode, const char *deviceOpts)
{
/* Windows 95/NT: floppy drives using handles */
if (strlen(filename) == 2 && filename[1] == ':') /* Drive name */
{
char vname[20];
DWORD dwVers;
sb->fd = -1;
dwVers = GetVersion();
if (dwVers & 0x80000000L) /* Win32s (3.1) or Win32c (Win95) */
{
int lock, driveno, res, permissions;
unsigned short drive_flags;
MID media;
vname[0] = toupper(filename[0]);
driveno = vname[0] - 'A' + 1; /* 1=A: 2=B: */
sb->drvtype = CPMDRV_WIN95;
sb->hdisk = CreateFile( "\\\\.\\vwin32",
0,
0,
NULL,
0,
FILE_FLAG_DELETE_ON_CLOSE,
NULL );
if (!sb->hdisk)
{
return "Failed to open VWIN32 driver.";
}
if (VolumeCheck(sb->hdisk, driveno, &drive_flags))
{
CloseHandle(sb->hdisk);
return "Invalid drive";
}
res = GetMediaID( sb->hdisk, driveno, &media );
if ( res )
{
const char *lboo = NULL;
if ( res == ERROR_INVALID_FUNCTION &&
(drive_flags & DRIVE_IS_REMOTE ))
lboo = "Network drive";
else if (res == ERROR_ACCESS_DENIED) lboo = "Access denied";
/* nb: It's perfectly legitimate for GetMediaID() to fail; most CP/M */
/* CP/M disks won't have a media ID. */
if (lboo != NULL)
{
CloseHandle(sb->hdisk);
return lboo;
}
}
if (!res &&
(!memcmp( media.midFileSysType, "CDROM", 5 ) ||
!memcmp( media.midFileSysType, "CD001", 5 ) ||
!memcmp( media.midFileSysType, "CDAUDIO", 5 )))
{
CloseHandle(sb->hdisk);
return "CD-ROM drive";
}
if (w32mode(mode) & GENERIC_WRITE)
{
lock = LEVEL0_LOCK; /* Exclusive access */
permissions = 0;
}
else
{
lock = LEVEL1_LOCK; /* Allow other processes access */
permissions = LEVEL1_LOCK_MAX_PERMISSION;
}
if (LockLogicalVolume( sb->hdisk, driveno, lock, permissions))
{
CloseHandle(sb->hdisk);
return "Could not acquire a lock on the drive.";
}
sb->fd = driveno; /* 1=A: 2=B: etc - we will need this later */
}
else
{
sprintf(vname, "\\\\.\\%s", filename);
sb->drvtype = CPMDRV_WINNT;
sb->hdisk = CreateFile(vname, /* Name */
w32mode(mode), /* Access mode */
FILE_SHARE_READ|FILE_SHARE_WRITE, /*Sharing*/
NULL, /* Security attributes */
OPEN_EXISTING, /* See MSDN */
0, /* Flags & attributes */
NULL); /* Template file */
if (sb->hdisk != INVALID_HANDLE_VALUE)
{
sb->fd = 1; /* Arbitrary value >0 */
if (LockVolume(sb->hdisk) == FALSE) /* Lock drive */
{
char *lboo = strwin32error();
CloseHandle(sb->hdisk);
sb->fd = -1;
return lboo;
}
}
else return strwin32error();
}
sb->opened = 1;
return NULL;
}
/* Not a floppy. Treat it as a normal file */
mode |= O_BINARY;
sb->fd = open(filename, mode);
if (sb->fd == -1) return strerror(errno);
sb->drvtype = CPMDRV_FILE;
sb->opened = 1;
return NULL;
}
/*}}}*/
/* Device_setGeometry -- Set disk geometry */ /*{{{*/
void Device_setGeometry(struct Device *this, int secLength, int sectrk, int tracks)
{
int n;
this->secLength=secLength;
this->sectrk=sectrk;
this->tracks=tracks;
if (this->drvtype == CPMDRV_WIN95)
{
DRIVEPARAMS drvp;
memset(&drvp, 0, sizeof(drvp));
if (GetDriveParams( this->hdisk, this->fd, &drvp )) return;
drvp.bytespersector = secLength;
drvp.sectorspertrack = sectrk;
drvp.totalsectors = sectrk * tracks;
/* Guess the cylinder/head configuration from the track count. This will
* get single-sided 80-track discs wrong, but it's that or double-sided
* 40-track (or add cylinder/head counts to diskdefs)
*/
if (tracks < 44)
{
drvp.cylinders = tracks;
drvp.heads = 1;
}
else
{
drvp.cylinders = tracks / 2;
drvp.heads = 2;
}
/* Set up "reasonable" values for the other members */
drvp.sectorspercluster = 1024 / secLength;
drvp.reservedsectors = 1;
drvp.numberofFATs = 2;
drvp.sectorcount = sectrk;
drvp.rootdirsize = 64;
drvp.mediaid = 0xF0;
drvp.hiddensectors = 0;
drvp.sectorsperfat = 3;
for (n = 0; n < sectrk; n++)
{
drvp.sectortable[n*2] = n + PHYSICAL_SECTOR_1; /* Physical sector numbers */
drvp.sectortable[n*2+1] = secLength;
}
drvp.special = 6;
/* We have not set:
drvp.mediatype
drvp.devicetype
drvp.deviceattrs
which should have been read correctly by GetDriveParams().
*/
SetDriveParams( this->hdisk, this->fd, &drvp );
}
}
/*}}}*/
/* Device_close -- Close an image file */ /*{{{*/
const char *Device_close(struct Device *sb)
{
sb->opened = 0;
switch(sb->drvtype)
{
case CPMDRV_WIN95:
UnlockLogicalVolume(sb->hdisk, sb->fd );
if (!CloseHandle( sb->hdisk )) return strwin32error();
return NULL;
case CPMDRV_WINNT:
DismountVolume(sb->hdisk);
UnlockVolume(sb->hdisk);
if (!CloseHandle(sb->hdisk)) return strwin32error();
return NULL;
}
if (close(sb->fd)) return strerror(errno);
return NULL;
}
/*}}}*/
/* Device_readSector -- read a physical sector */ /*{{{*/
const char *Device_readSector(const struct Device *drive, int track, int sector, char *buf)
{
int res;
off_t offset;
assert(sector>=0);
assert(sector<drive->sectrk);
assert(track>=0);
assert(track<drive->tracks);
offset = ((sector+track*drive->sectrk)*drive->secLength);
if (drive->drvtype == CPMDRV_WINNT)
{
LPVOID iobuffer;
DWORD bytesread;
if (SetFilePointer(drive->hdisk, offset, NULL, FILE_BEGIN) == INVALID_FILE_SIZE)
{
return strwin32error();
}
iobuffer = VirtualAlloc(NULL, drive->secLength, MEM_COMMIT, PAGE_READWRITE);
if (!iobuffer)
{
return strwin32error();
}
res = ReadFile(drive->hdisk, iobuffer, drive->secLength, &bytesread, NULL);
if (!res)
{
char *lboo = strwin32error();
VirtualFree(iobuffer, drive->secLength, MEM_RELEASE);
return lboo;
}
memcpy(buf, iobuffer, drive->secLength);
VirtualFree(iobuffer, drive->secLength, MEM_RELEASE);
if (bytesread < (unsigned)drive->secLength)
{
memset(buf + bytesread, 0, drive->secLength - bytesread);
}
return NULL;
}
if (drive->drvtype == CPMDRV_WIN95)
{
DIOC_REGISTERS reg;
BOOL bResult;
DWORD cb;
#ifdef USE_INT13
int cyl, head;
if (drive->tracks < 44) { cyl = track; head = 0; }
else { cyl = track/2; head = track & 1; }
reg.reg_EAX = 0x0201; /* Read 1 sector */
reg.reg_EBX = (DWORD)buf;
reg.reg_ECX = (cyl << 8) | (sector + PHYSICAL_SECTOR_1);
reg.reg_EDX = (head << 8) | (drive->fd - 1);
reg.reg_Flags = 1; /* preset the carry flag */
bResult = DeviceIoControl( drive->hdisk, VWIN32_DIOC_DOS_INT13,
&reg, sizeof( reg ), &reg, sizeof( reg ), &cb, 0 );
#else
DISKIO di;
reg.reg_EAX = drive->fd - 1; /* zero-based volume number */
reg.reg_EBX = (DWORD)&di;
reg.reg_ECX = 0xffff; /* use DISKIO structure */
reg.reg_Flags = 1; /* preset the carry flag */
di.diStartSector = sector+track*drive->sectrk;
di.diSectors = 1;
di.diBuffer = (DWORD)buf;
bResult = DeviceIoControl( drive->hdisk, VWIN32_DIOC_DOS_INT25,
&reg, sizeof( reg ), &reg, sizeof( reg ), &cb, 0 );
#endif
if ( !bResult || (reg.reg_Flags & 1) )
{
if (GetLastError()) return strwin32error();
return "Unknown read error.";
}
return 0;
}
if (lseek(drive->fd,offset,SEEK_SET)==-1)
{
return strerror(errno);
}
if ((res=read(drive->fd, buf, drive->secLength)) != drive->secLength)
{
if (res==-1)
{
return strerror(errno);
}
else memset(buf+res,0,drive->secLength-res); /* hit end of disk image */
}
return NULL;
}
/*}}}*/
/* Device_writeSector -- write physical sector */ /*{{{*/
const char *Device_writeSector(const struct Device *drive, int track, int sector, const char *buf)
{
off_t offset;
int res;
assert(sector>=0);
assert(sector<drive->sectrk);
assert(track>=0);
assert(track<drive->tracks);
offset = ((sector+track*drive->sectrk)*drive->secLength);
if (drive->drvtype == CPMDRV_WINNT)
{
LPVOID iobuffer;
DWORD byteswritten;
if (SetFilePointer(drive->hdisk, offset, NULL, FILE_BEGIN) == INVALID_FILE_SIZE)
{
return strwin32error();
}
iobuffer = VirtualAlloc(NULL, drive->secLength, MEM_COMMIT, PAGE_READWRITE);
if (!iobuffer)
{
return strwin32error();
}
memcpy(iobuffer, buf, drive->secLength);
res = WriteFile(drive->hdisk, iobuffer, drive->secLength, &byteswritten, NULL);
if (!res || (byteswritten < (unsigned)drive->secLength))
{
char *lboo = strwin32error();
VirtualFree(iobuffer, drive->secLength, MEM_RELEASE);
return lboo;
}
VirtualFree(iobuffer, drive->secLength, MEM_RELEASE);
return NULL;
}
if (drive->drvtype == CPMDRV_WIN95)
{
DIOC_REGISTERS reg;
BOOL bResult;
DWORD cb;
#ifdef USE_INT13
int cyl, head;
if (drive->tracks < 44) { cyl = track; head = 0; }
else { cyl = track/2; head = track & 1; }
reg.reg_EAX = 0x0301; /* Write 1 sector */
reg.reg_EBX = (DWORD)buf;
reg.reg_ECX = (cyl << 8) | (sector + PHYSICAL_SECTOR_1);
reg.reg_EDX = (head << 8) | (drive->fd - 1);
reg.reg_Flags = 1; /* preset the carry flag */
bResult = DeviceIoControl( drive->hdisk, VWIN32_DIOC_DOS_INT13,
&reg, sizeof( reg ), &reg, sizeof( reg ), &cb, 0 );
#else
DISKIO di;
reg.reg_EAX = drive->fd - 1; /* zero-based volume number */
reg.reg_EBX = (DWORD)&di;
reg.reg_ECX = 0xffff; /* use DISKIO structure */
reg.reg_Flags = 1; /* preset the carry flag */
di.diStartSector = sector+track*drive->sectrk;
di.diSectors = 1;
di.diBuffer = (DWORD)buf;
bResult = DeviceIoControl( drive->hdisk, VWIN32_DIOC_DOS_INT26,
&reg, sizeof( reg ), &reg, sizeof( reg ), &cb, 0 );
#endif
if ( !bResult || (reg.reg_Flags & 1) )
{
if (GetLastError()) return strwin32error();
return "Unknown write error.";
}
return NULL;
}
if (lseek(drive->fd,offset, SEEK_SET)==-1)
{
return strerror(errno);
}
if (write(drive->fd, buf, drive->secLength) == drive->secLength) return NULL;
return strerror(errno);
}
/*}}}*/

376
branches/dwg/LSource/src/cpmtools-2.13/diskdefs

@ -1,376 +0,0 @@
diskdef ibm-3740
seclen 128
tracks 77
sectrk 26
blocksize 1024
maxdir 64
skew 6
boottrk 2
os p2dos
end
diskdef 4mb-hd
seclen 128
tracks 1024
sectrk 32
blocksize 2048
maxdir 256
skew 1
boottrk 0
os p2dos
end
diskdef pcw
seclen 512
tracks 40
sectrk 9
blocksize 1024
maxdir 64
skew 1
boottrk 1
os 3
end
diskdef pc1.2m
seclen 512
tracks 80
# this format uses 15 sectors per track, but 30 per cylinder
sectrk 30
blocksize 4096
maxdir 256
skew 1
boottrk 0
os 3
end
# CP/M 86 on 1.44MB floppies
diskdef cpm86-144feat
seclen 512
tracks 160
sectrk 18
blocksize 4096
maxdir 256
skew 1
boottrk 2
os 3
end
diskdef cf2dd
seclen 512
tracks 160
sectrk 9
blocksize 2048
maxdir 256
skew 1
boottrk 1
os 3
end
#amstrad: values are read from super block (special name hardcoded)
# Royal alphatronic
# setfdprm /dev/fd1 dd ssize=256 cyl=40 sect=16 head=2
diskdef alpha
seclen 256
tracks 40
sectrk 32
blocksize 2048
maxdir 128
skew 1
boottrk 2
os 2.2
end
# Apple II CP/M skew o Apple II DOS 3.3 skew
diskdef apple-do
seclen 256
tracks 35
sectrk 16
blocksize 1024
maxdir 64
skewtab 0,6,12,3,9,15,14,5,11,2,8,7,13,4,10,1
boottrk 3
os 2.2
end
# Apple II CP/M skew o Apple II PRODOS skew
diskdef apple-po
seclen 256
tracks 35
sectrk 16
blocksize 1024
maxdir 64
skewtab 0,9,3,12,6,15,1,10,4,13,7,8,2,11,5,14
boottrk 3
os 2.2
end
# MYZ80 hard drive (only works with libdsk, because it has a 256-byte header)
diskdef myz80
seclen 1024
tracks 64
sectrk 128
blocksize 4096
maxdir 1024
skew 1
boottrk 0
os 3
end
# Despite being Amstrad formats, CPC System and CPC Data don't have an Amstrad
# superblock. You'll need to use libdsk to access them because the Linux
# and Windows kernel drivers won't touch them.
diskdef cpcsys
seclen 512
tracks 40
sectrk 9
blocksize 1024
maxdir 64
skew 1
boottrk 2
os 3
end
diskdef cpcdata
seclen 512
tracks 40
sectrk 9
blocksize 1024
maxdir 64
skew 1
boottrk 0
os 3
end
# after being read in with no sector skew.
diskdef nigdos
seclen 512
# NigDos double sided disk format, 42 tracks * 2 sides
tracks 84
sectrk 10
blocksize 2048
maxdir 128
skew 1
boottrk 0
# this format wastes half of the directory entry
logicalextents 1
os 3
end
diskdef epsqx10
seclen 512
tracks 40
sectrk 20
blocksize 2048
maxdir 128
skew 0
boottrk 2
os 2.2
end
diskdef ibm-8ss
seclen 512
tracks 40
sectrk 8
blocksize 1024
maxdir 64
skew 0
boottrk 1
os 2.2
end
diskdef ibm-8ds
seclen 512
tracks 40
sectrk 8
blocksize 1024
maxdir 64
skew 0
boottrk 1
os 2.2
end
diskdef electroglas
seclen 512
tracks 80
sectrk 10
blocksize 2048
maxdir 256
skew 0
boottrk 1
os 3
end
# IBM CP/M-86
# setfdprm /dev/fd1 sect=8 dtr=1 hd ssize=512 tpi=48 head=1
diskdef ibmpc-514ss
seclen 512
tracks 40
sectrk 8
blocksize 1024
maxdir 64
skew 1
boottrk 1
os 2.2
end
# IBM CP/M-86
# setfdprm /dev/fd1 sect=8 dtr=1 hd ssize=512 tpi=48
diskdef ibmpc-514ds
seclen 512
tracks 80
sectrk 8
blocksize 2048
maxdir 64
skew 0
boottrk 2
os 2.2
end
diskdef p112
seclen 512
tracks 160
sectrk 18
blocksize 2048
maxdir 256
skew 1
boottrk 2
os 3
end
diskdef p112-old
seclen 512
tracks 160
sectrk 18
blocksize 2048
maxdir 128
skew 1
boottrk 1
os 3
end
diskdef kpii
seclen 512
tracks 40
sectrk 10
blocksize 1024
maxdir 32
skew 0
boottrk 1
os 2.2
end
# setfdprm /dev/fd0 dd sect=10
diskdef interak
seclen 512
tracks 80
sectrk 20
blocksize 4096
maxdir 256
skew 1
boottrk 2
os 2.2
end
# Timex FDD3000 3"
diskdef fdd3000
seclen 256
tracks 40
sectrk 16
blocksize 1024
maxdir 128
boottrk 4
os 2.2
skew 7
end
# Timex FDD3000 3"
diskdef fdd3000_2
seclen 256
tracks 40
sectrk 16
blocksize 1024
maxdir 128
boottrk 2
os 2.2
skew 5
end
# Robotron 1715
diskdef 1715
seclen 1024
tracks 40
sectrk 5
blocksize 1024
maxdir 64
skew 0
boottrk 3
os 2.2
end
# Robotron 1715 with SCP3
diskdef 17153
seclen 1024
tracks 160
sectrk 5
blocksize 2048
maxdir 128
skew 0
boottrk 4
os 3
end
# Visual Technology Visual 1050 computer
diskdef v1050
seclen 512
tracks 80
sectrk 10
blocksize 2048
maxdir 128
skew 0
boottrk 2
os 3
end
# Microbee 40 track 5.25" disks
diskdef microbee40
seclen 512
tracks 80
sectrk 10
blocksize 2048
maxdir 128
skewtab 1,4,7,0,3,6,9,2,5,8
boottrk 2
os 2.2
end
diskdef dreamdisk40
seclen 512
tracks 80
sectrk 10
blocksize 2048
maxdir 128
skewtab 1,4,7,0,3,6,9,2,5,8
boottrk 2
os 2.2
end
diskdef dreamdisk80
seclen 512
tracks 160
sectrk 10
blocksize 2048
maxdir 256
skewtab 1,4,7,0,3,6,9,2,5,8
boottrk 2
os 2.2
end
diskdef rc759
seclen 1024
tracks 160
sectrk 8
blocksize 2048
maxdir 512
boottrk 4
os 3
end

BIN
branches/dwg/LSource/src/cpmtools-2.13/fsck.cpm

Binary file not shown.

74
branches/dwg/LSource/src/cpmtools-2.13/fsck.cpm.1

@ -1,74 +0,0 @@
.TH FSCK.CPM 1 "March 30, 2010" "CP/M tools" "User commands"
.SH NAME ..\"{{{roff}}}\"{{{
fsck.cpm \- check a CP/M file system
.\"}}}
.SH SYNOPSIS .\"{{{
.ad l
.B fsck.cpm
.RB [ \-f
.IR format ]
.RB [ \-n ]
.I image
.ad b
.\"}}}
.SH DESCRIPTION .\"{{{
\fBfsck.cpm\fP is used to check and repair a CP/M file system. After
reading the directory, it makes two passes. The first pass checks extent
fields for range and format violations (bad status, extent number, last
record byte count, file name, extension, block number, record count,
size of \&.COM files, time stamp format, invalid password characters,
invalid time stamp mode). The second pass checks extent connectivity
(multiple allocated blocks and duplicate directory entries).
.P
\fBfsck.cpm\fP can not yet repair all errors.
.\"}}}
.SH OPTIONS .\"{{{
.IP "\fB\-f\fP \fIformat\fP"
Use the given CP/M disk \fIformat\fP instead of the default format.
.IP "\fB\-n\fP"
Open the file system read-only and do not repair any errors.
.\"}}}
.SH "RETURN VALUE" .\"{{{
Upon successful completion, exit code 0 is returned.
.\"}}}
.SH ERRORS .\"{{{
Any errors are indicated by exit code 1.
.\"}}}
.SH FILES .\"{{{
${prefix}/share/diskdefs CP/M disk format definitions
.\"}}}
.SH DIAGNOSTICS .\"{{{
.IP "\fIimage\fP: \fIused\fP/\fItotal\fP files (\fIn\fP.\fIn\fP% non-contiguos), \fIused\fP/\fItotal\fP blocks"
No inconsistencies could be found. The number of used files actually
is the number of used extents. Since a file may use more than
one extent, this may be greather than the actual number of files, but a
correct measure would not reflect how many files could still be created
at most. A file is considered fragmented, if sequential data blocks
pointed to by the same extent do not have sequential block numbers.
The number of used blocks includes the blocks used for system tracks
and the directory.
.\"}}}
.SH AUTHORS .\"{{{
This program is copyright 1997\(en2010 Michael Haardt
<michael@moria.de>. The Windows port is copyright 2000, 2001 John Elliott
<jce@seasip.demon.co.uk>.
.PP
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.
.PP
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.
.PP
You should have received a copy of the GNU General Public License along
with this program. If not, write to the Free Software Foundation, Inc.,
59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
.\"}}}
.SH "SEE ALSO" .\"{{{
.IR fsck (8),
.IR mkfs.cpm (1),
.IR cpm (5)
.\"}}}

74
branches/dwg/LSource/src/cpmtools-2.13/fsck.cpm.1.in

@ -1,74 +0,0 @@
.TH FSCK.CPM 1 "@UPDATED@" "CP/M tools" "User commands"
.SH NAME ..\"{{{roff}}}\"{{{
fsck.cpm \- check a CP/M file system
.\"}}}
.SH SYNOPSIS .\"{{{
.ad l
.B fsck.cpm
.RB [ \-f
.IR format ]
.RB [ \-n ]
.I image
.ad b
.\"}}}
.SH DESCRIPTION .\"{{{
\fBfsck.cpm\fP is used to check and repair a CP/M file system. After
reading the directory, it makes two passes. The first pass checks extent
fields for range and format violations (bad status, extent number, last
record byte count, file name, extension, block number, record count,
size of \&.COM files, time stamp format, invalid password characters,
invalid time stamp mode). The second pass checks extent connectivity
(multiple allocated blocks and duplicate directory entries).
.P
\fBfsck.cpm\fP can not yet repair all errors.
.\"}}}
.SH OPTIONS .\"{{{
.IP "\fB\-f\fP \fIformat\fP"
Use the given CP/M disk \fIformat\fP instead of the default format.
.IP "\fB\-n\fP"
Open the file system read-only and do not repair any errors.
.\"}}}
.SH "RETURN VALUE" .\"{{{
Upon successful completion, exit code 0 is returned.
.\"}}}
.SH ERRORS .\"{{{
Any errors are indicated by exit code 1.
.\"}}}
.SH FILES .\"{{{
@DATADIR@/diskdefs CP/M disk format definitions
.\"}}}
.SH DIAGNOSTICS .\"{{{
.IP "\fIimage\fP: \fIused\fP/\fItotal\fP files (\fIn\fP.\fIn\fP% non-contiguos), \fIused\fP/\fItotal\fP blocks"
No inconsistencies could be found. The number of used files actually
is the number of used extents. Since a file may use more than
one extent, this may be greather than the actual number of files, but a
correct measure would not reflect how many files could still be created
at most. A file is considered fragmented, if sequential data blocks
pointed to by the same extent do not have sequential block numbers.
The number of used blocks includes the blocks used for system tracks
and the directory.
.\"}}}
.SH AUTHORS .\"{{{
This program is copyright 1997\(en2010 Michael Haardt
<michael@moria.de>. The Windows port is copyright 2000, 2001 John Elliott
<jce@seasip.demon.co.uk>.
.PP
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.
.PP
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.
.PP
You should have received a copy of the GNU General Public License along
with this program. If not, write to the Free Software Foundation, Inc.,
59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
.\"}}}
.SH "SEE ALSO" .\"{{{
.IR fsck (8),
.IR mkfs.cpm (1),
.IR cpm (5)
.\"}}}

627
branches/dwg/LSource/src/cpmtools-2.13/fsck.cpm.c

@ -1,627 +0,0 @@
/* #includes */ /*{{{C}}}*//*{{{*/
#include "config.h"
#include <assert.h>
#include <ctype.h>
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include <errno.h>
#include "getopt_.h"
#include "cpmdir.h"
#include "cpmfs.h"
#ifdef USE_DMALLOC
#include <dmalloc.h>
#endif
/*}}}*/
/* #defines */ /*{{{*/
/* your favourite password *:-) */
#define T0 'G'
#define T1 'E'
#define T2 'H'
#define T3 'E'
#define T4 'I'
#define T5 'M'
#define T6 ' '
#define T7 ' '
#define PB ((char)(T0+T1+T2+T3+T4+T5+T6+T7))
#define P0 ((char)(T7^PB))
#define P1 ((char)(T6^PB))
#define P2 ((char)(T5^PB))
#define P3 ((char)(T4^PB))
#define P4 ((char)(T3^PB))
#define P5 ((char)(T2^PB))
#define P6 ((char)(T1^PB))
#define P7 ((char)(T0^PB))
/*}}}*/
/* types */ /*{{{*/
enum Result { OK=0, MODIFIED=1, BROKEN=2 };
/*}}}*/
/* variables */ /*{{{*/
static int norepair=0;
/*}}}*/
/* bcdCheck -- check format and range of BCD digit */ /*{{{*/
static int bcdCheck(int n, int max, const char *msg, const char *unit, int extent1, int extent2)
{
if (((n>>4)&0xf)>10 || (n&0xf)>10 || (((n>>4)&0xf)*10+(n&0xf))>=max)
{
printf("Error: Bad %s %s (extent=%d/%d, %s=%02x)\n",msg,unit,extent1,extent2,unit,n&0xff);
return -1;
}
else return 0;
}
/*}}}*/
/* pwdCheck -- check password */ /*{{{*/
static int pwdCheck(int extent, const char *pwd, char decode)
{
char c;
int i;
for (i=0; i<8; ++i) if ((c=((char)(pwd[7-i]^decode)))<' ' || c&0x80)
{
printf("Error: non-printable character in password (extent=%d, password=",extent);
for (i=0; i<8; ++i)
{
c=pwd[7-i]^decode;
if (c<' ' || c&0x80)
{
putchar('\\'); putchar('0'+((c>>6)&0x01));
putchar('0'+((c>>3)&0x03));
putchar('0'+(c&0x03));
}
else putchar(c);
}
printf(")\n");
return -1;
}
return 0;
}
/*}}}*/
/* ask -- ask user and return answer */ /*{{{*/
static int ask(const char *msg)
{
while (1)
{
char buf[80];
if (norepair) return 0;
printf("%s [Y]? ",msg); fflush(stdout);
if (fgets(buf,sizeof(buf),stdin)==(char*)0) exit(1);
switch (toupper(buf[0]))
{
case '\n':
case 'Y': return 1;
case 'N': return 0;
}
}
}
/*}}}*/
/* prfile -- print file name */ /*{{{*/
static char *prfile(struct cpmSuperBlock *sb, int extent)
{
struct PhysDirectoryEntry *dir;
static char name[80];
char *s=name;
int i;
char c;
dir=sb->dir+extent;
for (i=0; i<8; ++i)
{
c=dir->name[i];
if ((c&0x7f)<' ')
{
*s++='\\'; *s++=('0'+((c>>6)&0x01));
*s++=('0'+((c>>3)&0x03));
*s++=('0'+(c&0x03));
}
else *s++=(c&0x7f);
}
*s++='.';
for (i=0; i<3; ++i)
{
c=dir->ext[i];
if ((c&0x7f)<' ')
{
*s++='\\'; *s++=('0'+((c>>6)&0x01));
*s++=('0'+((c>>3)&0x03));
*s++=('0'+(c&0x03));
}
else *s++=(c&0x7f);
}
*s='\0';
return name;
}
/*}}}*/
/* fsck -- file system check */ /*{{{*/
static int fsck(struct cpmInode *root, const char *image)
{
/* variables */ /*{{{*/
enum Result ret=OK;
int extent,extent2;
struct PhysDirectoryEntry *dir,*dir2;
struct cpmSuperBlock *sb=root->sb;
/*}}}*/
/* Phase 1: check extent fields */ /*{{{*/
printf("Phase 1: check extent fields\n");
for (extent=0; extent<sb->maxdir; ++extent)
{
char *status;
int usedBlocks=0;
dir=sb->dir+extent;
status=&dir->status;
if (*status>=0 && *status<=(sb->type==CPMFS_P2DOS ? 31 : 15)) /* directory entry */ /*{{{*/
{
/* check name and extension */ /*{{{*/
{
int i;
char *c;
for (i=0; i<8; ++i)
{
c=&(dir->name[i]);
if (!ISFILECHAR(i,*c&0x7f) || islower(*c&0x7f))
{
printf("Error: Bad name (extent=%d, name=\"%s\", position=%d)\n",extent,prfile(sb,extent),i);
if (ask("Remove file"))
{
*status=(char)0xE5;
ret|=MODIFIED;
break;
}
else ret|=BROKEN;
}
}
if (*status==(char)0xe5) continue;
for (i=0; i<3; ++i)
{
c=&(dir->ext[i]);
if (!ISFILECHAR(1,*c&0x7f) || islower(*c&0x7f))
{
printf("Error: Bad name (extent=%d, name=\"%s\", position=%d)\n",extent,prfile(sb,extent),i);
if (ask("Remove file"))
{
*status=(char)0xE5;
ret|=MODIFIED;
break;
}
else ret|=BROKEN;
}
}
if (*status==(char)0xe5) continue;
}
/*}}}*/
/* check extent number */ /*{{{*/
if ((dir->extnol&0xff)>0x1f)
{
printf("Error: Bad lower bits of extent number (extent=%d, name=\"%s\", low bits=%d)\n",extent,prfile(sb,extent),dir->extnol&0xff);
if (ask("Remove file"))
{
*status=(char)0xE5;
ret|=MODIFIED;
}
else ret|=BROKEN;
}
if (*status==(char)0xe5) continue;
if ((dir->extnoh&0xff)>0x3f)
{
printf("Error: Bad higher bits of extent number (extent=%d, name=\"%s\", high bits=%d)\n",extent,prfile(sb,extent),dir->extnoh&0xff);
if (ask("Remove file"))
{
*status=(char)0xE5;
ret|=MODIFIED;
}
else ret|=BROKEN;
}
if (*status==(char)0xe5) continue;
/*}}}*/
/* check last record byte count */ /*{{{*/
if ((dir->lrc&0xff)>128)
{
printf("Error: Bad last record byte count (extent=%d, name=\"%s\", lrc=%d)\n",extent,prfile(sb,extent),dir->lrc&0xff);
if (ask("Clear last record byte count"))
{
dir->lrc=(char)0;
ret|=MODIFIED;
}
else ret|=BROKEN;
}
if (*status==(char)0xe5) continue;
/*}}}*/
/* check block number range */ /*{{{*/
{
int block,min,max,i;
min=(sb->maxdir*32+sb->blksiz-1)/sb->blksiz;
max=sb->size;
for (i=0; i<16; ++i)
{
block=dir->pointers[i]&0xff;
if (sb->size>=256) block+=(dir->pointers[++i]&0xff)<<8;
if (block>0)
{
++usedBlocks;
if (block<min || block>max)
{
printf("Error: Bad block number (extent=%d, name=\"%s\", block=%d)\n",extent,prfile(sb,extent),block);
if (ask("Remove file"))
{
*status=(char)0xE5;
ret|=MODIFIED;
break;
}
else ret|=BROKEN;
}
}
}
if (*status==(char)0xe5) continue;
}
/*}}}*/
/* check number of used blocks ? */ /*{{{*/
/*}}}*/
/* check record count */ /*{{{*/
{
int i,min,max,recordsInBlocks,used=0;
min=(dir->extnol%sb->extents)*16/sb->extents;
max=((dir->extnol%sb->extents)+1)*16/sb->extents;
assert(min<max);
for (i=min; i<max; ++i)
{
/* [JCE] Rewritten because the previous implementation didn't work
* properly with Visual C++ */
if (dir->pointers[i] || (sb->size>=256 && dir->pointers[i+1])) ++used;
if (sb->size >= 256) ++i;
}
recordsInBlocks=(((unsigned char)dir->blkcnt)*128+sb->blksiz-1)/sb->blksiz;
if (recordsInBlocks!=used)
{
printf("Error: Bad record count (extent=%d, name=\"%s\", record count=%d)\n",extent,prfile(sb,extent),dir->blkcnt&0xff);
if (ask("Remove file"))
{
*status=(char)0xE5;
ret|=MODIFIED;
}
else ret|=BROKEN;
}
if (*status==(char)0xe5) continue;
}
/*}}}*/
/* check for too large .com files */ /*{{{*/
if (((EXTENT(dir->extnol,dir->extnoh)==3 && dir->blkcnt>=126) || EXTENT(dir->extnol,dir->extnoh)>=4) && (dir->ext[0]&0x7f)=='C' && (dir->ext[1]&0x7f)=='O' && (dir->ext[2]&0x7f)=='M')
{
printf("Warning: Oversized .COM file (extent=%d, name=\"%s\")\n",extent,prfile(sb,extent));
}
/*}}}*/
}
/*}}}*/
else if ((sb->type==CPMFS_P2DOS || sb->type==CPMFS_DR3) && *status==33) /* check time stamps ? */ /*{{{*/
{
unsigned long created,modified;
char s;
if ((s=sb->dir[extent2=(extent&~3)].status)>=0 && s<=(sb->type==CPMFS_P2DOS ? 31 : 15)) /* time stamps for first of the three extents */ /*{{{*/
{
bcdCheck(dir->name[2],24,sb->cnotatime ? "creation date" : "access date","hour",extent,extent2);
bcdCheck(dir->name[3],60,sb->cnotatime ? "creation date" : "access date","minute",extent,extent2);
bcdCheck(dir->name[6],24,"modification date","hour",extent,extent2);
bcdCheck(dir->name[7],60,"modification date","minute",extent,extent2);
created=(dir->name[4]+(dir->name[1]<<8))*(0x60*0x60)+dir->name[2]*0x60+dir->name[3];
modified=(dir->name[0]+(dir->name[5]<<8))*(0x60*0x60)+dir->name[6]*0x60+dir->name[7];
if (sb->cnotatime && modified<created)
{
printf("Warning: Modification date earlier than creation date (extent=%d/%d)\n",extent,extent2);
}
}
/*}}}*/
if ((s=sb->dir[extent2=(extent&~3)+1].status)>=0 && s<=(sb->type==CPMFS_P2DOS ? 31 : 15)) /* time stamps for second */ /*{{{*/
{
bcdCheck(dir->lrc,24,sb->cnotatime ? "creation date" : "access date","hour",extent,extent2);
bcdCheck(dir->extnoh,60,sb->cnotatime ? "creation date" : "access date","minute",extent,extent2);
bcdCheck(dir->pointers[1],24,"modification date","hour",extent,extent2);
bcdCheck(dir->pointers[2],60,"modification date","minute",extent,extent2);
created=(dir->ext[2]+(dir->extnol<<8))*(0x60*0x60)+dir->lrc*0x60+dir->extnoh;
modified=(dir->blkcnt+(dir->pointers[0]<<8))*(0x60*0x60)+dir->pointers[1]*0x60+dir->pointers[2];
if (sb->cnotatime && modified<created)
{
printf("Warning: Modification date earlier than creation date (extent=%d/%d)\n",extent,extent2);
}
}
/*}}}*/
if ((s=sb->dir[extent2=(extent&~3)+2].status)>=0 && s<=(sb->type==CPMFS_P2DOS ? 31 : 15)) /* time stamps for third */ /*{{{*/
{
bcdCheck(dir->pointers[7],24,sb->cnotatime ? "creation date" : "access date","hour",extent,extent2);
bcdCheck(dir->pointers[8],60,sb->cnotatime ? "creation date" : "access date","minute",extent,extent2);
bcdCheck(dir->pointers[11],24,"modification date","hour",extent,extent2);
bcdCheck(dir->pointers[12],60,"modification date","minute",extent,extent2);
created=(dir->pointers[5]+(dir->pointers[6]<<8))*(0x60*0x60)+dir->pointers[7]*0x60+dir->pointers[8];
modified=(dir->pointers[9]+(dir->pointers[10]<<8))*(0x60*0x60)+dir->pointers[11]*0x60+dir->pointers[12];
if (sb->cnotatime && modified<created)
{
printf("Warning: Modification date earlier than creation date (extent=%d/%d)\n",extent,extent2);
}
}
/*}}}*/
}
/*}}}*/
else if (sb->type==CPMFS_DR3 && *status==32) /* disc label */ /*{{{*/
{
unsigned long created,modified;
bcdCheck(dir->pointers[10],24,sb->cnotatime ? "creation date" : "access date","hour",extent,extent);
bcdCheck(dir->pointers[11],60,sb->cnotatime ? "creation date" : "access date","minute",extent,extent);
bcdCheck(dir->pointers[14],24,"modification date","hour",extent,extent);
bcdCheck(dir->pointers[15],60,"modification date","minute",extent,extent);
created=(dir->pointers[8]+(dir->pointers[9]<<8))*(0x60*0x60)+dir->pointers[10]*0x60+dir->pointers[11];
modified=(dir->pointers[12]+(dir->pointers[13]<<8))*(0x60*0x60)+dir->pointers[14]*0x60+dir->pointers[15];
if (sb->cnotatime && modified<created)
{
printf("Warning: Label modification date earlier than creation date (extent=%d)\n",extent);
}
if (dir->extnol&0x40 && dir->extnol&0x10)
{
printf("Error: Bit 4 and 6 can only be exclusively be set (extent=%d, label byte=0x%02x)\n",extent,(unsigned char)dir->extnol);
if (ask("Time stamp on creation"))
{
dir->extnol&=~0x40;
ret|=MODIFIED;
}
else if (ask("Time stamp on access"))
{
dir->extnol&=~0x10;
ret|=MODIFIED;
}
else ret|=BROKEN;
}
if (dir->extnol&0x80 && pwdCheck(extent,dir->pointers,dir->lrc))
{
char msg[80];
sprintf(msg,"Set password to %c%c%c%c%c%c%c%c",T0,T1,T2,T3,T4,T5,T6,T7);
if (ask(msg))
{
dir->pointers[0]=P0;
dir->pointers[1]=P1;
dir->pointers[2]=P2;
dir->pointers[3]=P3;
dir->pointers[4]=P4;
dir->pointers[5]=P5;
dir->pointers[6]=P6;
dir->pointers[7]=P7;
dir->lrc=PB;
ret|=MODIFIED;
}
else ret|=BROKEN;
}
}
/*}}}*/
else if (sb->type==CPMFS_DR3 && *status>=16 && *status<=31) /* password */ /*{{{*/
{
/* check name and extension */ /*{{{*/
{
int i;
char *c;
for (i=0; i<8; ++i)
{
c=&(dir->name[i]);
if (!ISFILECHAR(i,*c&0x7f) || islower(*c&0x7f))
{
printf("Error: Bad name (extent=%d, name=\"%s\", position=%d)\n",extent,prfile(sb,extent),i);
if (ask("Clear password entry"))
{
*status=(char)0xE5;
ret|=MODIFIED;
break;
}
else ret|=BROKEN;
}
}
if (*status==(char)0xe5) continue;
for (i=0; i<3; ++i)
{
c=&(dir->ext[i]);
if (!ISFILECHAR(1,*c&0x7f) || islower(*c&0x7f))
{
printf("Error: Bad name (extent=%d, name=\"%s\", position=%d)\n",extent,prfile(sb,extent),i);
if (ask("Clear password entry"))
{
*status=(char)0xE5;
ret|=MODIFIED;
break;
}
else ret|=BROKEN;
}
}
if (*status==(char)0xe5) continue;
}
/*}}}*/
/* check password */ /*{{{*/
if (dir->extnol&(0x80|0x40|0x20) && pwdCheck(extent,dir->pointers,dir->lrc))
{
char msg[80];
sprintf(msg,"Set password to %c%c%c%c%c%c%c%c",T0,T1,T2,T3,T4,T5,T6,T7);
if (ask(msg))
{
dir->pointers[0]=P0;
dir->pointers[1]=P1;
dir->pointers[2]=P2;
dir->pointers[3]=P3;
dir->pointers[4]=P4;
dir->pointers[5]=P5;
dir->pointers[6]=P6;
dir->pointers[7]=P7;
dir->lrc=PB;
ret|=MODIFIED;
}
else ret|=BROKEN;
}
/*}}}*/
}
/*}}}*/
else if (*status!=(char)0xe5) /* bad status */ /*{{{*/
{
printf("Error: Bad status (extent=%d, name=\"%s\", status=0x%02x)\n",extent,prfile(sb,extent),*status&0xff);
if (ask("Clear entry"))
{
*status=(char)0xE5;
ret|=MODIFIED;
}
else ret|=BROKEN;
continue;
}
/*}}}*/
}
/*}}}*/
/* Phase 2: check extent connectivity */ /*{{{*/
printf("Phase 2: check extent connectivity\n");
/* check multiple allocated blocks */ /*{{{*/
for (extent=0; extent<sb->maxdir; ++extent) if ((dir=sb->dir+extent)->status>=0 && dir->status<=(sb->type==CPMFS_P2DOS ? 31 : 15))
{
int i,j,block,block2;
for (i=0; i<16; ++i)
{
block=dir->pointers[i]&0xff;
if (sb->size>=256) block+=(dir->pointers[++i]&0xff)<<8;
for (extent2=0; extent2<sb->maxdir; ++extent2) if ((dir2=sb->dir+extent2)->status>=0 && dir2->status<=(sb->type==CPMFS_P2DOS ? 31 : 15))
{
for (j=0; j<16; ++j)
{
block2=dir2->pointers[j]&0xff;
if (sb->size>=256) block2+=(dir2->pointers[++j]&0xff)<<8;
if (block!=0 && block2!=0 && block==block2 && !(extent==extent2 && i==j))
{
printf("Error: Multiple allocated block (extent=%d,%d, name=\"%s\"",extent,extent2,prfile(sb,extent));
printf(",\"%s\" block=%d)\n",prfile(sb,extent2),block);
ret|=BROKEN;
}
}
}
}
}
/*}}}*/
/* check multiple extents */ /*{{{*/
for (extent=0; extent<sb->maxdir; ++extent) if ((dir=sb->dir+extent)->status>=0 && dir->status<=(sb->type==CPMFS_P2DOS ? 31 : 15))
{
for (extent2=0; extent2<sb->maxdir; ++extent2) if ((dir2=sb->dir+extent2)->status>=0 && dir2->status<=(sb->type==CPMFS_P2DOS ? 31 : 15))
{
if (extent!=extent2 && EXTENT(dir->extnol,dir->extnoh)==EXTENT(dir2->extnol,dir2->extnoh) && dir->status==dir2->status)
{
int i;
for (i=0; i<8 && (dir->name[i]&0x7f)==(dir2->name[i]&0x7f); ++i);
if (i==8)
{
for (i=0; i<3 && (dir->ext[i]&0x7f)==(dir2->ext[i]&0x7f); ++i);
if (i==3)
{
printf("Error: Duplicate extent (extent=%d,%d)\n",extent,extent2);
ret|=BROKEN;
}
}
}
}
}
/*}}}*/
/*}}}*/
if (ret==0) /* print statistics */ /*{{{*/
{
struct cpmStatFS statfsbuf;
int fragmented=0,borders=0;
cpmStatFS(root,&statfsbuf);
for (extent=0; extent<sb->maxdir; ++extent) if ((dir=sb->dir+extent)->status>=0 && dir->status<=(sb->type==CPMFS_P2DOS ? 31 : 15))
{
int i,block,previous=-1;
for (i=0; i<16; ++i)
{
block=dir->pointers[i]&0xff;
if (sb->size>=256) block+=(dir->pointers[++i]&0xff)<<8;
if (previous!=-1)
{
if (block!=0 && block!=(previous+1)) ++fragmented;
++borders;
}
previous=block;
}
}
fragmented=(borders ? (1000*fragmented)/borders : 0);
printf("%s: %ld/%ld files (%d.%d%% non-contigous), %ld/%ld blocks\n",image,statfsbuf.f_files-statfsbuf.f_ffree,statfsbuf.f_files,fragmented/10,fragmented%10,statfsbuf.f_blocks-statfsbuf.f_bfree,statfsbuf.f_blocks);
}
/*}}}*/
return ret;
}
/*}}}*/
const char cmd[]="fsck.cpm";
/* main */ /*{{{*/
int main(int argc, char *argv[])
{
const char *err;
const char *image;
const char *format=FORMAT;
const char *devopts=NULL;
int c,usage=0;
struct cpmSuperBlock sb;
struct cpmInode root;
enum Result ret;
while ((c=getopt(argc,argv,"T:f:nh?"))!=EOF) switch(c)
{
case 'f': format=optarg; break;
case 'T': devopts=optarg; break;
case 'n': norepair=1; break;
case 'h':
case '?': usage=1; break;
}
if (optind!=(argc-1)) usage=1;
else image=argv[optind++];
if (usage)
{
fprintf(stderr,"Usage: %s [-f format] [-n] image\n",cmd);
exit(1);
}
if ((err=Device_open(&sb.dev, image, (norepair ? O_RDONLY : O_RDWR), devopts)))
{
if ((err=Device_open(&sb.dev, image,O_RDONLY, devopts)))
{
fprintf(stderr,"%s: can not open %s: %s\n",cmd,image,err);
exit(1);
}
else
{
fprintf(stderr,"%s: can not open %s for writing, no repair possible\n",cmd,image);
}
}
cpmReadSuper(&sb,&root,format);
ret=fsck(&root,image);
if (ret&MODIFIED)
{
if (cpmSync(&sb)==-1)
{
fprintf(stderr,"%s: write error on %s: %s\n",cmd,image,strerror(errno));
ret|=BROKEN;
}
fprintf(stderr,"%s: FILE SYSTEM ON %s MODIFIED",cmd,image);
if (ret&BROKEN) fprintf(stderr,", PLEASE CHECK AGAIN");
fprintf(stderr,"\n");
}
cpmUmount(&sb);
if (ret&BROKEN) return 2;
else return 0;
}
/*}}}*/

BIN
branches/dwg/LSource/src/cpmtools-2.13/fsed.cpm

Binary file not shown.

56
branches/dwg/LSource/src/cpmtools-2.13/fsed.cpm.1

@ -1,56 +0,0 @@
.TH FSED.CPM 1 "March 30, 2010" "CP/M tools" "User commands"
.SH NAME ..\"{{{roff}}}\"{{{
fsed.cpm \- edit a CP/M file system
.\"}}}
.SH SYNOPSIS .\"{{{
.ad l
.B fsed.cpm
.RB [ \-f
.IR format ]
.I image
.ad b
.\"}}}
.SH DESCRIPTION .\"{{{
\fBfsed.cpm\fP edits a CP/M file system on an image file or device.
It knows about the system, directory and data area, using sector skew on
the last two. Directory entries are decoded. The interactive usage is
self-explanatory.
.\"}}}
.SH OPTIONS .\"{{{
.IP "\fB\-f\fP \fIformat\fP"
Use the given CP/M disk \fIformat\fP instead of the default format.
.\"}}}
.SH "RETURN VALUE" .\"{{{
Upon successful completion, exit code 0 is returned.
.\"}}}
.SH ERRORS .\"{{{
Any errors are indicated by exit code 1.
.\"}}}
.SH FILES .\"{{{
${prefix}/share/diskdefs CP/M disk format definitions
.\"}}}
.SH AUTHORS \"{{{
This program is copyright 1997\(en2010 Michael Haardt
<michael@moria.de>. The Windows port is copyright 2000, 2001 John Elliott
<jce@seasip.demon.co.uk>.
.PP
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.
.PP
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.
.PP
You should have received a copy of the GNU General Public License along
with this program. If not, write to the Free Software Foundation, Inc.,
59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
.\"}}}
.SH "SEE ALSO" .\"{{{
.IR fsck.cpm (1),
.IR mkfs.cpm (1),
.IR cpmls (1),
.IR cpm (5)
.\"}}}

56
branches/dwg/LSource/src/cpmtools-2.13/fsed.cpm.1.in

@ -1,56 +0,0 @@
.TH FSED.CPM 1 "@UPDATED@" "CP/M tools" "User commands"
.SH NAME ..\"{{{roff}}}\"{{{
fsed.cpm \- edit a CP/M file system
.\"}}}
.SH SYNOPSIS .\"{{{
.ad l
.B fsed.cpm
.RB [ \-f
.IR format ]
.I image
.ad b
.\"}}}
.SH DESCRIPTION .\"{{{
\fBfsed.cpm\fP edits a CP/M file system on an image file or device.
It knows about the system, directory and data area, using sector skew on
the last two. Directory entries are decoded. The interactive usage is
self-explanatory.
.\"}}}
.SH OPTIONS .\"{{{
.IP "\fB\-f\fP \fIformat\fP"
Use the given CP/M disk \fIformat\fP instead of the default format.
.\"}}}
.SH "RETURN VALUE" .\"{{{
Upon successful completion, exit code 0 is returned.
.\"}}}
.SH ERRORS .\"{{{
Any errors are indicated by exit code 1.
.\"}}}
.SH FILES .\"{{{
@DATADIR@/diskdefs CP/M disk format definitions
.\"}}}
.SH AUTHORS \"{{{
This program is copyright 1997\(en2010 Michael Haardt
<michael@moria.de>. The Windows port is copyright 2000, 2001 John Elliott
<jce@seasip.demon.co.uk>.
.PP
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.
.PP
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.
.PP
You should have received a copy of the GNU General Public License along
with this program. If not, write to the Free Software Foundation, Inc.,
59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
.\"}}}
.SH "SEE ALSO" .\"{{{
.IR fsck.cpm (1),
.IR mkfs.cpm (1),
.IR cpmls (1),
.IR cpm (5)
.\"}}}

732
branches/dwg/LSource/src/cpmtools-2.13/fsed.cpm.c

@ -1,732 +0,0 @@
/* #includes */ /*{{{C}}}*//*{{{*/
#include "config.h"
#include <assert.h>
#include <ctype.h>
#include <curses.h>
#include <errno.h>
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include "cpmfs.h"
#ifdef USE_DMALLOC
#include <dmalloc.h>
#endif
/*}}}*/
extern char **environ;
static char *mapbuf;
static struct tm *cpmtime(char lday, char hday, char hour, char min) /*{{{*/
{
static struct tm tm;
unsigned long days=(lday&0xff)|((hday&0xff)<<8);
int d;
int md[12]={31,0,31,30,31,30,31,31,30,31,30,31};
tm.tm_sec=0;
tm.tm_min=((min>>4)&0xf)*10+(min&0xf);
tm.tm_hour=((hour>>4)&0xf)*10+(hour&0xf);
tm.tm_mon=0;
tm.tm_year=1978;
tm.tm_isdst=-1;
if (days) --days;
while (days>=(d=(((tm.tm_year%400)==0 || ((tm.tm_year%4)==0 && (tm.tm_year%100))) ? 366 : 365)))
{
days-=d;
++tm.tm_year;
}
md[1]=((tm.tm_year%400)==0 || ((tm.tm_year%4)==0 && (tm.tm_year%100))) ? 29 : 28;
while (days>=md[tm.tm_mon])
{
days-=md[tm.tm_mon];
++tm.tm_mon;
}
tm.tm_mday=days+1;
tm.tm_year-=1900;
return &tm;
}
/*}}}*/
static void info(struct cpmSuperBlock *sb, const char *format, const char *image) /*{{{*/
{
const char *msg;
clear();
msg="File system characteristics";
move(0,(COLS-strlen(msg))/2); printw(msg);
move(2,0); printw(" Image: %s",image);
move(3,0); printw(" Format: %s",format);
move(4,0); printw(" File system: ");
switch (sb->type)
{
case CPMFS_DR22: printw("CP/M 2.2"); break;
case CPMFS_P2DOS: printw("P2DOS 2.3"); break;
case CPMFS_DR3: printw("CP/M Plus"); break;
}
move(6,0); printw(" Sector length: %d",sb->secLength);
move(7,0); printw(" Number of tracks: %d",sb->tracks);
move(8,0); printw(" Sectors per track: %d",sb->sectrk);
move(10,0);printw(" Block size: %d",sb->blksiz);
move(11,0);printw("Number of directory entries: %d",sb->maxdir);
move(12,0);printw(" Logical sector skew: %d",sb->skew);
move(13,0);printw(" Number of system tracks: %d",sb->boottrk);
move(14,0);printw(" Logical extents per extent: %d",sb->extents);
move(15,0);printw(" Allocatable data blocks: %d",sb->size-(sb->maxdir*32+sb->blksiz-1)/sb->blksiz);
msg="Any key to continue";
move(23,(COLS-strlen(msg))/2); printw(msg);
getch();
}
/*}}}*/
static void map(struct cpmSuperBlock *sb) /*{{{*/
{
const char *msg;
char bmap[18*80];
int secmap,pos,sys,directory;
clear();
msg="Data map";
move(0,(COLS-strlen(msg))/2); printw(msg);
secmap=(sb->tracks*sb->sectrk+80*18-1)/(80*18);
memset(bmap,' ',sizeof(bmap));
sys=sb->boottrk*sb->sectrk;
memset(bmap,'S',sys/secmap);
directory=(sb->maxdir*32+sb->secLength-1)/sb->secLength;
memset(bmap+sys/secmap,'D',directory/secmap);
memset(bmap+(sys+directory)/secmap,'.',sb->sectrk*sb->tracks/secmap);
for (pos=0; pos<(sb->maxdir*32+sb->secLength-1)/sb->secLength; ++pos)
{
int entry;
Device_readSector(&sb->dev,sb->boottrk+pos/(sb->sectrk*sb->secLength),pos/sb->secLength,mapbuf);
for (entry=0; entry<sb->secLength/32 && (pos*sb->secLength/32)+entry<sb->maxdir; ++entry)
{
int i;
if (mapbuf[entry*32]>=0 && mapbuf[entry*32]<=(sb->type==CPMFS_P2DOS ? 31 : 15))
{
for (i=0; i<16; ++i)
{
unsigned int sector;
sector=mapbuf[entry*32+16+i]&0xff;
if (sb->size>=256) sector|=(((mapbuf[entry*32+16+ ++i]&0xff)<<8));
if (sector>0 && sector<=sb->size)
{
/* not entirely correct without the last extent record count */
sector=sector*(sb->blksiz/sb->secLength)+sb->sectrk*sb->boottrk;
memset(bmap+sector/secmap,'#',sb->blksiz/(sb->secLength*secmap));
}
}
}
}
}
for (pos=0; pos<sizeof(bmap); ++pos)
{
move(2+pos%18,pos/18);
addch(bmap[pos]);
}
move(21,0); printw("S=System area D=Directory area #=File data .=Free");
msg="Any key to continue";
move(23,(COLS-strlen(msg))/2); printw(msg);
getch();
}
/*}}}*/
static void data(struct cpmSuperBlock *sb, const char *buf, unsigned long int pos) /*{{{*/
{
int offset=(pos%sb->secLength)&~0x7f;
int i;
for (i=0; i<128; ++i)
{
move(4+(i>>4),(i&0x0f)*3+!!(i&0x8)); printw("%02x",buf[i+offset]&0xff);
if (pos%sb->secLength==i+offset) attron(A_REVERSE);
move(4+(i>>4),50+(i&0x0f)); printw("%c",isprint(buf[i+offset]) ? buf[i+offset] : '.');
attroff(A_REVERSE);
}
move(4+((pos&0x7f)>>4),((pos&0x7f)&0x0f)*3+!!((pos&0x7f)&0x8)+1);
}
/*}}}*/
const char cmd[]="fsed.cpm";
int main(int argc, char *argv[]) /*{{{*/
{
/* variables */ /*{{{*/
const char *devopts=(const char*)0;
char *image;
const char *err;
struct cpmSuperBlock drive;
struct cpmInode root;
const char *format=FORMAT;
int c,usage=0;
unsigned long pos;
chtype ch;
int reload;
char *buf;
/*}}}*/
/* parse options */ /*{{{*/
while ((c=getopt(argc,argv,"T:f:h?"))!=EOF) switch(c)
{
case 'f': format=optarg; break;
case 'T': devopts=optarg; break;
case 'h':
case '?': usage=1; break;
}
if (optind!=(argc-1)) usage=1;
else image=argv[optind++];
if (usage)
{
fprintf(stderr,"Usage: fsed.cpm [-f format] image\n");
exit(1);
}
/*}}}*/
/* open image */ /*{{{*/
if ((err=Device_open(&drive.dev,image,O_RDONLY,devopts)))
{
fprintf(stderr,"%s: can not open %s (%s)\n",cmd,image,err);
exit(1);
}
cpmReadSuper(&drive,&root,format);
/*}}}*/
/* alloc sector buffers */ /*{{{*/
if ((buf=malloc(drive.secLength))==(char*)0 || (mapbuf=malloc(drive.secLength))==(char*)0)
{
fprintf(stderr,"fsed.cpm: can not allocate sector buffer (%s).\n",strerror(errno));
exit(1);
}
/*}}}*/
/* init curses */ /*{{{*/
initscr();
noecho();
raw();
nonl();
idlok(stdscr,TRUE);
idcok(stdscr,TRUE);
keypad(stdscr,TRUE);
clear();
/*}}}*/
pos=0;
reload=1;
do
{
/* display position and load data */ /*{{{*/
clear();
move(2,0); printw("Byte %8lu (0x%08lx) ",pos,pos);
if (pos<(drive.boottrk*drive.sectrk*drive.secLength))
{
printw("Physical sector %3lu ",((pos/drive.secLength)%drive.sectrk)+1);
}
else
{
printw("Sector %3lu ",((pos/drive.secLength)%drive.sectrk)+1);
printw("(physical %3d) ",drive.skewtab[(pos/drive.secLength)%drive.sectrk]+1);
}
printw("Offset %5lu ",pos%drive.secLength);
printw("Track %5lu",pos/(drive.secLength*drive.sectrk));
move(LINES-3,0); printw("N)ext track P)revious track");
move(LINES-2,0); printw("n)ext record p)revious record f)orward byte b)ackward byte");
move(LINES-1,0); printw("i)nfo q)uit");
if (reload)
{
if (pos<(drive.boottrk*drive.sectrk*drive.secLength))
{
err=Device_readSector(&drive.dev,pos/(drive.secLength*drive.sectrk),(pos/drive.secLength)%drive.sectrk,buf);
}
else
{
err=Device_readSector(&drive.dev,pos/(drive.secLength*drive.sectrk),drive.skewtab[(pos/drive.secLength)%drive.sectrk],buf);
}
if (err)
{
move(4,0); printw("Data can not be read: %s",err);
}
else reload=0;
}
/*}}}*/
if /* position before end of system area */ /*{{{*/
(pos<(drive.boottrk*drive.sectrk*drive.secLength))
{
const char *msg;
msg="System area"; move(0,(COLS-strlen(msg))/2); printw(msg);
move(LINES-3,36); printw("F)orward 16 byte B)ackward 16 byte");
if (!reload) data(&drive,buf,pos);
switch (ch=getch())
{
case 'F': /* next 16 byte */ /*{{{*/
{
if (pos+16<(drive.sectrk*drive.tracks*(unsigned long)drive.secLength))
{
if (pos/drive.secLength!=(pos+16)/drive.secLength) reload=1;
pos+=16;
}
break;
}
/*}}}*/
case 'B': /* previous 16 byte */ /*{{{*/
{
if (pos>=16)
{
if (pos/drive.secLength!=(pos-16)/drive.secLength) reload=1;
pos-=16;
}
break;
}
/*}}}*/
}
}
/*}}}*/
else if /* position before end of directory area */ /*{{{*/
(pos<(drive.boottrk*drive.sectrk*drive.secLength+drive.maxdir*32))
{
const char *msg;
unsigned long entrystart=(pos&~0x1f)%drive.secLength;
int entry=(pos-(drive.boottrk*drive.sectrk*drive.secLength))>>5;
int offset=pos&0x1f;
msg="Directory area"; move(0,(COLS-strlen(msg))/2); printw(msg);
move(LINES-3,36); printw("F)orward entry B)ackward entry");
move(13,0); printw("Entry %3d: ",entry);
if /* free or used directory entry */ /*{{{*/
((buf[entrystart]>=0 && buf[entrystart]<=(drive.type==CPMFS_P2DOS ? 31 : 15)) || buf[entrystart]==(char)0xe5)
{
int i;
if (buf[entrystart]==(char)0xe5)
{
if (offset==0) attron(A_REVERSE);
printw("Free");
attroff(A_REVERSE);
}
else printw("Directory entry");
move(15,0);
if (buf[entrystart]!=(char)0xe5)
{
printw("User: ");
if (offset==0) attron(A_REVERSE);
printw("%2d",buf[entrystart]);
attroff(A_REVERSE);
printw(" ");
}
printw("Name: ");
for (i=0; i<8; ++i)
{
if (offset==1+i) attron(A_REVERSE);
printw("%c",buf[entrystart+1+i]&0x7f);
attroff(A_REVERSE);
}
printw(" Extension: ");
for (i=0; i<3; ++i)
{
if (offset==9+i) attron(A_REVERSE);
printw("%c",buf[entrystart+9+i]&0x7f);
attroff(A_REVERSE);
}
move(16,0); printw("Extent: %3d",((buf[entrystart+12]&0xff)+((buf[entrystart+14]&0xff)<<5))/drive.extents);
printw(" (low: ");
if (offset==12) attron(A_REVERSE);
printw("%2d",buf[entrystart+12]&0xff);
attroff(A_REVERSE);
printw(", high: ");
if (offset==14) attron(A_REVERSE);
printw("%2d",buf[entrystart+14]&0xff);
attroff(A_REVERSE);
printw(")");
move(17,0); printw("Last extent record count: ");
if (offset==15) attron(A_REVERSE);
printw("%3d",buf[entrystart+15]&0xff);
attroff(A_REVERSE);
move(18,0); printw("Last record byte count: ");
if (offset==13) attron(A_REVERSE);
printw("%3d",buf[entrystart+13]&0xff);
attroff(A_REVERSE);
move(19,0); printw("Data blocks:");
for (i=0; i<16; ++i)
{
unsigned int block=buf[entrystart+16+i]&0xff;
if (drive.size>=256)
{
printw(" ");
if (offset==16+i || offset==16+i+1) attron(A_REVERSE);
printw("%5d",block|(((buf[entrystart+16+ ++i]&0xff)<<8)));
attroff(A_REVERSE);
}
else
{
printw(" ");
if (offset==16+i) attron(A_REVERSE);
printw("%3d",block);
attroff(A_REVERSE);
}
}
}
/*}}}*/
else if /* disc label */ /*{{{*/
(buf[entrystart]==0x20 && drive.type==CPMFS_DR3)
{
int i;
const struct tm *tm;
char s[30];
if (offset==0) attron(A_REVERSE);
printw("Disc label");
attroff(A_REVERSE);
move(15,0);
printw("Label: ");
for (i=0; i<11; ++i)
{
if (i+1==offset) attron(A_REVERSE);
printw("%c",buf[entrystart+1+i]&0x7f);
attroff(A_REVERSE);
}
move(16,0);
printw("Bit 0,7: ");
if (offset==12) attron(A_REVERSE);
printw("Label %s",buf[entrystart+12]&1 ? "set" : "not set");
printw(", password protection %s",buf[entrystart+12]&0x80 ? "set" : "not set");
attroff(A_REVERSE);
move(17,0);
printw("Bit 4,5,6: ");
if (offset==12) attron(A_REVERSE);
printw("Time stamp ");
if (buf[entrystart+12]&0x10) printw("on create, ");
else printw("not on create, ");
if (buf[entrystart+12]&0x20) printw("on modification, ");
else printw("not on modifiction, ");
if (buf[entrystart+12]&0x40) printw("on access");
else printw("not on access");
attroff(A_REVERSE);
move(18,0);
printw("Password: ");
for (i=0; i<8; ++i)
{
char printable;
if (offset==16+(7-i)) attron(A_REVERSE);
printable=(buf[entrystart+16+(7-i)]^buf[entrystart+13])&0x7f;
printw("%c",isprint(printable) ? printable : ' ');
attroff(A_REVERSE);
}
printw(" XOR value: ");
if (offset==13) attron(A_REVERSE);
printw("0x%02x",buf[entrystart+13]&0xff);
attroff(A_REVERSE);
move(19,0);
printw("Created: ");
tm=cpmtime(buf[entrystart+24],buf[entrystart+25],buf[entrystart+26],buf[entrystart+27]);
if (offset==24 || offset==25) attron(A_REVERSE);
strftime(s,sizeof(s),"%x",tm);
printw("%s",s);
attroff(A_REVERSE);
printw(" ");
if (offset==26) attron(A_REVERSE);
printw("%2d",tm->tm_hour);
attroff(A_REVERSE);
printw(":");
if (offset==27) attron(A_REVERSE);
printw("%02d",tm->tm_min);
attroff(A_REVERSE);
printw(" Updated: ");
tm=cpmtime(buf[entrystart+28],buf[entrystart+29],buf[entrystart+30],buf[entrystart+31]);
if (offset==28 || offset==29) attron(A_REVERSE);
strftime(s,sizeof(s),"%x",tm);
printw("%s",s);
attroff(A_REVERSE);
printw(" ");
if (offset==30) attron(A_REVERSE);
printw("%2d",tm->tm_hour);
attroff(A_REVERSE);
printw(":");
if (offset==31) attron(A_REVERSE);
printw("%02d",tm->tm_min);
attroff(A_REVERSE);
}
/*}}}*/
else if /* time stamp */ /*{{{*/
(buf[entrystart]==0x21 && (drive.type==CPMFS_P2DOS || drive.type==CPMFS_DR3))
{
const struct tm *tm;
char s[30];
if (offset==0) attron(A_REVERSE);
printw("Time stamps");
attroff(A_REVERSE);
move(15,0);
printw("3rd last extent: Created/Accessed ");
tm=cpmtime(buf[entrystart+1],buf[entrystart+2],buf[entrystart+3],buf[entrystart+4]);
if (offset==1 || offset==2) attron(A_REVERSE);
strftime(s,sizeof(s),"%x",tm);
printw("%s",s);
attroff(A_REVERSE);
printw(" ");
if (offset==3) attron(A_REVERSE);
printw("%2d",tm->tm_hour);
attroff(A_REVERSE);
printw(":");
if (offset==4) attron(A_REVERSE);
printw("%02d",tm->tm_min);
attroff(A_REVERSE);
printw(" Modified ");
tm=cpmtime(buf[entrystart+5],buf[entrystart+6],buf[entrystart+7],buf[entrystart+8]);
if (offset==5 || offset==6) attron(A_REVERSE);
strftime(s,sizeof(s),"%x",tm);
printw("%s",s);
attroff(A_REVERSE);
printw(" ");
if (offset==7) attron(A_REVERSE);
printw("%2d",tm->tm_hour);
attroff(A_REVERSE);
printw(":");
if (offset==8) attron(A_REVERSE);
printw("%02d",tm->tm_min);
attroff(A_REVERSE);
move(16,0);
printw("2nd last extent: Created/Accessed ");
tm=cpmtime(buf[entrystart+11],buf[entrystart+12],buf[entrystart+13],buf[entrystart+14]);
if (offset==11 || offset==12) attron(A_REVERSE);
strftime(s,sizeof(s),"%x",tm);
printw("%s",s);
attroff(A_REVERSE);
printw(" ");
if (offset==13) attron(A_REVERSE);
printw("%2d",tm->tm_hour);
attroff(A_REVERSE);
printw(":");
if (offset==14) attron(A_REVERSE);
printw("%02d",tm->tm_min);
attroff(A_REVERSE);
printw(" Modified ");
tm=cpmtime(buf[entrystart+15],buf[entrystart+16],buf[entrystart+17],buf[entrystart+18]);
if (offset==15 || offset==16) attron(A_REVERSE);
strftime(s,sizeof(s),"%x",tm);
printw("%s",s);
attroff(A_REVERSE);
printw(" ");
if (offset==17) attron(A_REVERSE);
printw("%2d",tm->tm_hour);
attroff(A_REVERSE);
printw(":");
if (offset==18) attron(A_REVERSE);
printw("%02d",tm->tm_min);
attroff(A_REVERSE);
move(17,0);
printw(" Last extent: Created/Accessed ");
tm=cpmtime(buf[entrystart+21],buf[entrystart+22],buf[entrystart+23],buf[entrystart+24]);
if (offset==21 || offset==22) attron(A_REVERSE);
strftime(s,sizeof(s),"%x",tm);
printw("%s",s);
attroff(A_REVERSE);
printw(" ");
if (offset==23) attron(A_REVERSE);
printw("%2d",tm->tm_hour);
attroff(A_REVERSE);
printw(":");
if (offset==24) attron(A_REVERSE);
printw("%02d",tm->tm_min);
attroff(A_REVERSE);
printw(" Modified ");
tm=cpmtime(buf[entrystart+25],buf[entrystart+26],buf[entrystart+27],buf[entrystart+28]);
if (offset==25 || offset==26) attron(A_REVERSE);
strftime(s,sizeof(s),"%x",tm);
printw("%s",s);
attroff(A_REVERSE);
printw(" ");
if (offset==27) attron(A_REVERSE);
printw("%2d",tm->tm_hour);
attroff(A_REVERSE);
printw(":");
if (offset==28) attron(A_REVERSE);
printw("%02d",tm->tm_min);
attroff(A_REVERSE);
}
/*}}}*/
else if /* password */ /*{{{*/
(buf[entrystart]>=16 && buf[entrystart]<=31 && drive.type==CPMFS_DR3)
{
int i;
if (offset==0) attron(A_REVERSE);
printw("Password");
attroff(A_REVERSE);
move(15,0);
printw("Name: ");
for (i=0; i<8; ++i)
{
if (offset==1+i) attron(A_REVERSE);
printw("%c",buf[entrystart+1+i]&0x7f);
attroff(A_REVERSE);
}
printw(" Extension: ");
for (i=0; i<3; ++i)
{
if (offset==9+i) attron(A_REVERSE);
printw("%c",buf[entrystart+9+i]&0x7f);
attroff(A_REVERSE);
}
move(16,0);
printw("Password required for: ");
if (offset==12) attron(A_REVERSE);
if (buf[entrystart+12]&0x80) printw("Reading ");
if (buf[entrystart+12]&0x40) printw("Writing ");
if (buf[entrystart+12]&0x20) printw("Deleting ");
attroff(A_REVERSE);
move(17,0);
printw("Password: ");
for (i=0; i<8; ++i)
{
char printable;
if (offset==16+(7-i)) attron(A_REVERSE);
printable=(buf[entrystart+16+(7-i)]^buf[entrystart+13])&0x7f;
printw("%c",isprint(printable) ? printable : ' ');
attroff(A_REVERSE);
}
printw(" XOR value: ");
if (offset==13) attron(A_REVERSE);
printw("0x%02x",buf[entrystart+13]&0xff);
attroff(A_REVERSE);
}
/*}}}*/
else /* bad status */ /*{{{*/
{
printw("Bad status ");
if (offset==0) attron(A_REVERSE);
printw("0x%02x",buf[entrystart]);
attroff(A_REVERSE);
}
/*}}}*/
if (!reload) data(&drive,buf,pos);
switch (ch=getch())
{
case 'F': /* next entry */ /*{{{*/
{
if (pos+32<(drive.sectrk*drive.tracks*(unsigned long)drive.secLength))
{
if (pos/drive.secLength!=(pos+32)/drive.secLength) reload=1;
pos+=32;
}
break;
}
/*}}}*/
case 'B': /* previous entry */ /*{{{*/
{
if (pos>=32)
{
if (pos/drive.secLength!=(pos-32)/drive.secLength) reload=1;
pos-=32;
}
break;
}
/*}}}*/
}
}
/*}}}*/
else /* data area */ /*{{{*/
{
const char *msg;
msg="Data area"; move(0,(COLS-strlen(msg))/2); printw(msg);
if (!reload) data(&drive,buf,pos);
ch=getch();
}
/*}}}*/
/* process common commands */ /*{{{*/
switch (ch)
{
case 'n': /* next record */ /*{{{*/
{
if (pos+128<(drive.sectrk*drive.tracks*(unsigned long)drive.secLength))
{
if (pos/drive.secLength!=(pos+128)/drive.secLength) reload=1;
pos+=128;
}
break;
}
/*}}}*/
case 'p': /* previous record */ /*{{{*/
{
if (pos>=128)
{
if (pos/drive.secLength!=(pos-128)/drive.secLength) reload=1;
pos-=128;
}
break;
}
/*}}}*/
case 'N': /* next track */ /*{{{*/
{
if ((pos+drive.sectrk*drive.secLength)<(drive.sectrk*drive.tracks*drive.secLength))
{
pos+=drive.sectrk*drive.secLength;
reload=1;
}
break;
}
/*}}}*/
case 'P': /* previous track */ /*{{{*/
{
if (pos>=drive.sectrk*drive.secLength)
{
pos-=drive.sectrk*drive.secLength;
reload=1;
}
break;
}
/*}}}*/
case 'b': /* byte back */ /*{{{*/
{
if (pos)
{
if (pos/drive.secLength!=(pos-1)/drive.secLength) reload=1;
--pos;
}
break;
}
/*}}}*/
case 'f': /* byte forward */ /*{{{*/
{
if (pos+1<drive.tracks*drive.sectrk*drive.secLength)
{
if (pos/drive.secLength!=(pos+1)/drive.secLength) reload=1;
++pos;
}
break;
}
/*}}}*/
case 'i': info(&drive,format,image); break;
case 'm': map(&drive); break;
}
/*}}}*/
} while (ch!='q');
/* exit curses */ /*{{{*/
move(LINES-1,0);
refresh();
echo();
noraw();
endwin();
/*}}}*/
exit(0);
}
/*}}}*/

1195
branches/dwg/LSource/src/cpmtools-2.13/getopt.c

File diff suppressed because it is too large

171
branches/dwg/LSource/src/cpmtools-2.13/getopt1.c

@ -1,171 +0,0 @@
/* getopt_long and getopt_long_only entry points for GNU getopt.
Copyright (C) 1987,88,89,90,91,92,93,94,96,97,98,2004,2006
Free Software Foundation, Inc.
This file is part of the GNU C Library.
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 2, 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, write to the Free Software Foundation,
Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */
#ifdef _LIBC
# include <getopt.h>
#else
# include "config.h"
# include "getopt_.h"
#endif
#include "getopt_int.h"
#include <stdio.h>
/* This needs to come after some library #include
to get __GNU_LIBRARY__ defined. */
#ifdef __GNU_LIBRARY__
#include <stdlib.h>
#endif
#ifndef NULL
#define NULL 0
#endif
int
getopt_long (int argc, char *__getopt_argv_const *argv, const char *options,
const struct option *long_options, int *opt_index)
{
return _getopt_internal (argc, (char **) argv, options, long_options,
opt_index, 0, 0);
}
int
_getopt_long_r (int argc, char **argv, const char *options,
const struct option *long_options, int *opt_index,
struct _getopt_data *d)
{
return _getopt_internal_r (argc, argv, options, long_options, opt_index,
0, 0, d);
}
/* Like getopt_long, but '-' as well as '--' can indicate a long option.
If an option that starts with '-' (not '--') doesn't match a long option,
but does match a short option, it is parsed as a short option
instead. */
int
getopt_long_only (int argc, char *__getopt_argv_const *argv,
const char *options,
const struct option *long_options, int *opt_index)
{
return _getopt_internal (argc, (char **) argv, options, long_options,
opt_index, 1, 0);
}
int
_getopt_long_only_r (int argc, char **argv, const char *options,
const struct option *long_options, int *opt_index,
struct _getopt_data *d)
{
return _getopt_internal_r (argc, argv, options, long_options, opt_index,
1, 0, d);
}
#ifdef TEST
#include <stdio.h>
int
main (int argc, char **argv)
{
int c;
int digit_optind = 0;
while (1)
{
int this_option_optind = optind ? optind : 1;
int option_index = 0;
static struct option long_options[] =
{
{"add", 1, 0, 0},
{"append", 0, 0, 0},
{"delete", 1, 0, 0},
{"verbose", 0, 0, 0},
{"create", 0, 0, 0},
{"file", 1, 0, 0},
{0, 0, 0, 0}
};
c = getopt_long (argc, argv, "abc:d:0123456789",
long_options, &option_index);
if (c == -1)
break;
switch (c)
{
case 0:
printf ("option %s", long_options[option_index].name);
if (optarg)
printf (" with arg %s", optarg);
printf ("\n");
break;
case '0':
case '1':
case '2':
case '3':
case '4':
case '5':
case '6':
case '7':
case '8':
case '9':
if (digit_optind != 0 && digit_optind != this_option_optind)
printf ("digits occur in two different argv-elements.\n");
digit_optind = this_option_optind;
printf ("option %c\n", c);
break;
case 'a':
printf ("option a\n");
break;
case 'b':
printf ("option b\n");
break;
case 'c':
printf ("option c with value `%s'\n", optarg);
break;
case 'd':
printf ("option d with value `%s'\n", optarg);
break;
case '?':
break;
default:
printf ("?? getopt returned character code 0%o ??\n", c);
}
}
if (optind < argc)
{
printf ("non-option ARGV-elements: ");
while (optind < argc)
printf ("%s ", argv[optind++]);
printf ("\n");
}
exit (0);
}
#endif /* TEST */

226
branches/dwg/LSource/src/cpmtools-2.13/getopt_.h

@ -1,226 +0,0 @@
/* Declarations for getopt.
Copyright (C) 1989-1994,1996-1999,2001,2003,2004,2005,2006,2007
Free Software Foundation, Inc.
This file is part of the GNU C Library.
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 2, 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, write to the Free Software Foundation,
Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */
#ifndef _GETOPT_H
#ifndef __need_getopt
# define _GETOPT_H 1
#endif
/* Standalone applications should #define __GETOPT_PREFIX to an
identifier that prefixes the external functions and variables
defined in this header. When this happens, include the
headers that might declare getopt so that they will not cause
confusion if included after this file. Then systematically rename
identifiers so that they do not collide with the system functions
and variables. Renaming avoids problems with some compilers and
linkers. */
#if defined __GETOPT_PREFIX && !defined __need_getopt
# include <stdlib.h>
# include <stdio.h>
# include <unistd.h>
# undef __need_getopt
# undef getopt
# undef getopt_long
# undef getopt_long_only
# undef optarg
# undef opterr
# undef optind
# undef optopt
# define __GETOPT_CONCAT(x, y) x ## y
# define __GETOPT_XCONCAT(x, y) __GETOPT_CONCAT (x, y)
# define __GETOPT_ID(y) __GETOPT_XCONCAT (__GETOPT_PREFIX, y)
# define getopt __GETOPT_ID (getopt)
# define getopt_long __GETOPT_ID (getopt_long)
# define getopt_long_only __GETOPT_ID (getopt_long_only)
# define optarg __GETOPT_ID (optarg)
# define opterr __GETOPT_ID (opterr)
# define optind __GETOPT_ID (optind)
# define optopt __GETOPT_ID (optopt)
#endif
/* Standalone applications get correct prototypes for getopt_long and
getopt_long_only; they declare "char **argv". libc uses prototypes
with "char *const *argv" that are incorrect because getopt_long and
getopt_long_only can permute argv; this is required for backward
compatibility (e.g., for LSB 2.0.1).
This used to be `#if defined __GETOPT_PREFIX && !defined __need_getopt',
but it caused redefinition warnings if both unistd.h and getopt.h were
included, since unistd.h includes getopt.h having previously defined
__need_getopt.
The only place where __getopt_argv_const is used is in definitions
of getopt_long and getopt_long_only below, but these are visible
only if __need_getopt is not defined, so it is quite safe to rewrite
the conditional as follows:
*/
#if !defined __need_getopt
# if defined __GETOPT_PREFIX
# define __getopt_argv_const /* empty */
# else
# define __getopt_argv_const const
# endif
#endif
/* If __GNU_LIBRARY__ is not already defined, either we are being used
standalone, or this is the first header included in the source file.
If we are being used with glibc, we need to include <features.h>, but
that does not exist if we are standalone. So: if __GNU_LIBRARY__ is
not defined, include <ctype.h>, which will pull in <features.h> for us
if it's from glibc. (Why ctype.h? It's guaranteed to exist and it
doesn't flood the namespace with stuff the way some other headers do.) */
#if !defined __GNU_LIBRARY__
# include <ctype.h>
#endif
#ifndef __THROW
# ifndef __GNUC_PREREQ
# define __GNUC_PREREQ(maj, min) (0)
# endif
# if defined __cplusplus && __GNUC_PREREQ (2,8)
# define __THROW throw ()
# else
# define __THROW
# endif
#endif
#ifdef __cplusplus
extern "C" {
#endif
/* For communication from `getopt' to the caller.
When `getopt' finds an option that takes an argument,
the argument value is returned here.
Also, when `ordering' is RETURN_IN_ORDER,
each non-option ARGV-element is returned here. */
extern char *optarg;
/* Index in ARGV of the next element to be scanned.
This is used for communication to and from the caller
and for communication between successive calls to `getopt'.
On entry to `getopt', zero means this is the first call; initialize.
When `getopt' returns -1, this is the index of the first of the
non-option elements that the caller should itself scan.
Otherwise, `optind' communicates from one call to the next
how much of ARGV has been scanned so far. */
extern int optind;
/* Callers store zero here to inhibit the error message `getopt' prints
for unrecognized options. */
extern int opterr;
/* Set to an option character which was unrecognized. */
extern int optopt;
#ifndef __need_getopt
/* Describe the long-named options requested by the application.
The LONG_OPTIONS argument to getopt_long or getopt_long_only is a vector
of `struct option' terminated by an element containing a name which is
zero.
The field `has_arg' is:
no_argument (or 0) if the option does not take an argument,
required_argument (or 1) if the option requires an argument,
optional_argument (or 2) if the option takes an optional argument.
If the field `flag' is not NULL, it points to a variable that is set
to the value given in the field `val' when the option is found, but
left unchanged if the option is not found.
To have a long-named option do something other than set an `int' to
a compiled-in constant, such as set a value from `optarg', set the
option's `flag' field to zero and its `val' field to a nonzero
value (the equivalent single-letter option character, if there is
one). For long options that have a zero `flag' field, `getopt'
returns the contents of the `val' field. */
struct option
{
const char *name;
/* has_arg can't be an enum because some compilers complain about
type mismatches in all the code that assumes it is an int. */
int has_arg;
int *flag;
int val;
};
/* Names for the values of the `has_arg' field of `struct option'. */
# define no_argument 0
# define required_argument 1
# define optional_argument 2
#endif /* need getopt */
/* Get definitions and prototypes for functions to process the
arguments in ARGV (ARGC of them, minus the program name) for
options given in OPTS.
Return the option character from OPTS just read. Return -1 when
there are no more options. For unrecognized options, or options
missing arguments, `optopt' is set to the option letter, and '?' is
returned.
The OPTS string is a list of characters which are recognized option
letters, optionally followed by colons, specifying that that letter
takes an argument, to be placed in `optarg'.
If a letter in OPTS is followed by two colons, its argument is
optional. This behavior is specific to the GNU `getopt'.
The argument `--' causes premature termination of argument
scanning, explicitly telling `getopt' that there are no more
options.
If OPTS begins with `-', then non-option arguments are treated as
arguments to the option '\1'. This behavior is specific to the GNU
`getopt'. If OPTS begins with `+', or POSIXLY_CORRECT is set in
the environment, then do not permute arguments. */
extern int getopt (int ___argc, char *const *___argv, const char *__shortopts)
__THROW;
#ifndef __need_getopt
extern int getopt_long (int ___argc, char *__getopt_argv_const *___argv,
const char *__shortopts,
const struct option *__longopts, int *__longind)
__THROW;
extern int getopt_long_only (int ___argc, char *__getopt_argv_const *___argv,
const char *__shortopts,
const struct option *__longopts, int *__longind)
__THROW;
#endif
#ifdef __cplusplus
}
#endif
/* Make sure we later can get all the definitions and declarations. */
#undef __need_getopt
#endif /* getopt.h */

131
branches/dwg/LSource/src/cpmtools-2.13/getopt_int.h

@ -1,131 +0,0 @@
/* Internal declarations for getopt.
Copyright (C) 1989-1994,1996-1999,2001,2003,2004
Free Software Foundation, Inc.
This file is part of the GNU C Library.
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 2, 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, write to the Free Software Foundation,
Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */
#ifndef _GETOPT_INT_H
#define _GETOPT_INT_H 1
extern int _getopt_internal (int ___argc, char **___argv,
const char *__shortopts,
const struct option *__longopts, int *__longind,
int __long_only, int __posixly_correct);
/* Reentrant versions which can handle parsing multiple argument
vectors at the same time. */
/* Data type for reentrant functions. */
struct _getopt_data
{
/* These have exactly the same meaning as the corresponding global
variables, except that they are used for the reentrant
versions of getopt. */
int optind;
int opterr;
int optopt;
char *optarg;
/* Internal members. */
/* True if the internal members have been initialized. */
int __initialized;
/* The next char to be scanned in the option-element
in which the last option character we returned was found.
This allows us to pick up the scan where we left off.
If this is zero, or a null string, it means resume the scan
by advancing to the next ARGV-element. */
char *__nextchar;
/* Describe how to deal with options that follow non-option ARGV-elements.
If the caller did not specify anything,
the default is REQUIRE_ORDER if the environment variable
POSIXLY_CORRECT is defined, PERMUTE otherwise.
REQUIRE_ORDER means don't recognize them as options;
stop option processing when the first non-option is seen.
This is what Unix does.
This mode of operation is selected by either setting the environment
variable POSIXLY_CORRECT, or using `+' as the first character
of the list of option characters, or by calling getopt.
PERMUTE is the default. We permute the contents of ARGV as we
scan, so that eventually all the non-options are at the end.
This allows options to be given in any order, even with programs
that were not written to expect this.
RETURN_IN_ORDER is an option available to programs that were
written to expect options and other ARGV-elements in any order
and that care about the ordering of the two. We describe each
non-option ARGV-element as if it were the argument of an option
with character code 1. Using `-' as the first character of the
list of option characters selects this mode of operation.
The special argument `--' forces an end of option-scanning regardless
of the value of `ordering'. In the case of RETURN_IN_ORDER, only
`--' can cause `getopt' to return -1 with `optind' != ARGC. */
enum
{
REQUIRE_ORDER, PERMUTE, RETURN_IN_ORDER
} __ordering;
/* If the POSIXLY_CORRECT environment variable is set
or getopt was called. */
int __posixly_correct;
/* Handle permutation of arguments. */
/* Describe the part of ARGV that contains non-options that have
been skipped. `first_nonopt' is the index in ARGV of the first
of them; `last_nonopt' is the index after the last of them. */
int __first_nonopt;
int __last_nonopt;
#if defined _LIBC && defined USE_NONOPTION_FLAGS
int __nonoption_flags_max_len;
int __nonoption_flags_len;
# endif
};
/* The initializer is necessary to set OPTIND and OPTERR to their
default values and to clear the initialization flag. */
#define _GETOPT_DATA_INITIALIZER { 1, 1 }
extern int _getopt_internal_r (int ___argc, char **___argv,
const char *__shortopts,
const struct option *__longopts, int *__longind,
int __long_only, int __posixly_correct,
struct _getopt_data *__data);
extern int _getopt_long_r (int ___argc, char **___argv,
const char *__shortopts,
const struct option *__longopts, int *__longind,
struct _getopt_data *__data);
extern int _getopt_long_only_r (int ___argc, char **___argv,
const char *__shortopts,
const struct option *__longopts,
int *__longind,
struct _getopt_data *__data);
#endif /* getopt_int.h */

520
branches/dwg/LSource/src/cpmtools-2.13/install-sh

@ -1,520 +0,0 @@
#!/bin/sh
# install - install a program, script, or datafile
scriptversion=2009-04-28.21; # UTC
# This originates from X11R5 (mit/util/scripts/install.sh), which was
# later released in X11R6 (xc/config/util/install.sh) with the
# following copyright and license.
#
# Copyright (C) 1994 X Consortium
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to
# deal in the Software without restriction, including without limitation the
# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
# sell copies of the Software, and to permit persons to whom the Software is
# furnished to do so, subject to the following conditions:
#
# The above copyright notice and this permission notice shall be included in
# all copies or substantial portions of the Software.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
# X CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
# AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNEC-
# TION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
#
# Except as contained in this notice, the name of the X Consortium shall not
# be used in advertising or otherwise to promote the sale, use or other deal-
# ings in this Software without prior written authorization from the X Consor-
# tium.
#
#
# FSF changes to this file are in the public domain.
#
# Calling this script install-sh is preferred over install.sh, to prevent
# `make' implicit rules from creating a file called install from it
# when there is no Makefile.
#
# This script is compatible with the BSD install script, but was written
# from scratch.
nl='
'
IFS=" "" $nl"
# set DOITPROG to echo to test this script
# Don't use :- since 4.3BSD and earlier shells don't like it.
doit=${DOITPROG-}
if test -z "$doit"; then
doit_exec=exec
else
doit_exec=$doit
fi
# Put in absolute file names if you don't have them in your path;
# or use environment vars.
chgrpprog=${CHGRPPROG-chgrp}
chmodprog=${CHMODPROG-chmod}
chownprog=${CHOWNPROG-chown}
cmpprog=${CMPPROG-cmp}
cpprog=${CPPROG-cp}
mkdirprog=${MKDIRPROG-mkdir}
mvprog=${MVPROG-mv}
rmprog=${RMPROG-rm}
stripprog=${STRIPPROG-strip}
posix_glob='?'
initialize_posix_glob='
test "$posix_glob" != "?" || {
if (set -f) 2>/dev/null; then
posix_glob=
else
posix_glob=:
fi
}
'
posix_mkdir=
# Desired mode of installed file.
mode=0755
chgrpcmd=
chmodcmd=$chmodprog
chowncmd=
mvcmd=$mvprog
rmcmd="$rmprog -f"
stripcmd=
src=
dst=
dir_arg=
dst_arg=
copy_on_change=false
no_target_directory=
usage="\
Usage: $0 [OPTION]... [-T] SRCFILE DSTFILE
or: $0 [OPTION]... SRCFILES... DIRECTORY
or: $0 [OPTION]... -t DIRECTORY SRCFILES...
or: $0 [OPTION]... -d DIRECTORIES...
In the 1st form, copy SRCFILE to DSTFILE.
In the 2nd and 3rd, copy all SRCFILES to DIRECTORY.
In the 4th, create DIRECTORIES.
Options:
--help display this help and exit.
--version display version info and exit.
-c (ignored)
-C install only if different (preserve the last data modification time)
-d create directories instead of installing files.
-g GROUP $chgrpprog installed files to GROUP.
-m MODE $chmodprog installed files to MODE.
-o USER $chownprog installed files to USER.
-s $stripprog installed files.
-t DIRECTORY install into DIRECTORY.
-T report an error if DSTFILE is a directory.
Environment variables override the default commands:
CHGRPPROG CHMODPROG CHOWNPROG CMPPROG CPPROG MKDIRPROG MVPROG
RMPROG STRIPPROG
"
while test $# -ne 0; do
case $1 in
-c) ;;
-C) copy_on_change=true;;
-d) dir_arg=true;;
-g) chgrpcmd="$chgrpprog $2"
shift;;
--help) echo "$usage"; exit $?;;
-m) mode=$2
case $mode in
*' '* | *' '* | *'
'* | *'*'* | *'?'* | *'['*)
echo "$0: invalid mode: $mode" >&2
exit 1;;
esac
shift;;
-o) chowncmd="$chownprog $2"
shift;;
-s) stripcmd=$stripprog;;
-t) dst_arg=$2
shift;;
-T) no_target_directory=true;;
--version) echo "$0 $scriptversion"; exit $?;;
--) shift
break;;
-*) echo "$0: invalid option: $1" >&2
exit 1;;
*) break;;
esac
shift
done
if test $# -ne 0 && test -z "$dir_arg$dst_arg"; then
# When -d is used, all remaining arguments are directories to create.
# When -t is used, the destination is already specified.
# Otherwise, the last argument is the destination. Remove it from $@.
for arg
do
if test -n "$dst_arg"; then
# $@ is not empty: it contains at least $arg.
set fnord "$@" "$dst_arg"
shift # fnord
fi
shift # arg
dst_arg=$arg
done
fi
if test $# -eq 0; then
if test -z "$dir_arg"; then
echo "$0: no input file specified." >&2
exit 1
fi
# It's OK to call `install-sh -d' without argument.
# This can happen when creating conditional directories.
exit 0
fi
if test -z "$dir_arg"; then
trap '(exit $?); exit' 1 2 13 15
# Set umask so as not to create temps with too-generous modes.
# However, 'strip' requires both read and write access to temps.
case $mode in
# Optimize common cases.
*644) cp_umask=133;;
*755) cp_umask=22;;
*[0-7])
if test -z "$stripcmd"; then
u_plus_rw=
else
u_plus_rw='% 200'
fi
cp_umask=`expr '(' 777 - $mode % 1000 ')' $u_plus_rw`;;
*)
if test -z "$stripcmd"; then
u_plus_rw=
else
u_plus_rw=,u+rw
fi
cp_umask=$mode$u_plus_rw;;
esac
fi
for src
do
# Protect names starting with `-'.
case $src in
-*) src=./$src;;
esac
if test -n "$dir_arg"; then
dst=$src
dstdir=$dst
test -d "$dstdir"
dstdir_status=$?
else
# Waiting for this to be detected by the "$cpprog $src $dsttmp" command
# might cause directories to be created, which would be especially bad
# if $src (and thus $dsttmp) contains '*'.
if test ! -f "$src" && test ! -d "$src"; then
echo "$0: $src does not exist." >&2
exit 1
fi
if test -z "$dst_arg"; then
echo "$0: no destination specified." >&2
exit 1
fi
dst=$dst_arg
# Protect names starting with `-'.
case $dst in
-*) dst=./$dst;;
esac
# If destination is a directory, append the input filename; won't work
# if double slashes aren't ignored.
if test -d "$dst"; then
if test -n "$no_target_directory"; then
echo "$0: $dst_arg: Is a directory" >&2
exit 1
fi
dstdir=$dst
dst=$dstdir/`basename "$src"`
dstdir_status=0
else
# Prefer dirname, but fall back on a substitute if dirname fails.
dstdir=`
(dirname "$dst") 2>/dev/null ||
expr X"$dst" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
X"$dst" : 'X\(//\)[^/]' \| \
X"$dst" : 'X\(//\)$' \| \
X"$dst" : 'X\(/\)' \| . 2>/dev/null ||
echo X"$dst" |
sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
s//\1/
q
}
/^X\(\/\/\)[^/].*/{
s//\1/
q
}
/^X\(\/\/\)$/{
s//\1/
q
}
/^X\(\/\).*/{
s//\1/
q
}
s/.*/./; q'
`
test -d "$dstdir"
dstdir_status=$?
fi
fi
obsolete_mkdir_used=false
if test $dstdir_status != 0; then
case $posix_mkdir in
'')
# Create intermediate dirs using mode 755 as modified by the umask.
# This is like FreeBSD 'install' as of 1997-10-28.
umask=`umask`
case $stripcmd.$umask in
# Optimize common cases.
*[2367][2367]) mkdir_umask=$umask;;
.*0[02][02] | .[02][02] | .[02]) mkdir_umask=22;;
*[0-7])
mkdir_umask=`expr $umask + 22 \
- $umask % 100 % 40 + $umask % 20 \
- $umask % 10 % 4 + $umask % 2
`;;
*) mkdir_umask=$umask,go-w;;
esac
# With -d, create the new directory with the user-specified mode.
# Otherwise, rely on $mkdir_umask.
if test -n "$dir_arg"; then
mkdir_mode=-m$mode
else
mkdir_mode=
fi
posix_mkdir=false
case $umask in
*[123567][0-7][0-7])
# POSIX mkdir -p sets u+wx bits regardless of umask, which
# is incompatible with FreeBSD 'install' when (umask & 300) != 0.
;;
*)
tmpdir=${TMPDIR-/tmp}/ins$RANDOM-$$
trap 'ret=$?; rmdir "$tmpdir/d" "$tmpdir" 2>/dev/null; exit $ret' 0
if (umask $mkdir_umask &&
exec $mkdirprog $mkdir_mode -p -- "$tmpdir/d") >/dev/null 2>&1
then
if test -z "$dir_arg" || {
# Check for POSIX incompatibilities with -m.
# HP-UX 11.23 and IRIX 6.5 mkdir -m -p sets group- or
# other-writeable bit of parent directory when it shouldn't.
# FreeBSD 6.1 mkdir -m -p sets mode of existing directory.
ls_ld_tmpdir=`ls -ld "$tmpdir"`
case $ls_ld_tmpdir in
d????-?r-*) different_mode=700;;
d????-?--*) different_mode=755;;
*) false;;
esac &&
$mkdirprog -m$different_mode -p -- "$tmpdir" && {
ls_ld_tmpdir_1=`ls -ld "$tmpdir"`
test "$ls_ld_tmpdir" = "$ls_ld_tmpdir_1"
}
}
then posix_mkdir=:
fi
rmdir "$tmpdir/d" "$tmpdir"
else
# Remove any dirs left behind by ancient mkdir implementations.
rmdir ./$mkdir_mode ./-p ./-- 2>/dev/null
fi
trap '' 0;;
esac;;
esac
if
$posix_mkdir && (
umask $mkdir_umask &&
$doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir"
)
then :
else
# The umask is ridiculous, or mkdir does not conform to POSIX,
# or it failed possibly due to a race condition. Create the
# directory the slow way, step by step, checking for races as we go.
case $dstdir in
/*) prefix='/';;
-*) prefix='./';;
*) prefix='';;
esac
eval "$initialize_posix_glob"
oIFS=$IFS
IFS=/
$posix_glob set -f
set fnord $dstdir
shift
$posix_glob set +f
IFS=$oIFS
prefixes=
for d
do
test -z "$d" && continue
prefix=$prefix$d
if test -d "$prefix"; then
prefixes=
else
if $posix_mkdir; then
(umask=$mkdir_umask &&
$doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir") && break
# Don't fail if two instances are running concurrently.
test -d "$prefix" || exit 1
else
case $prefix in
*\'*) qprefix=`echo "$prefix" | sed "s/'/'\\\\\\\\''/g"`;;
*) qprefix=$prefix;;
esac
prefixes="$prefixes '$qprefix'"
fi
fi
prefix=$prefix/
done
if test -n "$prefixes"; then
# Don't fail if two instances are running concurrently.
(umask $mkdir_umask &&
eval "\$doit_exec \$mkdirprog $prefixes") ||
test -d "$dstdir" || exit 1
obsolete_mkdir_used=true
fi
fi
fi
if test -n "$dir_arg"; then
{ test -z "$chowncmd" || $doit $chowncmd "$dst"; } &&
{ test -z "$chgrpcmd" || $doit $chgrpcmd "$dst"; } &&
{ test "$obsolete_mkdir_used$chowncmd$chgrpcmd" = false ||
test -z "$chmodcmd" || $doit $chmodcmd $mode "$dst"; } || exit 1
else
# Make a couple of temp file names in the proper directory.
dsttmp=$dstdir/_inst.$$_
rmtmp=$dstdir/_rm.$$_
# Trap to clean up those temp files at exit.
trap 'ret=$?; rm -f "$dsttmp" "$rmtmp" && exit $ret' 0
# Copy the file name to the temp name.
(umask $cp_umask && $doit_exec $cpprog "$src" "$dsttmp") &&
# and set any options; do chmod last to preserve setuid bits.
#
# If any of these fail, we abort the whole thing. If we want to
# ignore errors from any of these, just make sure not to ignore
# errors from the above "$doit $cpprog $src $dsttmp" command.
#
{ test -z "$chowncmd" || $doit $chowncmd "$dsttmp"; } &&
{ test -z "$chgrpcmd" || $doit $chgrpcmd "$dsttmp"; } &&
{ test -z "$stripcmd" || $doit $stripcmd "$dsttmp"; } &&
{ test -z "$chmodcmd" || $doit $chmodcmd $mode "$dsttmp"; } &&
# If -C, don't bother to copy if it wouldn't change the file.
if $copy_on_change &&
old=`LC_ALL=C ls -dlL "$dst" 2>/dev/null` &&
new=`LC_ALL=C ls -dlL "$dsttmp" 2>/dev/null` &&
eval "$initialize_posix_glob" &&
$posix_glob set -f &&
set X $old && old=:$2:$4:$5:$6 &&
set X $new && new=:$2:$4:$5:$6 &&
$posix_glob set +f &&
test "$old" = "$new" &&
$cmpprog "$dst" "$dsttmp" >/dev/null 2>&1
then
rm -f "$dsttmp"
else
# Rename the file to the real destination.
$doit $mvcmd -f "$dsttmp" "$dst" 2>/dev/null ||
# The rename failed, perhaps because mv can't rename something else
# to itself, or perhaps because mv is so ancient that it does not
# support -f.
{
# Now remove or move aside any old file at destination location.
# We try this two ways since rm can't unlink itself on some
# systems and the destination file might be busy for other
# reasons. In this case, the final cleanup might fail but the new
# file should still install successfully.
{
test ! -f "$dst" ||
$doit $rmcmd -f "$dst" 2>/dev/null ||
{ $doit $mvcmd -f "$dst" "$rmtmp" 2>/dev/null &&
{ $doit $rmcmd -f "$rmtmp" 2>/dev/null; :; }
} ||
{ echo "$0: cannot unlink or rename $dst" >&2
(exit 1); exit 1
}
} &&
# Now rename the file to the real destination.
$doit $mvcmd "$dsttmp" "$dst"
}
fi || exit 1
trap '' 0
fi
done
# Local variables:
# eval: (add-hook 'write-file-hooks 'time-stamp)
# time-stamp-start: "scriptversion="
# time-stamp-format: "%:y-%02m-%02d.%02H"
# time-stamp-time-zone: "UTC"
# time-stamp-end: "; # UTC"
# End:

89
branches/dwg/LSource/src/cpmtools-2.13/makefile.nt

@ -1,89 +0,0 @@
#
# Makefile for cpmtools, using MS Visual C++ 6.x command-line tools
#
CC= cl
DISKDEFS= c:/cpm/etc/diskdefs
CPPFLAGS= /DDISKDEFS=\"$(DISKDEFS)\" /DFORMAT=\"ibm-3740\"
#
# Note: The "/Zp1" (pack structures on 1-byte boundaries) is important.
#
CFLAGS= /Zp1 /WX /W3 $(CPPFLAGS)
LDFLAGS=
#LDFLAGS= -g -L/usr/dmalloc/lib
LIBCURSES= -lcurses
LIBS= getopt.obj
#LIBS= -ldmalloc
MAKEDEPEND= mkdep -d
#MAKEDEPEND= gcc -MM
#MAKEDEPEND= makedepend -f-
BINDIR= /usr/cpm/bin
MANDIR= /usr/cpm/man/en
OSDEPEND= os_win32.obj
#OSDEPEND= os_unix.obj # Can be used if you don't want direct
# floppy support
ALL= cpmls.exe cpmrm.exe cpmcp.exe mkfs.cpm.exe fsck.cpm.exe \
# fsed.cpm.exe
all: $(ALL)
cpmls.exe: cpmls.obj cpmfs.obj $(OSDEPEND) getopt.obj
$(CC) $(LDFLAGS) -o $@ cpmls.obj cpmfs.obj $(OSDEPEND) $(LIBS)
cpmrm.exe: cpmrm.obj cpmfs.obj $(OSDEPEND) getopt.obj
$(CC) $(LDFLAGS) -o $@ cpmrm.obj cpmfs.obj $(OSDEPEND) $(LIBS)
cpmcp.exe: cpmcp.obj cpmfs.obj $(OSDEPEND) getopt.obj
$(CC) $(LDFLAGS) -o $@ cpmcp.obj cpmfs.obj $(OSDEPEND) $(LIBS)
mkfs.cpm.exe: mkfs.cpm.obj cpmfs.obj $(OSDEPEND) getopt.obj
$(CC) $(LDFLAGS) -o $@ mkfs.cpm.obj cpmfs.obj $(OSDEPEND) $(LIBS)
fsck.cpm.exe: fsck.cpm.obj cpmfs.obj $(OSDEPEND) getopt.obj
$(CC) $(LDFLAGS) -o $@ fsck.cpm.obj cpmfs.obj $(OSDEPEND) $(LIBS)
fsed.cpm.exe: fsed.cpm.obj getopt.obj
$(CC) $(LDFLAGS) -o $@ fsed.cpm.obj $(LIBCURSES) $(LIBS)
fsck.test: fsck.cpm.exe
-.\\fsck.cpm.exe -n badfs/status
-.\\fsck.cpm.exe -n badfs/extno
-.\\fsck.cpm.exe -n badfs/lcr
-.\\fsck.cpm.exe -n badfs/name
-.\\fsck.cpm.exe -n badfs/extension
-.\\fsck.cpm.exe -n badfs/blocknumber
-.\\fsck.cpm.exe -n badfs/recordcount
-.\\fsck.cpm.exe -n badfs/hugecom
-.\\fsck.cpm.exe -n badfs/timestamps
-.\\fsck.cpm.exe -n badfs/multipleblocks
-.\\fsck.cpm.exe -n badfs/doubleext
-.\\fsck.cpm.exe -f pcw -n badfs/label
install: all
install -c -s -m 755 cpmls $(BINDIR)/cpmls
install -c -s -m 755 cpmcp $(BINDIR)/cpmcp
install -c -s -m 755 cpmrm $(BINDIR)/cpmrm
install -c -s -m 755 mkfs.cpm $(BINDIR)/mkfs.cpm
install -c -s -m 755 fsck.cpm $(BINDIR)/fsck.cpm
install -c -s -m 755 fsed.cpm $(BINDIR)/fsed.cpm
install -c -m 644 diskdefs $(DISKDEFS)
install -c -m 644 cpmls.1 $(MANDIR)/man1/cpmls.1
install -c -m 644 cpmcp.1 $(MANDIR)/man1/cpmcp.1
install -c -m 644 cpmrm.1 $(MANDIR)/man1/cpmrm.1
install -c -m 644 mkfs.cpm.1 $(MANDIR)/man1/mkfs.cpm.1
install -c -m 644 fsck.cpm.1 $(MANDIR)/man1/fsck.cpm.1
install -c -m 644 fsed.cpm.1 $(MANDIR)/man1/fsed.cpm.1
clean:
rm -f *.obj
clobber: clean
rm -f $(ALL) *.out
tar: clobber
(b=`pwd`; b=`basename $$b`; cd ..; tar zcvf $$b.tar.gz $$b)
depend:
$(MAKEDEPEND) $(CPPFLAGS) *.c >.depend
include .depend

BIN
branches/dwg/LSource/src/cpmtools-2.13/mkfs.cpm

Binary file not shown.

64
branches/dwg/LSource/src/cpmtools-2.13/mkfs.cpm.1

@ -1,64 +0,0 @@
.TH MKFS.CPM 1 "March 30, 2010" "CP/M tools" "User commands"
.SH NAME \"{{{roff}}}\"{{{
mkfs.cpm \- make a CP/M file system
.\"}}}
.SH SYNOPSIS \"{{{
.ad l
.B mkfs.cpm
.RB [ \-f
.IR format ]
.RB [ \-b
.IR boot ]
.RB [ \-L
.IR label ]
.I image
.ad b
.\"}}}
.SH DESCRIPTION \"{{{
\fBmkfs.cpm\fP makes a CP/M file system on an image file or device.
.\"}}}
.SH OPTIONS \"{{{
.IP "\fB\-f\fP \fIformat\fP"
Use the given CP/M disk \fIformat\fP instead of the default format.
.IP "\fB\-b\fP \fIbootblock\fP"
Write the contents of the file \fIbootblock\fP to the system tracks
instead of filling them with 0xe5. This option can be used up to four
times. The file contents (typically boot block, CCP, BDOS and BIOS)
are written to sequential sectors, padding with 0xe5 if needed.
.IP "\fB\-L\fP \fIlabel\fP"
Label the file system. This is only supported by CP/M Plus.
.\"}}}
.SH "RETURN VALUE" \"{{{
Upon successful completion, exit code 0 is returned.
.\"}}}
.SH ERRORS \"{{{
Any errors are indicated by exit code 1.
.\"}}}
.SH FILES \"{{{
${prefix}/share/diskdefs CP/M disk format definitions
.\"}}}
.SH AUTHORS \"{{{
This program is copyright 1997\(en2010 Michael Haardt
<michael@moria.de>. The Windows port is copyright 2000, 2001 John Elliott
<jce@seasip.demon.co.uk>.
.PP
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.
.PP
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.
.PP
You should have received a copy of the GNU General Public License along
with this program. If not, write to the Free Software Foundation, Inc.,
59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
.\"}}}
.SH "SEE ALSO" \"{{{
.IR fsck.cpm (1),
.IR cpmls (1),
.IR mkfs (1),
.IR cpm (5)
.\"}}}

64
branches/dwg/LSource/src/cpmtools-2.13/mkfs.cpm.1.in

@ -1,64 +0,0 @@
.TH MKFS.CPM 1 "@UPDATED@" "CP/M tools" "User commands"
.SH NAME \"{{{roff}}}\"{{{
mkfs.cpm \- make a CP/M file system
.\"}}}
.SH SYNOPSIS \"{{{
.ad l
.B mkfs.cpm
.RB [ \-f
.IR format ]
.RB [ \-b
.IR boot ]
.RB [ \-L
.IR label ]
.I image
.ad b
.\"}}}
.SH DESCRIPTION \"{{{
\fBmkfs.cpm\fP makes a CP/M file system on an image file or device.
.\"}}}
.SH OPTIONS \"{{{
.IP "\fB\-f\fP \fIformat\fP"
Use the given CP/M disk \fIformat\fP instead of the default format.
.IP "\fB\-b\fP \fIbootblock\fP"
Write the contents of the file \fIbootblock\fP to the system tracks
instead of filling them with 0xe5. This option can be used up to four
times. The file contents (typically boot block, CCP, BDOS and BIOS)
are written to sequential sectors, padding with 0xe5 if needed.
.IP "\fB\-L\fP \fIlabel\fP"
Label the file system. This is only supported by CP/M Plus.
.\"}}}
.SH "RETURN VALUE" \"{{{
Upon successful completion, exit code 0 is returned.
.\"}}}
.SH ERRORS \"{{{
Any errors are indicated by exit code 1.
.\"}}}
.SH FILES \"{{{
@DATADIR@/diskdefs CP/M disk format definitions
.\"}}}
.SH AUTHORS \"{{{
This program is copyright 1997\(en2010 Michael Haardt
<michael@moria.de>. The Windows port is copyright 2000, 2001 John Elliott
<jce@seasip.demon.co.uk>.
.PP
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.
.PP
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.
.PP
You should have received a copy of the GNU General Public License along
with this program. If not, write to the Free Software Foundation, Inc.,
59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
.\"}}}
.SH "SEE ALSO" \"{{{
.IR fsck.cpm (1),
.IR cpmls (1),
.IR mkfs (1),
.IR cpm (5)
.\"}}}

175
branches/dwg/LSource/src/cpmtools-2.13/mkfs.cpm.c

@ -1,175 +0,0 @@
/* #includes */ /*{{{C}}}*//*{{{*/
#include "config.h"
#include <ctype.h>
#include <errno.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include "getopt_.h"
#include "cpmfs.h"
#ifdef USE_DMALLOC
#include <dmalloc.h>
#endif
/*}}}*/
/* #defines */ /*{{{*/
#ifndef O_BINARY
#define O_BINARY 0
#endif
/*}}}*/
/* mkfs -- make file system */ /*{{{*/
static int mkfs(struct cpmSuperBlock *drive, const char *name, const char *label, char *bootTracks)
{
/* variables */ /*{{{*/
int i;
char buf[128];
char firstbuf[128];
int fd;
int bytes;
int trkbytes;
/*}}}*/
/* open image file */ /*{{{*/
if ((fd = open(name, O_BINARY|O_CREAT|O_WRONLY, 0666)) < 0)
{
boo=strerror(errno);
return -1;
}
/*}}}*/
/* write system tracks */ /*{{{*/
/* this initialises only whole tracks, so it skew is not an issue */
trkbytes=drive->secLength*drive->sectrk;
for (i=0; i<trkbytes*drive->boottrk; i+=drive->secLength) if (write(fd, bootTracks+i, drive->secLength)!=drive->secLength)
{
boo=strerror(errno);
close(fd);
return -1;
}
/*}}}*/
/* write directory */ /*{{{*/
memset(buf,0xe5,128);
bytes=drive->maxdir*32;
if (bytes%trkbytes) bytes=((bytes+trkbytes)/trkbytes)*trkbytes;
if (drive->type==CPMFS_P2DOS || drive->type==CPMFS_DR3) buf[3*32]=0x21;
memcpy(firstbuf,buf,128);
if (drive->type==CPMFS_DR3)
{
time_t now;
struct tm *t;
int min,hour,days;
firstbuf[0]=0x20;
for (i=0; i<11 && *label; ++i,++label) firstbuf[1+i]=toupper(*label&0x7f);
while (i<11) firstbuf[1+i++]=' ';
firstbuf[12]=0x11; /* label set and first time stamp is creation date */
memset(&firstbuf[13],0,1+2+8);
time(&now);
t=localtime(&now);
min=((t->tm_min/10)<<4)|(t->tm_min%10);
hour=((t->tm_hour/10)<<4)|(t->tm_hour%10);
for (i=1978,days=0; i < 1900 + t->tm_year; ++i)
{
days+=365;
if (i%4==0 && (i%100!=0 || i%400==0)) ++days;
}
days += t->tm_yday + 1;
firstbuf[24]=firstbuf[28]=days&0xff; firstbuf[25]=firstbuf[29]=days>>8;
firstbuf[26]=firstbuf[30]=hour;
firstbuf[27]=firstbuf[31]=min;
}
for (i=0; i < bytes; i += 128) if (write(fd, i==0 ? firstbuf : buf, 128)!=128)
{
boo=strerror(errno);
close(fd);
return -1;
}
/*}}}*/
/* close image file */ /*{{{*/
if (close(fd)==-1)
{
boo=strerror(errno);
return -1;
}
/*}}}*/
return 0;
}
/*}}}*/
const char cmd[]="mkfs.cpm";
int main(int argc, char *argv[]) /*{{{*/
{
char *image;
const char *format=FORMAT;
int c,usage=0;
struct cpmSuperBlock drive;
struct cpmInode root;
const char *label="unlabeled";
size_t bootTrackSize,used;
char *bootTracks;
const char *boot[4]={(const char*)0,(const char*)0,(const char*)0,(const char*)0};
while ((c=getopt(argc,argv,"b:f:L:h?"))!=EOF) switch(c)
{
case 'b':
{
if (boot[0]==(const char*)0) boot[0]=optarg;
else if (boot[1]==(const char*)0) boot[1]=optarg;
else if (boot[2]==(const char*)0) boot[2]=optarg;
else if (boot[3]==(const char*)0) boot[3]=optarg;
else usage=1;
break;
}
case 'f': format=optarg; break;
case 'L': label=optarg; break;
case 'h':
case '?': usage=1; break;
}
if (optind!=(argc-1)) usage=1;
else image=argv[optind++];
if (usage)
{
fprintf(stderr,"Usage: %s [-f format] [-b boot] [-L label] image\n",cmd);
exit(1);
}
drive.dev.opened=0;
cpmReadSuper(&drive,&root,format);
bootTrackSize=drive.boottrk*drive.secLength*drive.sectrk;
if ((bootTracks=malloc(bootTrackSize))==(void*)0)
{
fprintf(stderr,"%s: can not allocate boot track buffer: %s\n",cmd,strerror(errno));
exit(1);
}
memset(bootTracks,0xe5,bootTrackSize);
used=0;
for (c=0; c<4 && boot[c]; ++c)
{
int fd;
size_t size;
if ((fd=open(boot[c],O_BINARY|O_RDONLY))==-1)
{
fprintf(stderr,"%s: can not open %s: %s\n",cmd,boot[c],strerror(errno));
exit(1);
}
size=read(fd,bootTracks+used,bootTrackSize-used);
#if 0
fprintf(stderr,"%d %04x %s\n",c,used+0x800,boot[c]);
#endif
if (size%drive.secLength) size=(size|(drive.secLength-1))+1;
used+=size;
close(fd);
}
if (mkfs(&drive,image,label,bootTracks)==-1)
{
fprintf(stderr,"%s: can not make new file system: %s\n",cmd,boo);
exit(1);
}
else exit(0);
}
/*}}}*/

62
branches/dwg/LSource/src/tasm-src-3.2/Doc/CopyRight.txt

@ -1,62 +0,0 @@
The Telemark Assembler Copyright Notification
The files on this disk are:
Copyright 1985-1993 by Speech Technology Incorporated, all rights reserved.
Copyright 1998,1999,2001 by Thomas N. Anderson , all rights reserved.
The following files on this disk may be freely copied and shared with others:
TASM.EXE - TASM Assembler, executable
TASM48.TAB - 8048 Instruction definition table
TASM51.TAB - 8051 Instruction definition table
TASM65.TAB - 6502 Instruction definition table
TASM85.TAB - 8085 Instruction definition table
TASM80.TAB - Z80 Instruction definition table
TASM05.TAB - 6805 Instruction definition table
TASM68.TAB - 6800/6801/68HC11 Instruction definition table
TASM3210.TAB - TMS32010 Instruction definition table
TASM3225.TAB - TMS32025 Instruction definition table
TASM70.TAB - TMS7000 Instruction definition table
TASMMAN.HTM - TASM Documentation (HTML)
TASMTABS.HTM - TASM Documentation on individual tables (HTML)
TEST*.ASM - TASM test cases (one for each table)
TESTTABS.BAT - Batch script to execute the test cases
8051.H - Useful register definitions for the 8051
MOTO.H - Useful directive definitions for Motorola compatibility
README.TXT - Brief Explanation of Disk contents
COPYRIGH.TXT - Copyright notice
ORDERFRM.TXT - Registration Form
ORDERFRM.HTM - Registration Form (HTML)
RELNOTES.TXT - Release notes.
Although you may freely copy the above files, TASM is not 'free' or
'public domain'. It is copyrighted material which can be copied and
evaluated by people without registration, but those that use it on a
regular basis must register (see the ORDERFRM.TXT or ORDERFRM.HTM files).
The following files are to be copied only with the following
restrictions: The owner of this software may make as many copies of
the following as is deemed necessary as long as no possibility exists
for the software (or derivitive products) to be in use on more than
one machine at a time. Or, if a site license has been purchased, the
software can only be used on machines at that site.
TASM.C
TASMMAIN.C
MACRO.C
PARSE.C
STR.C
LOOKUP.C
WRTOBJ.C
FNAME.C
WRTOBJ.C
ERRLOG.C
TASM.H
Thomas N. Anderson
Squak Valley Software
837 Front Street South
Issaquah, WA 98027
email: andersontn@acm.org

196
branches/dwg/LSource/src/tasm-src-3.2/Doc/OrderForm.htm

@ -1,196 +0,0 @@
<!doctype html public "-//w3c//dtd html 4.0 transitional//en">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<meta name="GENERATOR" content="Microsoft FrontPage 4.0">
<title>Telemark Cross Assembler (TASM) Order Form</title>
</head>
<body text="#000000" bgcolor="#CCCCCC" link="#0000EE" vlink="#551A8B" alink="#FF0000">
<h1>
TASM Order Form</h1>
<hr>
<b>
To order TASM by mail:</b>
<p>Print this page, fill in the details and mail (along with a check) to SVS at:</p>
<blockquote><i>Squak Valley Software</i>
<br><i>837 Front Street South</i>
<br><i>Issaquah, WA 98027</i>
<br><i>USA</i></blockquote>
<p>
<b>
To order TASM by email</b>:&nbsp;</p>
<p>
Use <a href="http://www.PayPal.com">PayPal</a> to send the appropriate amount
(see below) to <a href="mailto:tnetherly@attbi.com">tnetherly@attbi.com</a>.&nbsp;
This is the preferred method if you are eRegistering (receipt of TASM via email
without disk or printed manual).</p>
<h2>
TASM registration provides the user:</h2>
<ul>
<li>
Most Recent TASM Distribution (includes tables for all supported processor
families)</li>
<li>
TASM Source code (in ANSI C)</li>
<li>
Bound TASM Manual (except for eRegistration)</li>
<li>
Support by email</li>
<li>
Knowledge that they are supporting the development of useful but inexpensive
software</li>
</ul>
<table BORDER=0 >
<tr>
<td ALIGN=LEFT VALIGN=CENTER><b>Item Description</b></td>
<td ALIGN=CENTER><b>Unit Price</b></td>
<td ALIGN=CENTER VALIGN=CENTER><b>Amount Extended</b></td>
</tr>
<tr>
<td>TASM 3.2 eRegistration (no disk or manual)</td>
<td ALIGN=RIGHT VALIGN=CENTER>$25</td>
<td>______________________</td>
</tr>
<tr>
<td>TASM 3.2 Registration&nbsp;(with disk and manual)</td>
<td ALIGN=RIGHT VALIGN=CENTER>$40</td>
<td>______________________</td>
</tr>
<tr>
<td>TASM 3.2 Site Registration</td>
<td ALIGN=RIGHT VALIGN=CENTER>$90</td>
<td>______________________</td>
</tr>
<tr>
<td>TASM 3.2 Update for registered users</td>
<td ALIGN=RIGHT>$10</td>
<td>______________________</td>
</tr>
<tr>
<td></td>
<td></td>
<td></td>
</tr>
<tr>
<td><b>Subtotal</b></td>
<td></td>
<td>______________________</td>
</tr>
<tr>
<td>Tax (Washington State residents add 8.8%)</td>
<td></td>
<td>______________________</td>
</tr>
<tr>
<td>Billing Fee (for orders not accompanied by payment)</td>
<td ALIGN=RIGHT>$10</td>
<td>______________________</td>
</tr>
<tr>
<td>Foreign postage and handling</td>
<td ALIGN=RIGHT>$10</td>
<td>______________________</td>
</tr>
<tr>
<td><b>Total</b></td>
<td></td>
<td>______________________</td>
</tr>
</table>
<ul>
<li>
All payments must be in US funds drawn on a US bank (or payment via PayPal)</li>
<li>
Payments via PayPal are preferred (payable to tnetherly@attbi.com, see <a href="http://www.PayPal.com">www.paypal.com</a>)</li>
<li>
Orders outside North America please add the indicated foreign postage and
handling.</li>
<li>
Purchase orders allowed from North America only (all others must be prepaid).</li>
</ul>
<h2>
Ship To:</h2>
<table BORDER=0 >
<tr>
<td>Name</td>
<td>____________________________________</td>
</tr>
<tr>
<td>Company</td>
<td>___________________________________</td>
</tr>
<tr>
<td>Street Address</td>
<td>____________________________________</td>
</tr>
<tr>
<td>City, State/Province, Postal Code</td>
<td>____________________________________</td>
</tr>
<tr>
<td>Country</td>
<td>____________________________________</td>
</tr>
</table>
<hr>
</body>
</html>

20
branches/dwg/LSource/src/tasm-src-3.2/Doc/QuickStart.txt

@ -1,20 +0,0 @@
Quick Start Hints
-----------------
To quickly give TASM a try, go to the "Examples" folder in the
TASM installation folder. Execute the TESTTABS.BAT script, either
from the command line of a "Command Prompt" window, or with a double-click
on the script from the Windows Explorer.
The script will assemble a sample file for each of the supported
processors. You can examine the assembly source files (*.asm)
and the resulting output files (*.obj and *.lst) in that same
folder after the script executes.
Launching your own assembly projects with a batch file similar to
TESTTABS.bat is practical, but the recommended approach is to
launch TASM from your source file editor. The more capable
source editors (like CodeWright, Brief, etc.) can make it
easy to jump to the lines with errors after each assembly,
which is a real time-saver.

34
branches/dwg/LSource/src/tasm-src-3.2/Doc/ReleaseNotes.txt

@ -1,34 +0,0 @@
TASM RELEASE NOTES [Most recent releases]
Release Date/Version Description
-------------------- -----------------------------------------------
09/01/01 version 3.2 Increased LINESIZ to 512 to enable use of longer macros.
Eliminated -r command line option (to set
read buffer size - Now obsolete.)
Improved list() function to put a max of
six bytes per line to avoid problems with
directives that generate large blocks of
object code (i.e. .FILL).
Built as a 32 bit version using MS C++ 6.0
Added a Windows Installation Utility.
11/30/97 Version 3.1 Added LINUX support.
Added Protected mode version (tasmp) with better memory
management (more labels allowed, etc.)
Added an 8096 table.
Added Logical NOT unary operator.
Added an object file format with word address.
06/16/94 Version 3.0.1 Multiple macros on the same line.
Fixed problem with -c with >8000h bytes used goes bonkers
Corrected word addressing problem for BLOCK/DS directives.
Allow escaped quotes in TEXT strings.
10/24/93 Version 3.0 Documentation update. TASM.DOC, TASMTABS.DOC
and Relase Notes updated, but the functionality
remains unchanged from version 2.9.4.
...
10/01/85 Version 2.0 First version released to the market.

252
branches/dwg/LSource/src/tasm-src-3.2/Doc/TasmFAQ.htm

@ -1,252 +0,0 @@
<!doctype html public "-//w3c//dtd html 4.0 transitional//en">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<meta name="GENERATOR" content="Microsoft FrontPage 4.0">
<title>The Telemark Cross Assembler (TASM) FAQ</title>
<!--$Revision: 1.1 $-->
</head>
<body text="#000000" bgcolor="#CCCCCC" link="#0000EE" vlink="#551A8B" alink="#FF0000">
<h1>
TASM Frequently Asked Questions</h1>
<hr>
<h2>
Q: What Processors are supported by TASM?</h2>
The following table enumerates the processor families supported by TASM.&nbsp;
Derivatives that are compatible with the base processor family are, of course,
supported too.&nbsp; For those derivatives that have additional (extended)
instructions, the second column shows those that are supported.&nbsp; [Note: use
the &quot;-x&quot; command line option to enable extended instructions.]
<br>&nbsp;
<table BORDER=1 >
<tr>
<td><b>Processor Family</b></td>
<td><b>Derivatives with extended instructions supported</b></td>
</tr>
<tr>
<td>8048</td>
<td>8041A, 8022, 8021</td>
</tr>
<tr>
<td>6502</td>
<td>R65C02, R65C00/21</td>
</tr>
<tr>
<td>Z80</td>
<td>HD64180</td>
</tr>
<tr>
<td>6800</td>
<td>6801, 6803, 68HC11</td>
</tr>
<tr>
<td>6805</td>
<td>M146805 CMOS, 68HC02C4</td>
</tr>
<tr>
<td>8051</td>
<td></td>
</tr>
<tr>
<td>8080</td>
<td></td>
</tr>
<tr>
<td>TMS32010</td>
<td></td>
</tr>
<tr>
<td>TMS320C25</td>
<td>TMS320C26</td>
</tr>
<tr>
<td>TMS7000</td>
<td></td>
</tr>
<tr>
<td>8096&nbsp;</td>
<td>80C196KC</td>
</tr>
</table>
<h2>
Q: Does TASM come with an object code linker?</h2>
No. TASM generates absolute object code, thus no linker is necessary. It
is possible to break an application into many files, however, and collect
them via a top level file to include all the components (see the <b><i> #include</i></b>
directive in the <i> <b> TASM User's Manual</b></i>).
<h2>
Q: What are the minimum system requirements to run TASM?</h2>
For versions earlier than 3.2:
<ul>
<li>
80286 or higher processor. [Contact us if you need a version for the 8086.]</li>
<li>
MSDOS 2.1 or above</li>
<li>
512 Kbytes RAM</li>
<li>
2 Mbytes disk space</li>
</ul>
<p>For version 3.2:</p>
<ul>
<li>A 32 bit Windows platform (Windows 95, Windows 98, Windows 2000, Windows
NT)</li>
<li>2 Mbytes disk space</li>
</ul>
<h2>
Q: My computer has 512 Mbytes of RAM. How come TASM runs out of memory?</h2>
Prior to version 3.2, TASM was an old-fashioned program confined
to the 640 Kbyte memory space provided by DOS. If you are running out of memory
and you are using a version early than 3.2 you should upgrade and see if it
eliminates the problem.&nbsp; Even version 3.2 has some inherent limits,
however.&nbsp; There are fixed limits for the maximum number of labels and
macros (see the <b><i> TASM User's Manual</i></b>).
<h2>
Q: What performance can be expected from TASM?</h2>
Many factors affect performance. Here are some observed lines/second measurements
for assemblies of 6502 source code on various platforms:
<ul>
<li>
15000 lines/second on a 500 MHz Pentium based PC.</li>
<li>
40000 lines/second on a&nbsp;&nbsp;&nbsp;&nbsp; 2 GHz Pentium based PC.</li>
</ul>
Of historical note, early versions of TASM running on a PC/AT class machine
(circa 1985) typically achieved about 20 lines/second.&nbsp;&nbsp;
<h2>
Q: Is there a UNIX version of TASM?</h2>
Yes, but you need the source distribution to build it.&nbsp; The source
distribution comes with a <i>makefile</i> and instructions for building on
LINUX.&nbsp; The <i>makefile</i> should be usable on a variety of UNIX platforms
with little modification (assuming an appropriate compiler
tool set). An ANSI C compiler is required.
<h2>
Q: What compiler is used to build the released version of TASM?</h2>
Microsoft Visual C++ 6.0.
<h2>
Q: What's new in the latest release (v3.2)?</h2>
<ul>
<li>
Built as a 32 bit application for improved memory management and performance
improvements.</li>
<li>
Increased maximum length of a source line to 512 bytes to better handle
expansion of long macros.</li>
<li>
Improved formatting of list file for directives that generate more than 6 bytes
of object code (now broken into multiple lines).</li>
<li>
Self-extracting installation utility provided.</li>
</ul>
<h2>
Q: Can I bundle TASM with my way-cool development board?</h2>
The shareware distribution of TASM may be distributed with other commercial
products as long as it is clear that the customer is getting a shareware
product that has not yet been paid for. The customer receives the shareware
product for evaluation purposes, and if prolonged use ensues, the product
should be paid for.
<p>Alternately, a fully licensed TASM may be bundled with other commercial
products under an agreement with <i><b>SVS</b></i>. Many agreements such as this have
been employed in the past for both microcontroller development tools and
educational books. Please contact <b><i> SVS</i></b> if you are interested in such an
arrangement.
<h2>
Q: Can I distribute TASM to my students for course assignments?</h2>
The license policy is this: an educational institution may distribute TASM
to students for course work at that institution provide the institution
purchases a TASM site license. The students are not authorized to continue
use of TASM for their personal projects, however. Continued use by students
outside of course work requires an individual registration.
<h2>
Q: Is there a Windows version of TASM?</h2>
No. We have experimented with Windows interfaces for TASM, but have concluded
that such adds little value. What is of value, though, is integration of
TASM with a source code editor (Windows based or otherwise). Being able
to perform the edit/assemble/edit cycle all within a single environment
is useful. Many full-featured editors support such integration. Such editors
include:
<ul>
<li>
Brief</li>
<li>
CodeWright</li>
<li>
Vim (see <a href="http://www.vim.org">http://www.Vim.org</a>)</li>
</ul>
<h2>
Q: How do I configure the Vim editor to run TASM?</h2>
The first step is to add the following to your &quot;_vimrc&quot; file (which is
normally in the directory indicated by the HOME or HOMEPATH environment
variables):&nbsp;
<blockquote>
<pre>set makeprg=tasm\ -80\ -x\ %
set errorformat=%f\ line\ %l:\ %m</pre>
</blockquote>
<p>Now, you can launch an assembly on the file you are editing with Vim by
invoking the &quot;<font face="Courier New"><b>:make</b></font>&quot; command.&nbsp;
Use the &quot;<font face="Courier New"><b>:cnext</b></font>&quot; command to
skip to the next line with an error.&nbsp; Use the &quot;<font face="Courier New"><b>:copen</b></font>&quot;
command to open a window showing the full error list.&nbsp; See the Vim help
documentation for more details on this feature.</p>
<p>The <b>makeprg</b> setting above depends upon the TASM executable being in a
directory in the <b>Path</b> environment variable.&nbsp; Alternately, add the
full path to the <b>makeprg</b> setting (being extra careful with embedded
spaces).&nbsp; Also, the example explicitly indicates the Z80 instruction table
with the &quot;-80&quot; option.&nbsp; Set this according to your needs.</p>
<h2>
Q: Suppose I want to write my own TASM table for a processor not currently
supported. Is it difficult?</h2>
It is not terribly difficult, but does require thorough knowledge of the
target processor instruction set and the encoding rules supported by TASM.
The 3.2 release of TASM supports 31 different rules for the encoding of
opcodes/operands. When new processor families are added to TASM, most of
the instructions/address modes are supported by an existing encoding rule,
but usually a few new rules are necessary. Adding new encoding rules requires
source code modification. See TASMTABS.HTM&nbsp; for a summary of the encoding rules.
<p>&nbsp;</p>
<hr>
</body>
</html>

2865
branches/dwg/LSource/src/tasm-src-3.2/Doc/TasmManual.htm

File diff suppressed because it is too large

2989
branches/dwg/LSource/src/tasm-src-3.2/Doc/TasmTableManual.htm

File diff suppressed because it is too large

162
branches/dwg/LSource/src/tasm-src-3.2/Examples/8051.h

@ -1,162 +0,0 @@
;*************************************************************
;* TASM 8051/8052/80154 SFR BIT/BYTE MNEMONIC EQUATES LIST *
;*************************************************************
P0 .equ 080H ;Port 0
SP .equ 081H ;Stack pointer
DPL .equ 082H
DPH .equ 083H
PCON .equ 087H
TCON .equ 088H
TMOD .equ 089H
TL0 .equ 08AH
TL1 .equ 08BH
TH0 .equ 08CH
TH1 .equ 08DH
P1 .equ 090H ;Port 1
SCON .equ 098H
SBUF .equ 099H
P2 .equ 0A0H ;Port 2
IE .equ 0A8H
P3 .equ 0B0H ;Port 3
IP .equ 0B8H
T2CON .equ 0C8H ;8052, 80154 only
RCAP2L .equ 0CAH ;8052, 80154 only
RCAP2H .equ 0CBH ;8052, 80154 only
TL2 .equ 0CCH ;8052, 80154 only
TH2 .equ 0CDH ;8052, 80154 only
PSW .equ 0D0H
ACC .equ 0E0H ;Accumulator
B .equ 0F0H ;Secondary Accumulator
IOCON .equ 0F8H ;80154 only
;PORT 0 BITS
P0.0 .equ 080H ;Port 0 bit 0
P0.1 .equ 081H ;Port 0 bit 1
P0.2 .equ 082H ;Port 0 bit 2
P0.3 .equ 083H ;Port 0 bit 3
P0.4 .equ 084H ;Port 0 bit 4
P0.5 .equ 085H ;Port 0 bit 5
P0.6 .equ 086H ;Port 0 bit 6
P0.7 .equ 087H ;Port 0 bit 7
;PORT 1 BITS
P1.0 .equ 090H ;Port 1 bit 0
P1.1 .equ 091H ;Port 1 bit 1
P1.2 .equ 092H ;Port 1 bit 2
P1.3 .equ 093H ;Port 1 bit 3
P1.4 .equ 094H ;Port 1 bit 4
P1.5 .equ 095H ;Port 1 bit 5
P1.6 .equ 096H ;Port 1 bit 6
P1.7 .equ 097H ;Port 1 bit 7
;PORT 2 BITS
P2.0 .equ 0A0H ;Port 2 bit 0
P2.1 .equ 0A1H ;Port 2 bit 1
P2.2 .equ 0A2H ;Port 2 bit 2
P2.3 .equ 0A3H ;Port 2 bit 3
P2.4 .equ 0A4H ;Port 2 bit 4
P2.5 .equ 0A5H ;Port 2 bit 5
P2.6 .equ 0A6H ;Port 2 bit 6
P2.7 .equ 0A7H ;Port 2 bit 7
;PORT 3 BITS
P3.0 .equ 0B0H ;Port 3 bit 0
P3.1 .equ 0B1H ;Port 3 bit 1
P3.2 .equ 0B2H ;Port 3 bit 2
P3.3 .equ 0B3H ;Port 3 bit 3
P3.4 .equ 0B4H ;Port 3 bit 4
P3.5 .equ 0B5H ;Port 3 bit 5
P3.6 .equ 0B6H ;Port 3 bit 6
P3.7 .equ 0B7H ;Port 3 bit 7
;ACCUMULATOR BITS
ACC.0 .equ 0E0H ;Acc bit 0
ACC.1 .equ 0E1H ;Acc bit 1
ACC.2 .equ 0E2H ;Acc bit 2
ACC.3 .equ 0E3H ;Acc bit 3
ACC.4 .equ 0E4H ;Acc bit 4
ACC.5 .equ 0E5H ;Acc bit 5
ACC.6 .equ 0E6H ;Acc bit 6
ACC.7 .equ 0E7H ;Acc bit 7
;B REGISTER BITS
B.0 .equ 0F0H ;Breg bit 0
B.1 .equ 0F1H ;Breg bit 1
B.2 .equ 0F2H ;Breg bit 2
B.3 .equ 0F3H ;Breg bit 3
B.4 .equ 0F4H ;Breg bit 4
B.5 .equ 0F5H ;Breg bit 5
B.6 .equ 0F6H ;Breg bit 6
B.7 .equ 0F7H ;Breg bit 7
;PSW REGISTER BITS
P .equ 0D0H ;Parity flag
F1 .equ 0D1H ;User flag 1
OV .equ 0D2H ;Overflow flag
RS0 .equ 0D3H ;Register bank select 1
RS1 .equ 0D4H ;Register bank select 0
F0 .equ 0D5H ;User flag 0
AC .equ 0D6H ;Auxiliary carry flag
CY .equ 0D7H ;Carry flag
;TCON REGISTER BITS
IT0 .equ 088H ;Intr 0 type control
IE0 .equ 089H ;Intr 0 edge flag
IT1 .equ 08AH ;Intr 1 type control
IE1 .equ 08BH ;Intr 1 edge flag
TR0 .equ 08CH ;Timer 0 run
TF0 .equ 08DH ;Timer 0 overflow
TR1 .equ 08EH ;Timer 1 run
TF1 .equ 08FH ;Timer 1 overflow
;SCON REGISTER BITS
RI .equ 098H ;RX Intr flag
TI .equ 099H ;TX Intr flag
RB8 .equ 09AH ;RX 9th bit
TB8 .equ 09BH ;TX 9th bit
REN .equ 09CH ;Enable RX flag
SM2 .equ 09DH ;8/9 bit select flag
SM1 .equ 09EH ;Serial mode bit 1
SM0 .equ 09FH ;Serial mode bit 0
;IE REGISTER BITS
EX0 .equ 0A8H ;External intr 0
ET0 .equ 0A9H ;Timer 0 intr
EX1 .equ 0AAH ;External intr 1
ET1 .equ 0ABH ;Timer 1 intr
ES .equ 0ACH ;Serial port intr
ET2 .equ 0ADH ;Timer 2 intr
;Reserved 0AEH Reserved
EA .equ 0AFH ;Global intr enable
;IP REGISTER BITS
PX0 .equ 0B8H ;Priority level-External intr 0
PT0 .equ 0B9H ;Priority level-Timer 0 intr
PX1 .equ 0BAH ;Priority level-External intr 1
PT1 .equ 0BBH ;Priority level-Timer 1 intr
PS .equ 0BCH ;Priority level-Serial port intr
PT2 .equ 0BDH ;Priority level-Timer 2 intr
;Reserved 0BEH Reserved
PCT .equ 0BFH ;Global priority level
;IOCON REGISTER BITS 80154 ONLY
ALF .equ 0F8H ;Power down port condition
P1HZ .equ 0F9H ;Port 1 control
P2HZ .equ 0FAH ;Port 2 control
P3HZ .equ 0FBH ;Port 3 control
IZC .equ 0FCH ;Pullup select
SERR .equ 0FDH ;Serial reception error
T32 .equ 0FEH ;32 bit timer config
WDT .equ 0FFH ;Watchdog config
;T2CON REGISTER BITS 8052/80154 ONLY
CP/RL2 .equ 0C8H ;Timer 2 capture/reload flag
C/T2 .equ 0C9H ;Timer 2 timer/counter select
TR2 .equ 0CAH ;Timer 2 start/stop
EXEN2 .equ 0CBH ;Timer 2 external enable
TCLK .equ 0CCH ;TX clock flag
RCLK .equ 0CDH ;RX clock flag
EXF2 .equ 0CEH ;Timer 2 external flag
TF2 .equ 0CFH ;Timer 2 overflow

20
branches/dwg/LSource/src/tasm-src-3.2/Examples/moto.h

@ -1,20 +0,0 @@
; A few handy defines to make TASM more like typcial
; motorola syntax
.MSFIRST ; Most Significant byte first
#define EQU .EQU
#define ORG .ORG
#define RMB .BLOCK
#define FCB .BYTE
#define FCC .TEXT
#define FDB .WORD
#define equ .EQU
#define org .ORG
#define rmb .BLOCK
#define fcb .BYTE
#define fcc .TEXT
#define fdb .WORD

251
branches/dwg/LSource/src/tasm-src-3.2/Examples/test05.asm

@ -1,251 +0,0 @@
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
; $Id: test05.asm 1.1 1993/08/02 01:24:21 toma Exp $
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
; TASM test file
; Test all instructions and addressing modes.
; Processor: 6805
;
.org 0
bit3 .equ 3
data .equ $12
.block $46
addz .equ $46
.org $1007
addr:
ADC #data ;A9 2 NOP 1
ADC ,X ;F9 1 NOP 1
ADC addr,X ;D9 3 MZERO 1
ADC addz,X ;D9 3 MZERO 1
ADC addr ;C9 3 MZERO 1
ADC addz ;C9 3 MZERO 1
ADD #data ;AB 2 NOP 1
ADD ,X ;FB 1 NOP 1
ADD addr,X ;DB 3 MZERO 1
ADD addz,X ;DB 3 MZERO 1
ADD addr ;CB 3 MZERO 1
ADD addz ;CB 3 MZERO 1
AND #data ;A4 2 NOP 1
AND ,X ;F4 1 NOP 1
AND addr,X ;D4 3 MZERO 1
AND addz,X ;D4 3 MZERO 1
AND addr ;C4 3 MZERO 1
AND addz ;C4 3 MZERO 1
ASLA ;48 1 NOP 1
ASLX ;58 1 NOP 1
ASL ,X ;78 1 NOP 1
ASL addz,X ;68 2 NOP 1
ASL addz ;38 2 NOP 1
ASRA ;47 1 NOP 1
ASRX ;57 1 NOP 1
ASR ,X ;77 1 NOP 1
ASR addz,X ;37 2 NOP 1
ASR addz ;37 2 NOP 1
loop1:
BCC loop1 ;24 2 R1 1
BCS loop1 ;25 2 R1 1
BEQ loop1 ;27 2 R1 1
BHCC loop1 ;28 2 R1 1
BHCS loop1 ;29 2 R1 1
BHI loop1 ;22 2 R1 1
BHS loop1 ;24 2 R1 1
BIH loop1 ;2F 2 R1 1
BIL loop1 ;2E 2 R1 1
BIT #data ;A5 2 NOP 1
BIT ,X ;F5 1 NOP 1
BIT addr,X ;D5 3 MZERO 1
BIT addz,X ;C5 3 MZERO 1
BIT addr ;C5 3 MZERO 1
BIT addz ;C5 3 MZERO 1
BLO loop1 ;25 2 R1 1
BLS loop1 ;23 2 R1 1
BMC loop1 ;2C 2 R1 1
BMI loop1 ;2B 2 R1 1
BMS loop1 ;2D 2 R1 1
BNE loop1 ;26 2 R1 1
BPL loop1 ;2A 2 R1 1
BRA loop1 ;20 2 R1 1
BRN loop1 ;21 2 R1 1
BSR loop1 ;AD 2 R1 1
BRCLR bit3,addz,loop1 ;01 3 MBIT 1
BRSET bit3,addz,loop1 ;00 3 MBIT 1
BCLR bit3,addz ;11 2 MBIT 1
BSET bit3,addz ;10 2 MBIT 1
CLC ;98 1 NOP 1
CLI ;9A 1 NOP 1
CLRA ;4F 1 NOP 1
CLRX ;5F 1 NOP 1
CLR ,X ;7F 1 NOP 1
CLR addz,X ;6F 2 NOP 1
CLR addz ;3F 2 NOP 1
CMP #data ;A1 2 NOP 1
CMP ,X ;F1 1 NOP 1
CMP addr,X ;D1 3 MZERO 1
CMP addz,X ;D1 3 MZERO 1
CMP addr ;C1 3 MZERO 1
CMP addz ;C1 3 MZERO 1
COMA ;43 1 NOP 1
COMX ;53 1 NOP 1
COM ,X ;73 1 NOP 1
COM addz,X ;63 2 NOP 1
COM addz ;33 2 NOP 1
CPX #data ;A3 2 NOP 1
CPX ,X ;F3 1 NOP 1
CPX addr,X ;D3 3 MZERO 1
CPX addz,X ;D3 3 MZERO 1
CPX addr ;C3 3 MZERO 1
CPX addz ;C3 3 MZERO 1
DECA ;4A 1 NOP 1
DECX ;5A 1 NOP 1
DEX ;5A 1 NOP 1
DEC ,X ;7A 1 NOP 1
DEC addz,X ;6A 2 NOP 1
DEC addz ;3A 2 NOP 1
EOR #data ;A8 2 NOP 1
EOR ,X ;F8 1 NOP 1
EOR addr,X ;D8 3 MZERO 1
EOR addz,X ;D8 3 MZERO 1
EOR addr ;C8 3 MZERO 1
EOR addz ;C8 3 MZERO 1
INCA ;4C 1 NOP 1
INCX ;5C 1 NOP 1
INX ;5C 1 NOP 1
INC ,X ;7C 1 NOP 1
INC addz,X ;6C 2 NOP 1
INC addz ;3C 2 NOP 1
JMP ,X ;FC 1 NOP 1
JMP addr,X ;DC 3 MZERO 1
JMP addz,X ;DC 3 MZERO 1
JMP addr ;CC 3 MZERO 1
JMP addz ;CC 3 MZERO 1
JSR ,X ;FD 1 NOP 1
JSR addr,X ;DD 3 MZERO 1
JSR addz,X ;DD 3 MZERO 1
JSR addr ;CD 3 MZERO 1
JSR addz ;CD 3 MZERO 1
LDA #data ;A6 2 NOP 1
LDA ,X ;F6 1 NOP 1
LDA addr,X ;D6 3 MZERO 1
LDA addz,X ;D6 3 MZERO 1
LDA addr ;C6 3 MZERO 1
LDA addz ;C6 3 MZERO 1
LDX #data ;AE 2 NOP 1
LDX ,X ;FE 1 NOP 1
LDX addr,X ;DE 3 MZERO 1
LDX addz,X ;DE 3 MZERO 1
LDX addr ;CE 3 MZERO 1
LDX addz ;CE 3 MZERO 1
LSLA ;48 1 NOP 1
LSLX ;58 1 NOP 1
LSL ,X ;78 1 NOP 1
LSL addz,X ;68 2 NOP 1
LSL addz ;38 2 NOP 1
LSRA ;44 1 NOP 1
LSRX ;54 1 NOP 1
LSR ,X ;74 1 NOP 1
LSR addz,X ;64 2 NOP 1
LSR addz ;34 2 NOP 1
NEGA ;40 1 NOP 1
NEGX ;50 1 NOP 1
NEG ,X ;70 1 NOP 1
NEG addz,X ;60 2 NOP 1
NEG addz ;30 2 NOP 1
NOP ;9D 1 NOP 1
ORA #data ;AA 2 NOP 1
ORA ,X ;FA 1 NOP 1
ORA addr,X ;DA 3 MZERO 1
ORA addz,X ;DA 3 MZERO 1
ORA addr ;CA 3 MZERO 1
ORA addz ;CA 3 MZERO 1
ROLA ;49 1 NOP 1
ROLX ;59 1 NOP 1
ROL ,X ;79 1 NOP 1
ROL addz,X ;69 2 NOP 1
ROL addz ;39 2 NOP 1
RORA ;46 1 NOP 1
RORX ;56 1 NOP 1
ROR ,X ;76 1 NOP 1
ROR addz,X ;66 2 NOP 1
ROR addz ;36 2 NOP 1
RSP ;9C 1 NOP 1
RTI ;80 1 NOP 1
RTS ;81 1 NOP 1
SBC #data ;A2 2 NOP 1
SBC ,X ;F2 1 NOP 1
SBC addr,X ;D2 3 MZERO 1
SBC addz,X ;D2 3 MZERO 1
SBC addr ;C2 3 MZERO 1
SBC addz ;C2 3 MZERO 1
SEC ;99 1 NOP 1
SEI ;9B 1 NOP 1
STA ,X ;F7 1 NOP 1
STA addr,X ;D7 3 MZERO 1
STA addz,X ;D7 3 MZERO 1
STA addr ;C7 3 MZERO 1
STA addz ;C7 3 MZERO 1
STOP ;8E 1 NOP 1
STX ,X ;FF 1 NOP 1
STX addr,X ;DF 3 MZERO 1
STX addz,X ;DF 3 MZERO 1
STX addr ;CF 3 MZERO 1
STX addz ;CF 3 MZERO 1
SUB #data ;A0 2 NOP 1
SUB ,X ;F0 1 NOP 1
SUB addr,X ;D0 3 MZERO 1
SUB addz,X ;D0 3 MZERO 1
SUB addr ;C0 3 MZERO 1
SUB addz ;C0 3 MZERO 1
SWI ;83 1 NOP 1
TAX ;97 1 NOP 1
TSTA ;4D 1 NOP 1
TSTX ;5D 1 NOP 1
TST ,X ;7D 1 NOP 1
TST addz,X ;6D 2 NOP 1
TST addz ;3D 2 NOP 1
TXA ;9F 1 NOP 1
WAIT ;8F 1 NOP 1
.end

328
branches/dwg/LSource/src/tasm-src-3.2/Examples/test3210.asm

@ -1,328 +0,0 @@
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
; $Id: test3210.asm 1.1 1993/08/02 01:24:21 toma Exp $
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
; TASM test file
; Test all instructions and addressing modes.
; Processor: TMS32010
;
.org 100h
shift .equ 4
shift0 .equ 0
addr .equ 12h
port .equ 2
arp .equ 1
ar .equ 1
const .equ 34h
const1 .equ 1h
ABS ;7F88 2 NOP 1
ADD *+,shift,arp ;00A0 2 T1 1 8 0F00
ADD *-,shift,arp ;0090 2 T1 1 8 0F00
ADD *,shift,arp ;0080 2 T1 1 8 0F00
ADD *+,shift ;00A8 2 T1 1 8 0F00
ADD *-,shift ;0098 2 T1 1 8 0F00
ADD *,shift ;0088 2 T1 1 8 0F00
ADD *+ ;00A8 2 NOP 1
ADD *- ;0098 2 NOP 1
ADD * ;0088 2 NOP 1
ADD addr,shift ;0000 2 TDMA 1 8 0F00
ADD addr ;0000 2 T1 1 0 007F
ADDH *+,arp ;60A0 2 T1 1 0 01
ADDH *-,arp ;6090 2 T1 1 0 01
ADDH *,arp ;6080 2 T1 1 0 01
ADDH *+ ;60A8 2 NOP 1
ADDH *- ;6098 2 NOP 1
ADDH * ;6088 2 NOP 1
ADDH addr ;6000 2 T1 1 0 007F
ADDS *+,arp ;61A0 2 T1 1 0 01
ADDS *-,arp ;6190 2 T1 1 0 01
ADDS *,arp ;6180 2 T1 1 0 01
ADDS *+ ;61A8 2 NOP 1
ADDS *- ;6198 2 NOP 1
ADDS * ;6188 2 NOP 1
ADDS addr ;6100 2 T1 1 0 007F
AND *+,arp ;79A0 2 T1 1 0 01
AND *-,arp ;7990 2 T1 1 0 01
AND *,arp ;7980 2 T1 1 0 01
AND *+ ;79A8 2 NOP 1
AND *- ;7998 2 NOP 1
AND * ;7988 2 NOP 1
AND addr ;7900 2 T1 1 0 7F
APAC ;7F8F 2 NOP 1
loop1:
B loop1 ;F900 4 SWAP 1
BANZ loop1 ;F400 4 SWAP 1
BGEZ loop1 ;FD00 4 SWAP 1
BGZ loop1 ;FC00 4 SWAP 1
BIOZ loop1 ;F600 4 SWAP 1
BLEZ loop1 ;FB00 4 SWAP 1
BLZ loop1 ;FA00 4 SWAP 1
BNZ loop1 ;FE00 4 SWAP 1
BV loop1 ;F500 4 SWAP 1
BZ loop1 ;FF00 4 SWAP 1
CALA ;7F8C 2 NOP 1
CALL loop1 ;F800 4 SWAP 1
DINT ;7F81 2 NOP 1
DMOV *+,arp ;69A0 2 T1 1 0 01
DMOV *-,arp ;6990 2 T1 1 0 01
DMOV *,arp ;6980 2 T1 1 0 01
DMOV *+ ;69A8 2 NOP 1
DMOV *- ;6998 2 NOP 1
DMOV * ;6988 2 NOP 1
DMOV addr ;6900 2 T1 1 0 007F
EINT ;7F82 2 NOP 1
IN *+,port ,arp ;40A0 2 T1 1 8 0700
IN *-,port ,arp ;4090 2 T1 1 8 0700
IN * ,port ,arp ;4080 2 T1 1 8 0700
IN *+,port ;40A8 2 T1 1 8 0700
IN *-,port ;4098 2 T1 1 8 0700
IN * ,port ;4088 2 T1 1 8 0700
IN addr,port ;4000 2 TDMA 1 8 0700
LAC *+,shift,arp ;20A0 2 T1 1 8 0F00
LAC *-,shift,arp ;2090 2 T1 1 8 0F00
LAC *,shift,arp ;2080 2 T1 1 8 0F00
LAC *+,shift ;20A8 2 T1 1 8 0F00
LAC *-,shift ;2098 2 T1 1 8 0F00
LAC *,shift ;2088 2 T1 1 8 0F00
LAC *+ ;20A8 2 NOP 1
LAC *- ;2098 2 NOP 1
LAC * ;2088 2 NOP 1
LAC addr,shift ;2000 2 TDMA 1 8 0F00
LAC addr ;2000 2 T1 1 0 007F
LACK const ;7E00 2 T1 1 0 00FF
LAR ar,*+,arp ;38A0 2 TAR 1 0 0001
LAR ar,*-,arp ;3890 2 TAR 1 0 0001
LAR ar,*,arp ;3880 2 TAR 1 0 0001
LAR ar,*+ ;38A8 2 TAR 1 0 0001
LAR ar,*- ;3898 2 TAR 1 0 0001
LAR ar,* ;3888 2 TAR 1 0 0001
LAR ar, addr ;3800 2 TAR 1 0 007F
LARK ar,const ;7000 2 TAR 1 0 00FF
LARP const1 ;6880 2 T1 1 0 0001
LDP *+,arp ;6FA0 2 T1 1 0 01
LDP *-,arp ;6F90 2 T1 1 0 01
LDP *,arp ;6F80 2 T1 1 0 01
LDP *+ ;6FA8 2 NOP 1
LDP *- ;6F98 2 NOP 1
LDP * ;6F88 2 NOP 1
LDP addr ;6F00 2 T1 1 0 007F
LDPK const1 ;6E00 2 T1 1 0 01
LST *+,arp ;7BA0 2 T1 1 0 01
LST *-,arp ;7B90 2 T1 1 0 01
LST *,arp ;7B80 2 T1 1 0 01
LST *+ ;7BA8 2 NOP 1
LST *- ;7B98 2 NOP 1
LST * ;7B88 2 NOP 1
LST addr ;7B00 2 T1 1 0 007F
LT *+,arp ;6AA0 2 T1 1 0 01
LT *-,arp ;6A90 2 T1 1 0 01
LT *,arp ;6A80 2 T1 1 0 01
LT *+ ;6AA8 2 NOP 1
LT *- ;6A98 2 NOP 1
LT * ;6A88 2 NOP 1
LT addr ;6A00 2 T1 1 0 007F
LTA *+,arp ;6CA0 2 T1 1 0 01
LTA *-,arp ;6C90 2 T1 1 0 01
LTA *,arp ;6C80 2 T1 1 0 01
LTA *+ ;6CA8 2 NOP 1
LTA *- ;6C98 2 NOP 1
LTA * ;6C88 2 NOP 1
LTA addr ;6C00 2 T1 1 0 007F
LTD *+,arp ;6BA0 2 T1 1 0 01
LTD *-,arp ;6B90 2 T1 1 0 01
LTD *,arp ;6B80 2 T1 1 0 01
LTD *+ ;6BA8 2 NOP 1
LTD *- ;6B98 2 NOP 1
LTD * ;6B88 2 NOP 1
LTD addr ;6B00 2 T1 1 0 007F
MAR *+,arp ;68A0 2 T1 1 0 01
MAR *-,arp ;6890 2 T1 1 0 01
MAR *,arp ;6880 2 T1 1 0 01
MAR *+ ;68A8 2 NOP 1
MAR *- ;6898 2 NOP 1
MAR * ;6888 2 NOP 1
MAR addr ;6800 2 T1 1 0 007F
MPY *+,arp ;6DA0 2 T1 1 0 01
MPY *-,arp ;6D90 2 T1 1 0 01
MPY *,arp ;6D80 2 T1 1 0 01
MPY *+ ;6DA8 2 NOP 1
MPY *- ;6D98 2 NOP 1
MPY * ;6D88 2 NOP 1
MPY addr ;6D00 2 T1 1 0 007F
MPYK const ;8000 2 T1 1 0 1FFF
NOP ;7F80 2 NOP 1
OR *+,arp ;7AA0 2 T1 1 0 01
OR *-,arp ;7A90 2 T1 1 0 01
OR *,arp ;7A80 2 T1 1 0 01
OR *+ ;7AA8 2 NOP 1
OR *- ;7A98 2 NOP 1
OR * ;7A88 2 NOP 1
OR addr ;7A00 2 T1 1 0 007F
OUT *+,port,arp ;48A0 2 T1 1 8 0700
OUT *-,port,arp ;4890 2 T1 1 8 0700
OUT *, port,arp ;4880 2 T1 1 8 0700
OUT *+,port ;48A8 2 T1 1 8 0700
OUT *-,port ;4898 2 T1 1 8 0700
OUT *, port ;4888 2 T1 1 8 0700
OUT addr,port ;4800 2 TDMA 1 8 0700
PAC ;7F8E 2 NOP 1
POP ;7F9D 2 NOP 1
PUSH ;7F9C 2 NOP 1
RET ;7F8D 2 NOP 1
ROVM ;7F8A 2 NOP 1
;Note that shift count can only be 0,1, or 4.
;Mask also allows 5. Beware.
SACH *+,shift,arp ;58A0 2 T1 1 8 0500
SACH *-,shift,arp ;5890 2 T1 1 8 0500
SACH *, shift,arp ;5880 2 T1 1 8 0500
SACH *+,shift ;58A8 2 T1 1 8 0500
SACH *-,shift ;5898 2 T1 1 8 0500
SACH *, shift ;5888 2 T1 1 8 0500
SACH *+ ;58A8 2 NOP 1
SACH *- ;5898 2 NOP 1
SACH * ;5888 2 NOP 1
SACH addr,shift ;5800 2 TDMA 1 8 0500
SACH addr ;5800 2 T1 1 0 007F
; Shift count must be zero for SACL
SACL *+,shift0,arp ;50A0 2 T1 1 8 0000
SACL *-,shift0,arp ;5090 2 T1 1 8 0000
SACL *, shift0,arp ;5080 2 T1 1 8 0000
SACL *+,shift0 ;50A8 2 T1 1 8 0000
SACL *-,shift0 ;5098 2 T1 1 8 0000
SACL *, shift0 ;5088 2 T1 1 8 0000
SACL *+ ;50A8 2 NOP 1
SACL *- ;5098 2 NOP 1
SACL * ;5088 2 NOP 1
SACL addr,shift0 ;5000 2 TDMA 1 8 0000
SACL addr ;5000 2 T1 1 0 007F
SAR ar,*+,arp ;30A0 2 TAR 1 0 0001
SAR ar,*-,arp ;3090 2 TAR 1 0 0001
SAR ar,*,arp ;3080 2 TAR 1 0 0001
SAR ar,*+ ;30A8 2 TAR 1 0 0001
SAR ar,*- ;3098 2 TAR 1 0 0001
SAR ar,* ;3088 2 TAR 1 0 0001
SAR ar,addr ;3000 2 TAR 1 0 007F
SOVM ;7F8B 2 NOP 1
SPAC ;7F90 2 NOP 1
SST *+,arp ;7CA0 2 T1 1 0 0001
SST *-,arp ;7C90 2 T1 1 0 0001
SST *,arp ;7C80 2 T1 1 0 0001
SST *+ ;7CA8 2 NOP 1
SST *- ;7C98 2 NOP 1
SST * ;7C88 2 NOP 1
SST addr ;7C00 2 T1 1 0 007F
SUB *+,shift,arp ;10A0 2 T1 1 8 0F00
SUB *-,shift,arp ;1090 2 T1 1 8 0F00
SUB *, shift,arp ;1080 2 T1 1 8 0F00
SUB *+,shift ;10A8 2 T1 1 8 0F00
SUB *-,shift ;1098 2 T1 1 8 0F00
SUB *, shift ;1088 2 T1 1 8 0F00
SUB *+ ;10A8 2 NOP 1
SUB *- ;1098 2 NOP 1
SUB * ;1088 2 NOP 1
SUB addr,shift ;1000 2 TDMA 1 8 0F00
SUB addr ;1000 2 T1 1 0 007F
SUBC *+,arp ;64A0 2 T1 1 0 01
SUBC *-,arp ;6490 2 T1 1 0 01
SUBC *,arp ;6480 2 T1 1 0 01
SUBC *+ ;64A8 2 NOP 1
SUBC *- ;6498 2 NOP 1
SUBC * ;6488 2 NOP 1
SUBC addr ;6400 2 T1 1 0 007F
SUBH *+,arp ;62A0 2 T1 1 0 01
SUBH *-,arp ;6290 2 T1 1 0 01
SUBH *,arp ;6280 2 T1 1 0 01
SUBH *+ ;62A8 2 NOP 1
SUBH *- ;6298 2 NOP 1
SUBH * ;6288 2 NOP 1
SUBH addr ;6200 2 T1 1 0 007F
SUBS *+,arp ;63A0 2 T1 1 0 01
SUBS *-,arp ;6390 2 T1 1 0 01
SUBS *,arp ;6380 2 T1 1 0 01
SUBS *+ ;63A8 2 NOP 1
SUBS *- ;6398 2 NOP 1
SUBS * ;6388 2 NOP 1
SUBS addr ;6300 2 T1 1 0 007F
TBLR *+,arp ;67A0 2 T1 1 0 01
TBLR *-,arp ;6790 2 T1 1 0 01
TBLR *,arp ;6780 2 T1 1 0 01
TBLR *+ ;67A8 2 NOP 1
TBLR *- ;6798 2 NOP 1
TBLR * ;6788 2 NOP 1
TBLR addr ;6700 2 T1 1 0 007F
TBLW *+,arp ;7DA0 2 T1 1 0 01
TBLW *-,arp ;7D90 2 T1 1 0 01
TBLW *,arp ;7D80 2 T1 1 0 01
TBLW *+ ;7DA8 2 NOP 1
TBLW *- ;7D98 2 NOP 1
TBLW * ;7D88 2 NOP 1
TBLW addr ;7D00 2 T1 1 0 007F
XOR *+,arp ;78A0 2 T1 1 0 01
XOR *-,arp ;7890 2 T1 1 0 01
XOR *,arp ;7880 2 T1 1 0 01
XOR *+ ;78A8 2 NOP 1
XOR *- ;7898 2 NOP 1
XOR * ;7888 2 NOP 1
XOR addr ;7800 2 T1 1 0 007F
ZAC ;7F89 2 NOP 1
ZALH *+,arp ;65A0 2 T1 1 0 01
ZALH *-,arp ;6590 2 T1 1 0 01
ZALH *,arp ;6580 2 T1 1 0 01
ZALH *+ ;65A8 2 NOP 1
ZALH *- ;6598 2 NOP 1
ZALH * ;6588 2 NOP 1
ZALH addr ;6500 2 T1 1 0 007F
ZALS *+,arp ;66A0 2 T1 1 0 01
ZALS *-,arp ;6690 2 T1 1 0 01
ZALS *,arp ;6680 2 T1 1 0 01
ZALS *+ ;66A8 2 NOP 1
ZALS *- ;6698 2 NOP 1
ZALS * ;6688 2 NOP 1
ZALS addr ;6600 2 T1 1 0 007F
.end

1363
branches/dwg/LSource/src/tasm-src-3.2/Examples/test3225.asm

File diff suppressed because it is too large

279
branches/dwg/LSource/src/tasm-src-3.2/Examples/test48.asm

@ -1,279 +0,0 @@
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
; $Id: test48.asm 1.1 1993/08/02 01:24:21 toma Exp $
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
; TASM test file
; Test all instructions and addressing modes.
; Processor: 8048
;
label1 .equ 12H
ADD A,R0
ADD A,R1
ADD A,R2
ADD A,R3
ADD A,R4
ADD A,R5
ADD A,R6
ADD A,R7
ADD A,@R0
ADD A,@R1
ADD A,#label1
ADDC A,R0
ADDC A,R1
ADDC A,R2
ADDC A,R3
ADDC A,R4
ADDC A,R5
ADDC A,R6
ADDC A,R7
ADDC A,@R0
ADDC A,@R1
ADDC A,#label1
ANL A,R0
ANL A,R1
ANL A,R2
ANL A,R3
ANL A,R4
ANL A,R5
ANL A,R6
ANL A,R7
ANL A,@R0
ANL A,@R1
ANL A,#label1
ANL BUS,#label1
ANL P1,#label1
ANL P2,#label1
ANLD P4,A
ANLD P5,A
ANLD P6,A
ANLD P7,A
CALL label1
CLR A
CLR C
CLR F0
CLR F1
CPL A
CPL C
CPL F0
CPL F1
DA A
DEC A
DEC R0
DEC R1
DEC R2
DEC R3
DEC R4
DEC R5
DEC R6
DEC R7
DIS I
DIS TCNTI
DJNZ R0,label1
DJNZ R1,label1
DJNZ R2,label1
DJNZ R3,label1
DJNZ R4,label1
DJNZ R5,label1
DJNZ R6,label1
DJNZ R7,label1
EN DMA
EN FLAGS
EN I
EN TCNTI
ENT0 CLK
IN A,DBB
IN A,P0
IN A,P1
IN A,P2
INC A
INC R0
INC R1
INC R2
INC R3
INC R4
INC R5
INC R6
INC R7
INC @R0
INC @R1
INS A,BUS
JB0 label1
JB1 label1
JB2 label1
JB3 label1
JB4 label1
JB5 label1
JB6 label1
JB7 label1
JMP label1
JC label1
JF0 label1
JF1 label1
JNC label1
JNI label1
JNIBF label1
JNT0 label1
JNT1 label1
JNZ label1
JOBF label1
JTF label1
JT0 label1
JT1 label1
JZ label1
JMPP @A
MOV A,PSW
MOV A,R0
MOV A,R1
MOV A,R2
MOV A,R3
MOV A,R4
MOV A,R5
MOV A,R6
MOV A,R7
MOV A,T
MOV A,@R0
MOV A,@R1
MOV A,#label1
MOV PSW,A
MOV R0,A
MOV R1,A
MOV R2,A
MOV R3,A
MOV R4,A
MOV R5,A
MOV R6,A
MOV R7,A
MOV R0,#label1
MOV R1,#label1
MOV R2,#label1
MOV R3,#label1
MOV R4,#label1
MOV R5,#label1
MOV R6,#label1
MOV R7,#label1
MOV STS,A
MOV T,A
MOV @R0,A
MOV @R1,A
MOV @R0,#label1
MOV @R1,#label1
MOVD A,P4
MOVD A,P5
MOVD A,P6
MOVD A,P7
MOVD P4,A
MOVD P5,A
MOVD P6,A
MOVD P7,A
MOVP A,@A
MOVP3 A,@A
MOVX A,@R0
MOVX A,@R1
MOVX @R0,A
MOVX @R1,A
NOP
ORL A,R0
ORL A,R1
ORL A,R2
ORL A,R3
ORL A,R4
ORL A,R5
ORL A,R6
ORL A,R7
ORL A,@R0
ORL A,@R1
ORL A,#label1
ORL BUS,#label1
ORL P1,#label1
ORL P2,#label1
ORLD P4,A
ORLD P5,A
ORLD P6,A
ORLD P7,A
OUTL BUS,A
OUT DBB,A
OUTL P0,A
OUTL P1,A
OUTL P2,A
RAD
RET
RETI
RETR
RL A
RLC A
RR A
RRC A
SEL AN0
SEL AN1
SEL MB0
SEL MB1
SEL RB0
SEL RB1
STOP TCNT
STRT CNT
STRT T
SWAP A
XCH A,R0
XCH A,R1
XCH A,R2
XCH A,R3
XCH A,R4
XCH A,R5
XCH A,R6
XCH A,R7
XCH A,@R0
XCH A,@R1
XCHD A,@R0
XCHD A,@R1
XRL A,R0
XRL A,R1
XRL A,R2
XRL A,R3
XRL A,R4
XRL A,R5
XRL A,R6
XRL A,R7
XRL A,@R0
XRL A,@R1
XRL A,#label1
.end

297
branches/dwg/LSource/src/tasm-src-3.2/Examples/test51.asm

@ -1,297 +0,0 @@
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
; $Id: test51.asm 1.1 1993/08/02 01:24:21 toma Exp $
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
; TASM test file
; Test all instructions and addressing modes.
; Processor: 8051
;
.AVSYM
labimm: .EQU 56h
lab2: .EQU 12h
lab3: .EQU 1234h
lab5: .EQU 0feh
labbt_1: .EQU 34h
bit .equ 81h
ACALL lab4 ;11 2 JMP 1
lab4:
ADD A,R0 ;28 1 NOP 1
ADD A,R1 ;29 1 NOP 1
ADD A,R2 ;2A 1 NOP 1
ADD A,R3 ;2B 1 NOP 1
ADD A,R4 ;2C 1 NOP 1
ADD A,R5 ;2D 1 NOP 1
ADD A,R6 ;2E 1 NOP 1
ADD A,R7 ;2F 1 NOP 1
ADD A,@R0 ;26 1 NOP 1
ADD A,@R1 ;27 1 NOP 1
ADD A,#labimm ;24 2 NOP 1
ADD A,lab2 ;25 2 NOP 1
ADDC A,R0 ;38 1 NOP 1
ADDC A,R1 ;39 1 NOP 1
ADDC A,R2 ;3A 1 NOP 1
ADDC A,R3 ;3B 1 NOP 1
ADDC A,R4 ;3C 1 NOP 1
ADDC A,R5 ;3D 1 NOP 1
ADDC A,R6 ;3E 1 NOP 1
ADDC A,R7 ;3F 1 NOP 1
ADDC A,@R0 ;36 1 NOP 1
ADDC A,@R1 ;37 1 NOP 1
ADDC A,#labimm ;34 2 NOP 1
ADDC A,lab2 ;35 2 NOP 1
AJMP jlab ;01 2 JMP 1
ANL A,R0 ;58 1 NOP 1
ANL A,R1 ;59 1 NOP 1
ANL A,R2 ;5A 1 NOP 1
ANL A,R3 ;5B 1 NOP 1
ANL A,R4 ;5C 1 NOP 1
ANL A,R5 ;5D 1 NOP 1
ANL A,R6 ;5E 1 NOP 1
ANL A,R7 ;5F 1 NOP 1
ANL A,@R0 ;56 1 NOP 1
ANL A,@R1 ;57 1 NOP 1
ANL A,#labimm
ANL A,lab2
ANL C,/bit
ANL C,bit
ANL lab2,A
ANL lab2,#labimm
CJNE A,#labimm,jlab ;b4 3 CR 1
CJNE A,lab2,jlab ;b5 3 CR 1
CJNE R0,#labimm,jlab ;b8 3 CR 1
CJNE R1,#labimm,jlab ;b9 3 CR 1
CJNE R2,#labimm,jlab ;ba 3 CR 1
CJNE R3,#labimm,jlab ;bb 3 CR 1
CJNE R4,#labimm,jlab ;bc 3 CR 1
CJNE R5,#labimm,jlab ;bd 3 CR 1
CJNE R6,#labimm,jlab ;be 3 CR 1
CJNE R7,#labimm,jlab ;bf 3 CR 1
CJNE @R0,#labimm,jlab ;b6 3 CR 1
CJNE @R1,#labimm,jlab ;b7 3 CR 1
CLR A ;e4 1 NOP 1
CLR C ;c3 1 NOP 1
CLR bit
CPL A ;f4 1 NOP 1
CPL C ;b3 1 NOP 1
CPL bit
DA A ;d4 1 NOP 1
DEC A ;14 1 NOP 1
DEC R0 ;18 1 NOP 1
DEC R1 ;19 1 NOP 1
DEC R2 ;1A 1 NOP 1
DEC R3 ;1B 1 NOP 1
DEC R4 ;1C 1 NOP 1
DEC R5 ;1D 1 NOP 1
DEC R6 ;1E 1 NOP 1
DEC R7 ;1F 1 NOP 1
DEC @R0 ;16 1 NOP 1
DEC @R1 ;17 1 NOP 1
DEC lab2 ;15 2 NOP 1
DIV AB ;84 1 NOP 1
DJNZ R0,jlab ;d8 2 NOP 1
DJNZ R1,jlab ;d9 2 NOP 1
DJNZ R2,jlab ;dA 2 NOP 1
DJNZ R3,jlab ;dB 2 NOP 1
DJNZ R4,jlab ;dC 2 NOP 1
DJNZ R5,jlab ;dD 2 NOP 1
DJNZ R6,jlab ;dE 2 NOP 1
DJNZ R7,jlab ;dF 2 NOP 1
DJNZ lab2,jlab ;d5 3 CR 1
INC A ;04 1 NOP 1
INC R0 ;08 1 NOP 1
INC R1 ;09 1 NOP 1
INC R2 ;0A 1 NOP 1
INC R3 ;0B 1 NOP 1
INC R4 ;0C 1 NOP 1
INC R5 ;0D 1 NOP 1
INC R6 ;0E 1 NOP 1
INC R7 ;0F 1 NOP 1
INC @R0 ;06 1 NOP 1
INC @R1 ;07 1 NOP 1
INC DPTR ;a3 1 NOP 1
INC lab2 ;05 2 NOP 1
jlab:
JB labbt_1,jlab ;20 3 CR 1
JBC labbt_1,jlab ;10 3 CR 1
JC jlab ;40 2 R1 1
JMP @A+DPTR ;73 1 NOP 1
JNB labbt_1,jlab ;30 3 CR 1
JNC jlab ;50 2 R1 1
JNZ jlab ;70 2 R1 1
JZ jlab ;60 2 R1 1
LCALL lab3 ;12 3 SWAP 1
LJMP lab3 ;02 3 SWAP 1
MOV A,R0 ;e8 1 NOP 1
MOV A,R1 ;e9 1 NOP 1
MOV A,R2 ;eA 1 NOP 1
MOV A,R3 ;eB 1 NOP 1
MOV A,R4 ;eC 1 NOP 1
MOV A,R5 ;eD 1 NOP 1
MOV A,R6 ;eE 1 NOP 1
MOV A,R7 ;eF 1 NOP 1
MOV A,@R0 ;e6 1 NOP 1
MOV A,@R1 ;e7 1 NOP 1
MOV A,#labimm ;74 2 NOP 1
MOV A,lab2 ;e5 2 NOP 1
MOV C,bit ;a2 2 NOP 1
MOV DPTR,#labimm ;90 3 SWAP 1
MOV R0,A ;f8 1 NOP 1
MOV R1,A ;f9 1 NOP 1
MOV R2,A ;fA 1 NOP 1
MOV R3,A ;fB 1 NOP 1
MOV R4,A ;fC 1 NOP 1
MOV R5,A ;fD 1 NOP 1
MOV R6,A ;fE 1 NOP 1
MOV R7,A ;fF 1 NOP 1
MOV R0,#labimm ;78 2 NOP 1
MOV R1,#labimm ;79 2 NOP 1
MOV R2,#labimm ;7A 2 NOP 1
MOV R3,#labimm ;7B 2 NOP 1
MOV R4,#labimm ;7C 2 NOP 1
MOV R5,#labimm ;7D 2 NOP 1
MOV R6,#labimm ;7E 2 NOP 1
MOV R7,#labimm ;7F 2 NOP 1
MOV R0,lab2 ;a8 2 NOP 1
MOV R1,lab2 ;a9 2 NOP 1
MOV R2,lab2 ;aA 2 NOP 1
MOV R3,lab2 ;aB 2 NOP 1
MOV R4,lab2 ;aC 2 NOP 1
MOV R5,lab2 ;aD 2 NOP 1
MOV R6,lab2 ;aE 2 NOP 1
MOV R7,lab2 ;aF 2 NOP 1
MOV @R0,A ;f6 1 NOP 1
MOV @R1,A ;f7 1 NOP 1
MOV @R0,#labimm ;76 2 NOP 1
MOV @R1,#labimm ;77 2 NOP 1
MOV @R0,lab2 ;a6 2 NOP 1
MOV @R1,lab2 ;a7 2 NOP 1
MOV lab2,A ;f5 2 NOP 1
MOV bit,C ;92 2 NOP 1
MOV lab2,R0 ;88 2 NOP 1
MOV lab2,R1 ;89 2 NOP 1
MOV lab2,R2 ;8A 2 NOP 1
MOV lab2,R3 ;8B 2 NOP 1
MOV lab2,R4 ;8C 2 NOP 1
MOV lab2,R5 ;8D 2 NOP 1
MOV lab2,R6 ;8E 2 NOP 1
MOV lab2,R7 ;8F 2 NOP 1
MOV lab2,@R0 ;86 2 NOP 1
MOV lab2,@R1 ;87 2 NOP 1
MOV lab2,#labimm ;75 3 COMBINE 1
MOV lab5,lab2 ;85 3 COMBINE 1
MOVC A,@A+DPTR ;93 1 NOP 1
MOVC A,@A+PC ;83 1 NOP 1
MOVX A,@R0 ;e2 1 NOP 1
MOVX A,@R1 ;e3 1 NOP 1
MOVX A,@DPTR ;e0 1 NOP 1
MOVX @R0,A ;f2 1 NOP 1
MOVX @R1,A ;f3 1 NOP 1
MOVX @DPTR,A ;f0 1 NOP 1
MUL AB ;a4 1 NOP 1
NOP ;00 1 NOP 1
ORL A,R0 ;48 1 NOP 1
ORL A,R1 ;49 1 NOP 1
ORL A,R2 ;4A 1 NOP 1
ORL A,R3 ;4B 1 NOP 1
ORL A,R4 ;4C 1 NOP 1
ORL A,R5 ;4D 1 NOP 1
ORL A,R6 ;4E 1 NOP 1
ORL A,R7 ;4F 1 NOP 1
ORL A,@R0 ;46 1 NOP 1
ORL A,@R1 ;47 1 NOP 1
ORL A,#labimm ;44 2 NOP 1
ORL A,lab2 ;45 2 NOP 1
ORL C,/bit ;a0 2 NOP 1
ORL C,bit ;72 2 NOP 1
ORL lab2,A ;42 2 NOP 1
ORL lab2,#labimm ;43 3 COMBINE 1
POP lab2 ;d0 2 NOP 1
PUSH lab2 ;c0 2 NOP 1
RET ;22 1 NOP 1
RETI ;32 1 NOP 1
RL A ;23 1 NOP 1
RLC A ;33 1 NOP 1
RR A ;03 1 NOP 1
RRC A ;13 1 NOP 1
jlab5:
SETB C ;d3 1 NOP 1
SETB bit ;d2 2 NOP 1
SJMP jlab5 ;80 2 NOP 1
SUBB A,R0 ;98 1 NOP 1
SUBB A,R1 ;99 1 NOP 1
SUBB A,R2 ;9A 1 NOP 1
SUBB A,R3 ;9B 1 NOP 1
SUBB A,R4 ;9C 1 NOP 1
SUBB A,R5 ;9D 1 NOP 1
SUBB A,R6 ;9E 1 NOP 1
SUBB A,R7 ;9F 1 NOP 1
SUBB A,@R0 ;96 1 NOP 1
SUBB A,@R1 ;97 1 NOP 1
SUBB A,#labimm ;94 2 NOP 1
SUBB A,lab2 ;95 2 NOP 1
SWAP A ;c4 1 NOP 1
XCH A,R0 ;c8 1 NOP 1
XCH A,R1 ;c9 1 NOP 1
XCH A,R2 ;cA 1 NOP 1
XCH A,R3 ;cB 1 NOP 1
XCH A,R4 ;cC 1 NOP 1
XCH A,R5 ;cD 1 NOP 1
XCH A,R6 ;cE 1 NOP 1
XCH A,R7 ;cF 1 NOP 1
XCH A,@R0 ;c6 1 NOP 1
XCH A,@R1 ;c7 1 NOP 1
XCH A,lab2 ;c5 2 NOP 1
XCHD A,@R0 ;d6 1 NOP 1
XCHD A,@R1 ;d7 1 NOP 1
XRL A,R0 ;68 1 NOP 1
XRL A,R1 ;69 1 NOP 1
XRL A,R2 ;6A 1 NOP 1
XRL A,R3 ;6B 1 NOP 1
XRL A,R4 ;6C 1 NOP 1
XRL A,R5 ;6D 1 NOP 1
XRL A,R6 ;6E 1 NOP 1
XRL A,R7 ;6F 1 NOP 1
XRL A,@R0 ;66 1 NOP 1
XRL A,@R1 ;67 1 NOP 1
XRL A,#labimm ;64 2 NOP 1
XRL A,lab2 ;65 2 NOP 1
XRL lab2,A ;62 2 NOP 1
XRL lab2,#labimm ;63 3 COMBINE 1
.end

298
branches/dwg/LSource/src/tasm-src-3.2/Examples/test65.asm

@ -1,298 +0,0 @@
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
; $Id: test65.asm 1.2 1997/11/29 13:07:53 toma Exp $
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
; TASM test file
; Test all instructions and addressing modes.
; Processor: 6502
;
#define FLAG1
#define TORG $1234
.org $56
zlabel .byte $12
.word $1234
.word $1234/3
.word 1234h
.word %0101010
.word 0101010b
.word @1234
.word 1234o
.word 1234
.word 1234d
.word 0d
.word 1d
.word 2d
.word 3d
.word 4d
.word 10d
.word 20d
.word 100d
.word *
.word $
.word 3 * 7
.word 3 + 7
.word 3 - 7
.word 73 % 7
.word $1234 >> 4
.word $1234 << 4
.word 1 = 1
.word 1 = 0
.word 1 >= 1
.word 1 >= 2
.word 1 >= 0
.word 1 <= 1
.word 1 <= 2
.word 1 <= 0
.word 1 <= -1
.word TORG
.org $0234
alabel
ADC #zlabel
ADC (zlabel,X)
ADC (zlabel),Y
ADC (zlabel)
ADC (alabel & $ff) ; suppress UNUSED DATA error
ADC zlabel,X
ADC zlabel,Y
ADC zlabel
ADC alabel
AND #zlabel
AND (zlabel,X)
AND (zlabel),Y
AND (zlabel)
AND zlabel,X
AND zlabel,Y
AND zlabel
AND alabel
ASL A
ASL zlabel,X
ASL zlabel
loop
BCC loop
BCS loop
BEQ loop
BNE loop
BMI loop
BPL loop
BVC loop
BVS loop
BIT #zlabel
BIT zlabel,X
BIT zlabel
BIT alabel
BRK
CLC
CLD
CLI
CLV
CMP #zlabel
CMP (zlabel,X)
CMP (zlabel),Y
CMP (zlabel)
CMP zlabel,X
CMP zlabel,Y
CMP zlabel
CMP alabel
CPX #zlabel
CPX zlabel
CPX alabel
CPY #zlabel
CPY zlabel
CPY alabel
DEC A
DEC zlabel,X
DEC alabel,X
DEC zlabel
DEC alabel
DEX
DEY
EOR #zlabel
EOR (zlabel,X)
EOR (zlabel),Y
EOR (zlabel)
EOR zlabel,X
EOR zlabel,Y
EOR zlabel
EOR alabel
INC A
INC zlabel,X
INC alabel,X
INC zlabel
INC alabel
INX
INY
JMP (zlabel,X)
JMP (zlabel)
JMP zlabel
JSR zlabel
JSR alabel
LDA #zlabel
LDA (zlabel,X)
LDA (zlabel),Y
LDA (zlabel)
LDA zlabel,X
LDA zlabel,Y
LDA zlabel
LDA alabel
LDX #zlabel
LDX zlabel,Y
LDX zlabel
LDX alabel
LDY #zlabel
LDY zlabel,X
LDY zlabel
LDY alabel
LSR A
LSR zlabel,X
LSR zlabel
LSR alabel
NOP
ORA #zlabel
ORA (zlabel,X)
ORA (zlabel),Y
ORA (zlabel)
ORA zlabel,X
ORA zlabel,Y
ORA zlabel
ORA alabel
PHA
PHP
PLA
PLP
ROL A
ROL zlabel,X
ROL zlabel
ROL alabel
ROR A
ROR zlabel,X
ROR alabel,X
ROR zlabel
ROR alabel
RTI
RTS
SBC #zlabel
SBC (zlabel,X)
SBC (zlabel),Y
SBC (zlabel)
SBC zlabel,X
SBC zlabel,Y
SBC zlabel
SBC alabel
SEC
SED
SEI
STA (zlabel,X)
STA (zlabel),Y
STA (zlabel)
STA zlabel,X
STA zlabel,Y
STA zlabel
STA alabel
STX zlabel,Y
STX zlabel
STX alabel
STY zlabel,X
STY zlabel
STY alabel
TAX
TAY
TSX
TXA
TXS
TYA
BRA loop2
loop2
BBR0 zlabel,loop2
BBR1 zlabel,loop2
BBR2 zlabel,loop2
BBR3 zlabel,loop2
BBR4 zlabel,loop2
BBR5 zlabel,loop2
BBR6 zlabel,loop2
BBR7 zlabel,loop2
BBS0 zlabel,loop2
BBS1 zlabel,loop2
BBS2 zlabel,loop2
BBS3 zlabel,loop2
BBS4 zlabel,loop2
BBS5 zlabel,loop2
BBS6 zlabel,loop2
BBS7 zlabel,loop2
MUL
PHX
PHY
PLX
PLY
RMB0 zlabel
RMB1 zlabel
RMB2 zlabel
RMB3 zlabel
RMB4 zlabel
RMB5 zlabel
RMB6 zlabel
RMB7 zlabel
SMB0 zlabel
SMB1 zlabel
SMB2 zlabel
SMB3 zlabel
SMB4 zlabel
SMB5 zlabel
SMB6 zlabel
SMB7 zlabel
STZ zlabel,X
STZ zlabel
STZ alabel
TRB zlabel
TSB zlabel
.end

422
branches/dwg/LSource/src/tasm-src-3.2/Examples/test68.asm

@ -1,422 +0,0 @@
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
; $Id: test68.asm 1.1 1993/08/02 01:24:21 toma Exp $
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
; TASM test file
; Test all instructions and addressing modes.
; Processor: 6801/6803/68HC11
;
data1 .equ $12
data2 .equ $1234
ABA
ABX
ADDA #data1 ;8B
ADDA data1,X ;AB
ADDA data1 ;9B
ADDA data2 ;BB
ADDB #data1 ;CB
ADDB data1,X ;EB
ADDB data1 ;DB
ADDB data2 ;FB
ADCA #data1 ;89
ADCA data1,X ;A9
ADCA data1 ;99
ADCA data2 ;B9
ADCB #data1 ;C9
ADCB data1,X ;E9
ADCB data1 ;D9
ADCB data2 ;F9
ADDD #data1 ;C3
ADDD data1,X ;E3
ADDD data1 ;D3
ADDD data2 ;F3
ANDA #data1 ;84
ANDA data1,X ;A4
ANDA data1 ;94
ANDA data2 ;B4
ANDB #data1 ;C4
ANDB data1,X ;E4
ANDB data1 ;D4
ANDB data2 ;F4
ASL data1,X ;68
ASL data1 ;78
ASL data2 ;78
ASLA ;48
ASLB ;58
ASLD ;05
ASR data1,X ;
ASR data1 ;
ASR data2 ;
ASRA ;
ASRB ;
loop1:
BRA loop1 ;20
BRN loop1 ;21
BCC loop1 ;24
BCS loop1 ;25
BEQ loop1 ;27
BGE loop1 ;2C
BGT loop1 ;2E
BHI loop1 ;22
BHS loop1 ;24
BITA #data1 ;85
BITA data1,X ;A5
BITA data1 ;B5
BITA data2 ;B5
BITB #data1 ;C5
BITB data1,X ;E5
BITB data1 ;F5
BITB data2 ;F5
BLE loop1 ;2F
BLO loop1 ;25
BLS loop1 ;23
BLT loop1 ;2D
BMI loop1 ;2B
BNE loop1 ;26
BVC loop1 ;28
BVS loop1 ;29
BPL loop1 ;2A
BSR loop1 ;8D
CBA
CLC ;0C
CLI ;0E
CLR data1,X ;6F
CLR data1 ;7F
CLR data2 ;7F
CLRA ;4F
CLRB ;5F
CLV ;0A
COM data1,X ;63
COM data1 ;73
COM data2 ;73
COMA ;43
COMB ;53
CPX #data1 ;8C
CPX data1,X ;AC
CPX data1 ;9C
CPX data2 ;BC
CMPA #data1 ;
CMPA data1,X ;
CMPA data1 ;
CMPA data2 ;
CMPB #data1 ;
CMPB data1,X ;
CMPB data1 ;
CMPB data2 ;
DAA ;19
DEC data1,X
DEC data1
DEC data2
DECA ;4A
DECB ;5A
DES ;34
DEX ;09
EORA #data1 ;
EORA data1,X ;
EORA data1 ;
EORA data2 ;
EORB #data1 ;
EORB data1,X ;
EORB data1 ;
EORB data2 ;
INC data1,X
INC data1
INC data2
INCA ;4C
INCB ;5C
INS ;31
INX ;08
JMP data1,X ;63
JMP data1 ;7E
JMP data2 ;7E
JSR data1,X ;AD
JSR data1 ;9D
JSR data2 ;BD
LDAA #data1 ;86
LDAA data1,X ;A6
LDAA data1 ;96
LDAA data2 ;B6
LDAB #data1 ;C6
LDAB data1,X ;E6
LDAB data1 ;D6
LDAB data2 ;F6
LDD #data1 ;CC
LDD data1,X ;EC
LDD data1 ;DC
LDD data2 ;FC
LDS #data1 ;8E
LDS data1,X ;AE
LDS data1 ;9E
LDS data2 ;BE
LDX #data1 ;CE
LDX data1,X ;EE
LDX data1 ;DE
LDX data2 ;FE
LSLA ;48
LSLB ;58
LSLD ;05
LSRA ;44
LSRB ;54
LSRD ;04
LSR data1,X ;64
LSR data1 ;74
LSR data2 ;74
MUL ;3D
NEG data1,X ;60
NEG data1 ;70
NEG data2 ;70
NEGA ;40
NEGB ;50
NOP ;01
ORAA #data1 ;8A
ORAA data1,X ;AA
ORAA data1 ;BA
ORAA data2 ;9A
ORAB #data1 ;CA
ORAB data1,X ;EA
ORAB data1 ;DA
ORAB data2 ;FA
PSHA ;36
PSHB ;37
PSHX ;3C
PULA ;32
PULB ;33
PULX ;38
ROL data1,X ;69
ROL data1 ;79
ROLA ;49
ROLB ;59
ROR data1,X ;66
ROR data1 ;76
RORA ;46
RORB ;56
RTI ;3B
RTS ;39
SBA ;10
SBCA #data1 ;82
SBCA data1,X ;A2
SBCA data1 ;92
SBCA data2 ;B2
SBCB #data1 ;C2
SBCB data1,X ;E2
SBCB data1 ;D2
SBCB data2 ;F2
SEI ;0F
SEV ;0B
SEC
STS data1,X
STS data1
STS data2
STAA data1,X ;A7
STAA data1 ;97
STAA data2 ;B7
STAB data1,X ;E7
STAB data1 ;D7
STAB data2 ;F7
STD data1,X ;ED
STD data1 ;DD
STD data2 ;FD
STX data1,X ;EF
STX data1 ;FF
SUBA #data1 ;80
SUBA data1,X ;A0
SUBA data1 ;90
SUBA data2 ;B0
SUBB #data1 ;C0
SUBB data1,X ;E0
SUBB data1 ;D0
SUBB data2 ;F0
SUBD #data1 ;83
SUBD data1,X ;A3
SUBD data1 ;93
SUBD data2 ;B3
SWI ;3F
TAB ;16
TAP ;06
TPA ;07
TBA ;17
TST data1,X
TST data1
TST data2
TSTA ;4D
TSTB ;5D
TXS ;35
TSX ;30
WAI ;3E
;
; Test all the new 68HC11 instructions
;
bmsk .equ 12h
addr1 .equ 34h
addr2 .equ 5678h
imm .equ 55h
ABY ;183A
ADCA addr1,Y ;18A9
ADCB addr1,Y ;18E9
ADDA addr1,Y ;18AB
ADDB addr1,Y ;18EB
ADDD addr1,Y ;18E3
ANDA addr1,Y ;18A4
ANDB addr1,Y ;18E4
ASL addr1,Y ;1868
ASR addr1,Y ;1867
lab1
BCLR addr1,Y,bmsk
BCLR addr1,X,bmsk
BCLR addr1,bmsk
BITA addr1,Y ;18A5
BITB addr1,Y ;18E5
BRCLR addr1,Y,bmsk,lab1
BRCLR addr1,X,bmsk,lab1
BRCLR addr1,bmsk,lab1
BRCLR addr2,bmsk,lab1
BRSET addr1,Y,bmsk,lab1
BRSET addr1,X,bmsk,lab1
BRSET addr1,bmsk,lab1
BRSET addr2,bmsk,lab1
BSET addr1,Y,bmsk
BSET addr1,X,bmsk
BSET addr1,bmsk
CLR addr1,Y ;186F
CMPA addr1,Y ;18A1
CMPB addr1,Y ;18E1
COM addr1,Y ;1863
CPD #imm ;1A83
CPD addr1,X ;1AA3
CPD addr1,Y ;CDA3
CPD addr1 ;1AB3
CPD addr2 ;1AB3
CPX addr1,Y ;CDAC
CPY #imm ;188C
CPY addr1,Y ;18AC
CPY addr1,X ;1AAC
CPY addr1 ;18BC
CPY addr2 ;18BC
DEC addr1,Y ;186A
DEY ;1809
EORA addr1,Y ;18A8
EORB addr1,Y ;18E8
FDIV ;03
IDIV ;02
INC addr1,Y ;186C
INY ;1808
JMP addr1,Y ;186E
JSR addr1,Y ;18AD
LDAA addr1,Y ;18A6
LDAB addr1,Y ;18E6
LDD addr1,Y ;18EC
LDS addr1,Y ;18AE
LDX addr1,Y ;CDEE
LDY #imm ;18CE
LDY addr1,Y ;18EE
LDY addr1,X ;1AEE
LDY addr1 ;18FE
LDY addr2 ;18FE
LSL addr1,Y ;1868
LSR addr1,Y ;1864
NEG addr1,Y ;1860
ORAA addr1,Y ;18AA
ORAB addr1,Y ;18EA
PSHY ;183C
PULY ;1838
ROL addr1,Y ;1869
ROR addr1,Y ;1866
SBCA addr1,Y ;18A2
SBCB addr1,Y ;18E2
STAA addr1,Y ;18A7
STAB addr1,Y ;18E7
STD addr1,Y ;18ED
STS addr1,Y ;CDAF
STX addr1,Y ;CDEF
STY addr1,Y ;18EF
STY addr1,X ;1AEF
STY addr1 ;18FF
STY addr2 ;18FF
SUBA addr1,Y ;18A0
SUBB addr1,Y ;18E0
SUBD addr1,Y ;18A3
TST addr1,Y ;186D
; TEST ;
TSY ;1830 2 NOP 4
TYS ;1835 2 NOP 4
XGDX ;8F 1 NOP 4
XGDY ;188F 2 NOP 4
.end

305
branches/dwg/LSource/src/tasm-src-3.2/Examples/test70.asm

@ -1,305 +0,0 @@
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
; $Id: test70.asm 1.1 1993/08/02 01:24:21 toma Exp $
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
; TASM test file
; Test all instructions and addressing modes.
; Processor: TMS7000
;
R0 .equ 0
R1 .equ 1
R2 .equ 2
R3 .equ 3
R12 .equ 12
R13 .equ 13
R7 .equ 7
data1 .equ $34
data2 .equ $1287
table .equ $1234
P7 .equ 7
.org $f000
start:
ADC B,A
ADC %data1,A
ADC %data1,B
ADC %data1,R7
ADC R12,A
ADC R13,B
ADC R12,R7
ADD B,A
ADD %data1,A
ADD %data1,B
ADD %data1,R7
ADD R12,A
ADD R13,B
ADD R12,R7
AND B,A
AND %data1,A
AND %data1,B
AND %data1,R7
AND R12,A
AND R13,B
AND R12,R7
ANDP A,R7
ANDP B,R7
ANDP %data1,R7
BTJO B,A,start
BTJO %data1,A,start
BTJO %data1,B,start
BTJO %data1,R7,start
BTJO R12,A,start
BTJO R13,B,start
BTJO R12,R7,start
loop1
BTJOP A,P7,loop1
BTJOP B,P7,loop1
BTJOP %data1,P7,loop1
BTJZ B,A,loop1
BTJZ %data1,A,loop1
BTJZ %data1,B,loop1
BTJZ %data1,R7,loop1
BTJZ R12,A,loop1
BTJZ R12,B,loop1
BTJZ R12,R7,loop1
BTJZP A,P7,loop1
BTJZP B,P7,loop1
BTJZP %data1,P7,loop1
BR @start(B)
BR @start[B]
BR @start
BR *R7
CALL @sub1(B)
CALL @sub1
CALL *R7
sub1: CLR A
CLR B
CLR R12
CLRC
CMP B,A
CMP %data1,A
CMP %data1,B
CMP %data1,R7
CMP R12,A
CMP R12,B
CMP R12,R7
CMPA @R7(B)
CMPA @R7[B]
CMPA @R7
CMPA *R7
DAC B,A
DAC %data1,A
DAC %data1,B
DAC %data1,R7
DAC R12,A
DAC R12,B
DAC R12,R7
DEC A
DEC B
DEC R7
DECD A
DECD B
DECD R7
DINT
DJNZ A,loop2
DJNZ B,loop2
DJNZ R12,loop2
DSB B,A
DSB %data1,A
DSB %data1,B
DSB %data1,R7
DSB R12,A
DSB R12,B
DSB R12,R7
EINT
IDLE
INC A
INC B
INC R7
INV A
INV B
INV R7
loop2:
JMP loop2
JC loop2
JEQ loop2
JGE loop2
JGT loop2
JHS loop2
JL loop2
JN loop2
JNC loop2
JNE loop2
JNZ loop2
JP loop2
JPZ loop2
JZ loop2
LDA @table(B)
LDA @table
LDA *R7
LDSP
MOV A,B
MOV B,A
MOV A,R7
MOV B,R7
MOV %data1,A
MOV %data1,B
MOV %data1,R7
MOV R12,A
MOV R12,B
MOV R12,R7
MOVD %data2,R7
MOVD %data2[B],R7
MOVD R12,R7
MOVP A,P7
MOVP B,P7
MOVP %data1,P7
MOVP P7,A
MOVP P7,B
MPY B,A
MPY %data1,A
MPY %data1,B
MPY %data1,R7
MPY R12,A
MPY R12,B
MPY R12,R7
NOP
OR B,A
OR %data1,A
OR %data1,B
OR %data1,R7
OR R12,A
OR R12,B
OR R12,R7
ORP A,P7
ORP B,P7
ORP %data1,P7
POP A
POP B
POP R7
POPST
POP ST
PUSH A
PUSH B
PUSH R7
PUSHST
PUSH ST
RETI
RETS
RL A
RL B
RL R7
RLC A
RLC B
RLC R7
RR A
RR B
RR R7
RRC A
RRC B
RRC R7
SBB B,A
SBB %data1,A
SBB %data1,B
SBB %data1,R7
SBB R12,A
SBB R12,B
SBB R12,R7
SETC
STA @table(B)
STA @table
STA *R7
STSP
SUB B,A
SUB %data1,A
SUB %data1,B
SUB %data1,R7
SUB R12,A
SUB R12,B
SUB R12,R7
SWAP A
SWAP B
SWAP R7
TRAP 0
TRAP 1
TRAP 6
TRAP 12
TRAP 23
TST A
TSTA
TST B
TSTB
XCHB A
XCHB R7
XOR B,A
XOR %data1,A
XOR %data1,B
XOR %data1,R7
XOR R12,A
XOR R12,B
XOR R12,R7
XORP A,P7
XORP B,P7
XORP %data1,P7
.end

0
branches/dwg/LSource/src/tasm-src-3.2/Examples/test80.lst

0
branches/dwg/LSource/src/tasm-src-3.2/Examples/test80.obj

294
branches/dwg/LSource/src/tasm-src-3.2/Examples/test85.asm

@ -1,294 +0,0 @@
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
; $Id: test85.asm 1.1 1993/08/02 01:24:21 toma Exp $
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
; TASM test file
; Test all instructions and addressing modes.
; Processor: 8080/8085
;
idata16 .equ 1234h
idata8 .equ 12h
port .equ 34h
addr16 .equ 5678h
.org 1000h
start:
nop
lxi b,idata16
stax b
inx b
inr b
dcr b
mvi b,idata8
rlc
dad b
ldax b
dcx b
inr c
dcr c
mvi c,idata8
rrc
; --- ; 10
lxi d,idata16
stax d
inx d
inr d
dcr d
mvi d,idata8
ral
; ---
dad d
ldax d
dcx d
inr e
dcr e
mvi e,idata8
rar
rim ; 20
lxi h,idata16
shld addr16
inx h
inr h
dcr h
mvi h,idata8
daa
; ---
dad h
lhld addr16
dcx h
inr l
dcr l
mvi l,idata8
cma
sim ; 30
lxi sp,idata16
sta addr16
inx sp
inr m
dcr m
mvi m,idata8
stc
; ---
dad sp
lda addr16
dcx sp
inr a
dcr a
mvi a,idata8
cmc
mov b,b ; 40
mov b,c
mov b,d
mov b,e
mov b,h
mov b,l
mov b,m
mov b,a
mov c,b
mov c,c
mov c,d
mov c,e
mov c,h
mov c,l
mov c,m
mov c,a
mov d,b ; 50
mov d,c
mov d,d
mov d,e
mov d,h
mov d,l
mov d,m
mov d,a
mov e,b
mov e,c
mov e,d
mov e,e
mov e,h
mov e,l
mov e,m
mov e,a
mov h,b ; 60
mov h,c
mov h,d
mov h,e
mov h,h
mov h,l
mov h,m
mov h,a
mov l,b
mov l,c
mov l,d
mov l,e
mov l,h
mov l,l
mov l,m
mov l,a
mov m,b ; 70
mov m,c
mov m,d
mov m,e
mov m,h
mov m,l
hlt
mov m,a
mov a,b
mov a,c
mov a,d
mov a,e
mov a,h
mov a,l
mov a,m
mov a,a
add b ; 80
add c
add d
add e
add h
add l
add m
add a
adc b ; 88
adc c
adc d
adc e
adc h
adc l
adc m
adc a
sub b ; 90
sub c
sub d
sub e
sub h
sub l
sub m
sub a
sbb b ; 98
sbb c
sbb d
sbb e
sbb h
sbb l
sbb m
sbb a
ana b ; a0
ana c
ana d
ana e
ana h
ana l
ana m
ana a
xra b ; a8
xra c
xra d
xra e
xra h
xra l
xra m
xra a
ora b ; b0
ora c
ora d
ora e
ora h
ora l
ora m
ora a
cmp b ; b8
cmp c
cmp d
cmp e
cmp h
cmp l
cmp m
cmp a
rnz ; c0
pop b
jnz start
jmp start
cnz start
push b
adi idata8
rst 0
rz
ret
jz start
; ---
cz start
call start
aci idata8
rst 1
rnc ; d0
pop d
jnc start
out port
cnc start
push d
sui idata8
rst 2
rc
; ---
jc start
in port
cc start
; ---
sbi idata8
rst 3
rpo ; e0
pop h
jpo start
xthl
cpo start
push h
ani idata8
rst 4
rpe
pchl
jpe start
xchg
cpe start
; ---
xri idata8
rst 5
rp ; f0
pop psw
jp start
di
cp start
push psw
ori idata8
rst 6
rm
sphl
jm start
ei
cm start
; ---
cpi idata8
rst 7
.END

887
branches/dwg/LSource/src/tasm-src-3.2/Examples/test96.asm

@ -1,887 +0,0 @@
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
; $Id: test96.asm 1.1 1997/11/23 15:51:20 toma Exp $
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
; TASM test file
; Test all instructions and addressing modes.
; Processor: 8096/8XC196KC
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;
; CPU "8096.TBL" ; CPU TABLE
; HOF "INT8" ; HEX FORMAT
#define EQU .equ
#define END .end
#define ORG .org
#define DWL .dw
#define IF #if
#define ENDI #endif
wreg: EQU 12h ; word register even address
wreg1: EQU 22h ; word register even address
wreg2: EQU 32h ; word register even address
wreg3: EQU 42h ; word register even address
lreg1: EQU 44h ; long register (32 bit)
lreg2: EQU 48h ; long register (32 bit)
breg: EQU wreg+1 ; low byte of reg. where odd is allowed
breg1: EQU wreg+3 ; low byte of reg. where odd is allowed
breg2: EQU wreg+5 ; low byte of reg. where odd is allowed
breg3: EQU wreg+7 ; low byte of reg. where odd is allowed
imm8: EQU 88H
imm16: EQU 4321H
addr8: EQU 12H
addr16: EQU 3456H
ishort: EQU 12H
ishrt: EQU 12H
ilong: EQU 4567H
count: EQU 7H
ORG 7418h
dtable: DWL $1234
DWL $5678
DWL $1234
;-------------------------------------
; ADD
add wreg1,#imm8
add wreg1,#imm16
add wreg1,wreg2
add wreg1,addr16
add wreg1,[wreg2]
add wreg1,[wreg2]+
add wreg1,addr8[wreg2]
add wreg1,addr16[wreg2]
add wreg1,wreg2,#imm8
add wreg1,wreg2,#imm16
add wreg1,wreg2,wreg3
add wreg1,wreg2,addr16
add wreg1,wreg2,[wreg3]
add wreg1,wreg2,[wreg3]+
add wreg1,wreg2,addr8[wreg3]
add wreg1,wreg2,addr16[wreg3]
;-------------------------------------
;-------------------------------------
; ADDB
addb breg1,#imm8
addb breg1,breg2
addb breg1,addr16
addb breg1,[wreg2]
addb breg1,[wreg2]+
addb breg1,addr8[wreg2]
addb breg1,addr16[wreg2]
addb breg1,breg2,#imm8
addb breg1,breg2,breg3
addb breg1,breg2,addr16
addb breg1,breg2,[wreg3]
addb breg1,breg2,[wreg3]+
addb breg1,breg2,addr8[wreg3]
addb breg1,breg2,addr16[wreg3]
;-------------------------------------
;-------------------------------------
; ADDB
addc wreg1,#imm8
addc wreg1,#imm16
addc wreg1,wreg2
addc wreg1,addr16
addc wreg1,[wreg2]
addc wreg1,[wreg2]+
addc wreg1,addr8[wreg2]
addc wreg1,addr16[wreg2]
; No three arg form for addc
;-------------------------------------
;-------------------------------------
; ADDCB
addcb breg1,#imm8
addcb breg1,breg2
addcb breg1,addr16
addcb breg1,[wreg2]
addcb breg1,[wreg2]+
addcb breg1,addr8[wreg2]
addcb breg1,addr16[wreg2]
; No three arg form for addcb
;-------------------------------------
;-------------------------------------
; AND
and wreg1,#imm8
and wreg1,#imm16
and wreg1,wreg2
and wreg1,addr16
and wreg1,[wreg2]
and wreg1,[wreg2]+
and wreg1,addr8[wreg2]
and wreg1,addr16[wreg2]
and wreg1,wreg2,#imm8
and wreg1,wreg2,#imm16
and wreg1,wreg2,wreg3
and wreg1,wreg2,addr16
and wreg1,wreg2,[wreg3]
and wreg1,wreg2,[wreg3]+
and wreg1,wreg2,addr8[wreg3]
and wreg1,wreg2,addr16[wreg3]
;-------------------------------------
;-------------------------------------
; ANDB
andb breg1,#imm8
andb breg1,breg2
andb breg1,addr16
andb breg1,[wreg2]
andb breg1,[wreg2]+
andb breg1,addr8[wreg2]
andb breg1,addr16[wreg2]
andb breg1,breg2,#imm8
andb breg1,breg2,breg3
andb breg1,breg2,addr16
andb breg1,breg2,[wreg3]
andb breg1,breg2,[wreg3]+
andb breg1,breg2,addr8[wreg3]
andb breg1,breg2,addr16[wreg3]
;-------------------------------------
;-------------------------------------
; BMOV
bmov lreg1,wreg1
bmov lreg1,wreg2
;-------------------------------------
;-------------------------------------
; BR
br [wreg1]
;-------------------------------------
;-------------------------------------
; MISC CLR
clr wreg1
clrb breg1
clrc
clrvt
;-------------------------------------
;-------------------------------------
; CMP
cmp wreg1,#imm8
cmp wreg1,#imm16
cmp wreg1,wreg2
cmp wreg1,addr16
cmp wreg1,[wreg2]
cmp wreg1,[wreg2]+
cmp wreg1,addr8[wreg2]
cmp wreg1,addr16[wreg2]
; No three arg form for cmp
;-------------------------------------
;-------------------------------------
; CMPB
cmpb breg1,#imm8
cmpb breg1,breg2
cmpb breg1,addr16
cmpb breg1,[wreg2]
cmpb breg1,[wreg2]+
cmpb breg1,addr8[wreg2]
cmpb breg1,addr16[wreg2]
; No three arg form for cmpb
;-------------------------------------
;-------------------------------------
; CMPL
cmpl lreg1,lreg2
;-------------------------------------
;-------------------------------------
; DEC
dec wreg1
decb breg1
;-------------------------------------
;-------------------------------------
; DEC
di
;-------------------------------------
;-------------------------------------
; DIV
div lreg1,#imm8
div lreg1,#imm16
div lreg1,wreg2
div lreg1,addr16
div lreg1,[wreg2]
div lreg1,[wreg2]+
div lreg1,addr8[wreg2]
div lreg1,addr16[wreg2]
; No three arg form for div
;-------------------------------------
;-------------------------------------
; DIVB
divb wreg1,#imm8
divb wreg1,breg2
divb wreg1,addr16
divb wreg1,[wreg2]
divb wreg1,[wreg2]+
divb wreg1,addr8[wreg2]
divb wreg1,addr16[wreg2]
; No three arg form for divb
;-------------------------------------
;-------------------------------------
; DIVU
divu lreg1,#imm8
divu lreg1,#imm16
divu lreg1,wreg2
divu lreg1,addr16
divu lreg1,[wreg2]
divu lreg1,[wreg2]+
divu lreg1,addr8[wreg2]
divu lreg1,addr16[wreg2]
; No three arg form for divu
;-------------------------------------
;-------------------------------------
; DIVUB
divub wreg1,#imm8
divub wreg1,breg2
divub wreg1,addr16
divub wreg1,[wreg2]
divub wreg1,[wreg2]+
divub wreg1,addr8[wreg2]
divub wreg1,addr16[wreg2]
; No three arg form for divub
;-------------------------------------
;-------------------------------------
; DJNZ
rtest1: ;backward reference
djnz breg1,rtest1
djnz breg1,rtest1
djnz breg1,rtest2
djnz breg1,rtest2
rtest2: ;forward reference
;-------------------------------------
;-------------------------------------
; DJNZW
djnzw wreg1,rtest1
djnzw wreg1,rtest1
djnzw wreg1,rtest3
djnzw wreg1,rtest3
rtest3: ;forward reference
;-------------------------------------
;-------------------------------------
; DPTS
dpts
;-------------------------------------
;-------------------------------------
; EI
ei
;-------------------------------------
;-------------------------------------
; EPTS
epts
;-------------------------------------
;-------------------------------------
; EXT & EXTB
ext lreg1
ext lreg2
extb wreg1
extb wreg2
;-------------------------------------
;-------------------------------------
; IDLPD
idlpd #1
idlpd #2
;-------------------------------------
;-------------------------------------
; INC & INCB
inc wreg1
inc wreg2
incb breg1
incb breg2
;-------------------------------------
FLAG: EQU 3
;-------------------------------------
; JBC
jbc breg1,0,rtest1
jbc breg1,1,rtest1
jbc breg1,2,rtest1
jbc breg1,3,rtest1
jbc breg1,4,rtest1
jbc breg1,5,rtest1
jbc breg1,6,rtest1
jbc breg1,7,rtest1
;-------------------------------------
;-------------------------------------
; JBS
jbs breg1,0,rtest1
jbs breg1,1,rtest1
jbs breg1,2,rtest1
jbs breg1,3,rtest1
jbs breg1,4,rtest1
jbs breg1,5,rtest1
jbs breg1,6,rtest1
jbs breg1,7,rtest1
;-------------------------------------
;-------------------------------------
; MISC Jump backward
jc rtest1
je rtest1
jge rtest1
jgt rtest1
jh rtest1
jle rtest1
jlt rtest1
jnc rtest1
jne rtest1
jnh rtest1
jnst rtest1
jnv rtest1
jnvt rtest1
jst rtest1
jv rtest1
jvt rtest1
;-------------------------------------
;-------------------------------------
; MISC Jump forward
jc rtest4
je rtest4
jge rtest4
jgt rtest4
jh rtest4
jle rtest4
jlt rtest4
jnc rtest4
jne rtest4
jnh rtest4
jnst rtest4
jnv rtest4
jnvt rtest4
jst rtest4
jv rtest4
rtest4: jvt rtest4
;-------------------------------------
;-------------------------------------
; LCALL
lcall rtest1
lcall rtest2
lcall rtest4
lcall addr8
lcall addr16
;-------------------------------------
;-------------------------------------
; LD
ld wreg1,#imm8
ld wreg1,#imm16
ld wreg1,wreg2
ld wreg1,addr16
ld wreg1,[wreg2]
ld wreg1,[wreg2]+
ld wreg1,addr8[wreg2]
ld wreg1,addr16[wreg2]
; No three arg form for ld
;-------------------------------------
;-------------------------------------
; LDB
ldb breg1,#imm8
ldb breg1,breg2
ldb breg1,addr16
ldb breg1,[wreg2]
ldb breg1,[wreg2]+
ldb breg1,addr8[wreg2]
ldb breg1,addr16[wreg2]
; No three arg form for ldb
;-------------------------------------
;-------------------------------------
; LDBSE
ldbse wreg1,#imm8
ldbse wreg1,breg2
ldbse wreg1,addr16
ldbse wreg1,[wreg2]
ldbse wreg1,[wreg2]+
ldbse wreg1,addr8[wreg2]
ldbse wreg1,addr16[wreg2]
; No three arg form for ldbse
;-------------------------------------
;-------------------------------------
; LDBZE
ldbze wreg1,#imm8
ldbze wreg1,breg2
ldbze wreg1,addr16
ldbze wreg1,[wreg2]
ldbze wreg1,[wreg2]+
ldbze wreg1,addr8[wreg2]
ldbze wreg1,addr16[wreg2]
; No three arg form for ldbze
;-------------------------------------
;-------------------------------------
; LJMP
ljmp addr8
ljmp addr16
;-------------------------------------
;-------------------------------------
; MUL
mul lreg1,#imm8
mul lreg1,#imm16
mul lreg1,wreg2
mul lreg1,addr16
mul lreg1,[wreg2]
mul lreg1,[wreg2]+
mul lreg1,addr8[wreg2]
mul lreg1,addr16[wreg2]
mul lreg1,wreg2,#imm8
mul lreg1,wreg2,#imm16
mul lreg1,wreg2,wreg3
mul lreg1,wreg2,addr16
mul lreg1,wreg2,[wreg3]
mul lreg1,wreg2,[wreg3]+
mul lreg1,wreg2,addr8[wreg3]
mul lreg1,wreg2,addr16[wreg3]
;-------------------------------------
;-------------------------------------
; MULB
mulb wreg1,#imm8
mulb wreg1,breg2
mulb wreg1,addr16
mulb wreg1,[wreg2]
mulb wreg1,[wreg2]+
mulb wreg1,addr8[wreg2]
mulb wreg1,addr16[wreg2]
mulb wreg1,breg2,#imm8
mulb wreg1,breg2,breg3
mulb wreg1,breg2,addr16
mulb wreg1,breg2,[wreg3]
mulb wreg1,breg2,[wreg3]+
mulb wreg1,breg2,addr8[wreg3]
mulb wreg1,breg2,addr16[wreg3]
;-------------------------------------
;-------------------------------------
; MULU
mulu lreg1,#imm8
mulu lreg1,#imm16
mulu lreg1,wreg2
mulu lreg1,addr16
mulu lreg1,[wreg2]
mulu lreg1,[wreg2]+
mulu lreg1,addr8[wreg2]
mulu lreg1,addr16[wreg2]
mulu lreg1,wreg2,#imm8
mulu lreg1,wreg2,#imm16
mulu lreg1,wreg2,wreg3
mulu lreg1,wreg2,addr16
mulu lreg1,wreg2,[wreg3]
mulu lreg1,wreg2,[wreg3]+
mulu lreg1,wreg2,addr8[wreg3]
mulu lreg1,wreg2,addr16[wreg3]
;-------------------------------------
;-------------------------------------
; MULUB
mulub wreg1,#imm8
mulub wreg1,breg2
mulub wreg1,addr16
mulub wreg1,[wreg2]
mulub wreg1,[wreg2]+
mulub wreg1,addr8[wreg2]
mulub wreg1,addr16[wreg2]
mulub wreg1,breg2,#imm8
mulub wreg1,breg2,breg3
mulub wreg1,breg2,addr16
mulub wreg1,breg2,[wreg3]
mulub wreg1,breg2,[wreg3]+
mulub wreg1,breg2,addr8[wreg3]
mulub wreg1,breg2,addr16[wreg3]
;-------------------------------------
;-------------------------------------
; NEG & NEGB
neg wreg1
negb breg1
;-------------------------------------
;-------------------------------------
; NOP
nop
;-------------------------------------
;-------------------------------------
; NORML
norml lreg1,breg1
;-------------------------------------
;-------------------------------------
; NOT & NOTB
not wreg1
notb breg1
;-------------------------------------
;-------------------------------------
; OR
or wreg1,#imm8
or wreg1,#imm16
or wreg1,wreg2
or wreg1,addr16
or wreg1,[wreg2]
or wreg1,[wreg2]+
or wreg1,addr8[wreg2]
or wreg1,addr16[wreg2]
; No three arg form for or
;-------------------------------------
;-------------------------------------
; ORB
orb breg1,#imm8
orb breg1,breg2
orb breg1,addr16
orb breg1,[wreg2]
orb breg1,[wreg2]+
orb breg1,addr8[wreg2]
orb breg1,addr16[wreg2]
; No three arg form for orb
;-------------------------------------
;-------------------------------------
; POP
pop wreg1
pop [wreg1]
pop [wreg1]+
pop addr8[wreg1]
pop addr16[wreg1]
popa
popf
;-------------------------------------
;-------------------------------------
; PUSH
push wreg1
push [wreg1]
push [wreg1]+
push addr8[wreg1]
push addr16[wreg1]
pusha
pushf
;-------------------------------------
;-------------------------------------
; RET - return
ret
;-------------------------------------
;-------------------------------------
; RST - reset
rst
;-------------------------------------
;-------------------------------------
; SCALL - short call
scall1:
scall2: EQU scall1-1015
scall scall1
scall scall1
scall scall2
scall scall2
scall scall3
scall scall4
scall3:
scall4: EQU scall3+1020
;-------------------------------------
;-------------------------------------
; SETC - set carry
setc
;-------------------------------------
;-------------------------------------
; shl - shift word left
shl wreg1,#count
shl wreg2,breg1
;-------------------------------------
;-------------------------------------
; shlb - shift byte left
shlb breg1,#count
shlb breg2,breg1
;-------------------------------------
;-------------------------------------
; shll - shift long word left
shll lreg1,#count
shll lreg1,breg1
;-------------------------------------
;-------------------------------------
; shr - logical shift word right
shr wreg1,#count
shr wreg2,breg1
;-------------------------------------
;-------------------------------------
; shra - arithmetic shift word right
shra wreg1,#count
shra wreg2,breg1
;-------------------------------------
;-------------------------------------
; shrab - arithmetic shift byte right
shrab breg1,#count
shrab breg2,breg1
;-------------------------------------
;-------------------------------------
; shral - arithmetic shift long word right
shral lreg1,#count
shral lreg1,breg1
;-------------------------------------
;-------------------------------------
; shrb - logical shift byte right
shrb breg1,#count
shrb breg2,breg1
;-------------------------------------
;-------------------------------------
; shrl - logical shift long word right
shrl lreg1,#count
shrl lreg1,breg1
;-------------------------------------
;-------------------------------------
; SJMP - short jump
sjump1:
sjump2: EQU sjump1-1015
sjmp sjump1
sjmp sjump1
sjmp sjump2
sjmp sjump2
sjmp sjump3
sjmp sjump4
sjump3:
sjump4: EQU sjump3+1020
;-------------------------------------
;-------------------------------------
; skip - two byte nop
skip breg1
;-------------------------------------
;-------------------------------------
; ST - store word
st wreg1,wreg2
st wreg1,addr16
st wreg1,[wreg2]
st wreg1,[wreg2]+
st wreg1,addr8[wreg2]
st wreg1,addr16[wreg2]
; No three arg form for st; No immediate
;-------------------------------------
;-------------------------------------
; STB - store byte
stb breg1,breg2
stb breg1,addr16
stb breg1,[wreg2]
stb breg1,[wreg2]+
stb breg1,addr8[wreg2]
stb breg1,addr16[wreg2]
; No three arg form for stb; No immediate
;-------------------------------------
;-------------------------------------
; SUB - subtract word
sub wreg1,#imm8
sub wreg1,#imm16
sub wreg1,wreg2
sub wreg1,addr16
sub wreg1,[wreg2]
sub wreg1,[wreg2]+
sub wreg1,addr8[wreg2]
sub wreg1,addr16[wreg2]
sub wreg1,wreg2,#imm8
sub wreg1,wreg2,#imm16
sub wreg1,wreg2,wreg3
sub wreg1,wreg2,addr16
sub wreg1,wreg2,[wreg3]
sub wreg1,wreg2,[wreg3]+
sub wreg1,wreg2,addr8[wreg3]
sub wreg1,wreg2,addr16[wreg3]
;-------------------------------------
;-------------------------------------
; SUBB - subtract byte
subb breg1,#imm8
subb breg1,breg2
subb breg1,addr16
subb breg1,[wreg2]
subb breg1,[wreg2]+
subb breg1,addr8[wreg2]
subb breg1,addr16[wreg2]
subb breg1,breg2,#imm8
subb breg1,breg2,breg3
subb breg1,breg2,addr16
subb breg1,breg2,[wreg3]
subb breg1,breg2,[wreg3]+
subb breg1,breg2,addr8[wreg3]
subb breg1,breg2,addr16[wreg3]
;-------------------------------------
;-------------------------------------
; SUBC - subtract word with carry
subc wreg1,#imm8
subc wreg1,#imm16
subc wreg1,wreg2
subc wreg1,addr16
subc wreg1,[wreg2]
subc wreg1,[wreg2]+
subc wreg1,addr8[wreg2]
subc wreg1,addr16[wreg2]
; No three arg form for subc
;-------------------------------------
;-------------------------------------
; SUBCB - subtract byte with carry
subcb breg1,#imm8
subcb breg1,breg2
subcb breg1,addr16
subcb breg1,[wreg2]
subcb breg1,[wreg2]+
subcb breg1,addr8[wreg2]
subcb breg1,addr16[wreg2]
; No three arg form for subcb
;-------------------------------------
;-------------------------------------
; tijmp - table indirect jump
tijmp wreg1,[wreg2],#imm8
tijmp wreg2,[wreg1],#imm8
tijmp wreg3,[wreg2],#13
;-------------------------------------
;-------------------------------------
; TRAP - software trap
trap
;-------------------------------------
;-------------------------------------
; XCH - exchange word
xch wreg1,wreg2
xch wreg1,addr16
xch wreg1,addr8[wreg2]
xch wreg1,addr16[wreg2]
;-------------------------------------
;-------------------------------------
; XCHB - exchange byte
xchb breg1,breg2
xchb breg1,addr16
xchb breg1,addr8[wreg2]
xchb breg1,addr16[wreg2]
;-------------------------------------
;-------------------------------------
; XOR
xor wreg1,#imm8
xor wreg1,#imm16
xor wreg1,wreg2
xor wreg1,addr16
xor wreg1,[wreg2]
xor wreg1,[wreg2]+
xor wreg1,addr8[wreg2]
xor wreg1,addr16[wreg2]
; No three arg form for xor
;-------------------------------------
;-------------------------------------
; XORB
xorb breg1,#imm8
xorb breg1,breg2
xorb breg1,addr16
xorb breg1,[wreg2]
xorb breg1,[wreg2]+
xorb breg1,addr8[wreg2]
xorb breg1,addr16[wreg2]
; No three arg form for xorb
;-------------------------------------
END

Some files were not shown because too many files changed in this diff

Loading…
Cancel
Save