home *** CD-ROM | disk | FTP | other *** search
- Hello Folks;
-
- Here is my first update to the archive that I recently presented. I've
- fixed a couple of the errors that I recently found. I also added a couple
- more things, such as the internal stack, and a bit more documentation.
- These files a very basic example of interfacing C++ and assembler. I've
- made use of the Borland PowerPack in a very basic manner. I really haven't
- used Borland's 32RTM for DPMI or their DPMI server for that long. However,
- with what little bit I have used it, I've found it really nice to work with.
- It's hard to crash, and has a ton of features.
-
- In these files, I've tried to show a variety of means of transferring data
- between a C++ and assembler module. When using a memory model other than
- "flat", of course "far" pointers should be used. However the basic layout
- of the structured data should remain basically the same. When doing this
- type of transfer, keep in mind the fact that all the modules, will be
- incorporated into one, once they are linked.
-
- You'll notice an "oddity" amongst these files, called "mak.bat". This is
- something that I've done for quite some time. It's sort of a twisted way of
- doing a "Make". I work at the command line a lot, and find it simpler for
- such an "intermediate" type build as these files require. I create the
- mak.bat file with a simple echo of my command line(the first time) to a .bat
- file of this or similiar name.
-
- There are numerous ways to go about addressing the issues that I've dealt
- with here. These code samples are an example of one of the ways that "I" go
- about it. I feel that it's certainly a programmer's perogative to code in
- their own fashion. That being said, don't take the code that I've put
- together here, as being the "standard" or even what most might concider
- the "proper" way to go about this type of thing.
-
- Since this code does run in protected mode, it will take a little while to
- load, so be patient. Borland's DPMI 32-bit RTM is required to be in your path
- (it's included in this archive) for these files to run. Doing such trivial
- stuff as this, in protected mode is a bit silly. I use it here as an example that
- you can expand on. I also wanted show to those who might not be aware of it,
- how seamlessly Borland's PowerPack products integrate with regular coding.
-
- Some of the issues that I hope to deal with at a later date are:
-
- 1.) Very basic means of accessing assembler from a "C" module (real mode),
- as well as the reverse of that.
-
- 2.) Placing "main" in the assembler module, and then accessing the "C" module
- from there.
-
- 3.) More "playing" with the Power Pack, as far as transferring huge
- buffers between assembler, C, C++, and disk files. For those who
- haven't used the Power Packs virtual memory functions, I'll try and do
- some of that too.
-
- 4.) Accessing Class members of various type classes from an assembler module.
-
- 5.) There isn't much differenc between how I've done things here with
- "simplified directives" and defining one's own segments. I may do some
- samples in that style at some point.
-
- I don't really know if there is too much I can do with this subject, but
- since there seems to be so many questions regarding it in the open forum, I
- figured I'd give this a try. This is at least something more complete, than
- you might get from a simple response to a forum message. It's something
- that can be viewed at one's leisure.
-
- Good Luck!
- Tim Van Dusen
-