Dr. Dobb's is part of the Informa Tech Division of Informa PLC

This site is operated by a business or businesses owned by Informa PLC and all copyright resides with them. Informa PLC's registered office is 5 Howick Place, London SW1P 1WG. Registered in England and Wales. Number 8860726.

Channels ▼




More on ASPI

Dear DDJ,

Brian Sawert's article "The Advanced SCSI Programming Interface" (DDJ, March 1994) was both readable and useful--especially the C examples for using ASPI. I'd like to add some information about ASPI host managers and how they fit into the scheme of things, at least under DOS.

Adaptec has an SDK manual with source-code diskette, available to companies or individuals who have joined Adaptec's ACAP (Adaptec Compatibility Advantage Program). Contact Kristi Rinehart at Adaptec (408-945-8600) for more details. The materials include a MASM program showing how to use ASPI under DOS, a C program and headers showing how to use ASPI under Windows through Adaptec's WINASPI.DLL, and comparable information for using ASPI under OS/2 and Novell NetWare.

As far as I know, only Adaptec has a Windows DLL, WINASPI.DLL, for using ASPI with the ASPI host managers that are paired with the various Adaptec SCSI host adapters. This approach avoids using DPMI and also depends on the availability of an undocumented extension to ASPI, as described in released Adaptec materials. Only WINASPI.DLL--not your Windows app--needs to use the undocumented ASPI stuff. I'm pretty certain that WINASPI.DLL also requires that the ASPI host manager be capable of executing either in real or protected mode, which would make ASPI run a lot faster than via DPMI with its necessary switching from protected to real mode and back again.

Although not necessarily a complete list, the following vendors do supply ASPI host managers, a prerequisite for any ASPI programming, with their SCSI host adapters: Adaptec, Advanced Integration Research (AIR), Alpha Research, Always Technology, American Megatrends (AMI), BusLogic, Distributed Processing Technology, DTC, Future Domain, LinkSys, Trantor (now a fully owned Adaptec subsidiary), and UltraStor. In addition, Corel includes the IBMASPI.SYS ASPI host manager for DOS in Version 2.0 of CorelSCSI. This device driver is for the SCSI host adapters that are primarily in IBM's PS/2 Micro Channel computers. In summary, ASPI has become fairly ubiquitous in the SCSI world, since the above list probably covers more than 99 percent of all SCSI host adapters in the personal computing universe.

The ASPI specification provides for true overlapping of SCSI I/O with CPU-intensive processes, even under monotasking DOS, but requires a bus-mastering SCSI host adapter to really do it. The documented ASPI mechanism for doing so is called "posting." You put a nonzero segment:offset of a callback address in the SRB, and your program gets control there when the I/O is completed or posted. (A zero callback address causes the ASPI host manager to complete the SCSI I/O before returning to your program.) A word of caution: An ASPI manager for a non-bus-mastering device (such as parallel-port SCSI or the PIO Adaptec 1522) executes the SRB to completion, then gives your program control at the callback address. In other words, the sequencing between callback and return to your program may vary among ASPI host managers.

Ben Myers

Spirit of Performance

Harvard, Massachusetts

Post-Compile Optimization

Dear DDJ,

In his article, "Examining OPTLINK for Windows" (DDJ, November 1993), Matt Pietrek did an excellent job of comparing the optimization capabilities of SLR's OPTLINK with Microsoft's LINK and Borland's TLINK.

It should be noted that any code optimizations beyond those listed in the article would require the complete disassembly, adjustment, and reassembly of the input machine code and symbol tables. PC_Opt, a post-compile optimization tool I've developed, performs such additional optimizations.

In its present form, PC_Opt performs far-to-near procedure conversion, register parameter-passing conversion, stack-clearing conversion, and unaccessed-code elimination on MS-DOS OMF-compatible object modules and libraries. The resultant size and speed improvements vary, depending on the application being optimized.

Although PC_Opt (which sells for $15.00 plus $5.00 shipping and handling) lacks the features and flexibility of the tools Matt discussed, it does operate within levels of reliability and ease-of-use, which sufficiently demonstrates that a post-compile complete, object-code optimization step should be considered as an integral part in any worthy software-development environment.

Jim Taylor

Optimite Systems

Dallas, Texas


Dear DDJ,

I enjoyed Tom Swan's "Algorithm Alley" column on palindromic encryption (DDJ, November 1993) and the subsequent letters from readers contributing their own palindromes. Some years ago, I worked with a fellow who had previously been employed by Mostek (remember them?) and hated the company with all his heart and soul. For his edification, I composed this palindrome: Market some Mostek RAM. Thanks for an interesting article.

Harold M. Martin

Bellaire, Texas

That Looks Familiar

Dear DDJ,

I noticed something very familiar on your January 1994 cover: one of my company's products. The red-striped mainframe is an Amdahl 5995-a1400mp. Like many DDJ readers, I have an eye for detail. When looking for the note as to where this cover was taken (Apple Computer's data center), I noticed no mention of the type or manufacturer of the mainframe.

Of course, being an Amdahl employee, I'm always looking for defense of our mainframe-vendor honor. It's amusing to me that in the midst of all this PC and workstation hype, Apple has a big Amdahl mainframe in their data center. Yes, I'm nitpicking, but to hear the PC trade journals tell, the mainframe is dead and buried. We, as a company, are and will be getting smaller, as many businesses are today. But mainframes still carry the major work loads for business and industry. We are still selling and improving them. As speeds improve in CMOS technology to what mainframe ECL logic is capable of, all computers will get smaller. In the same light, as PC and workstation platforms learn to use "RAS" (reliability, availability, serviceability) and multiprocessing as mainframes do, the great fissure between the two camps will look like a drainage ditch for the runoff of the companies that can't keep up with change in user direction.

Michael R. Bonuchi

Chicago, Illinois

Forth Corrections

Dear DDJ,

Thanks for publishing my letter in the March 1994 issue of Dr. Dobb's Journal. Unfortunately, there were a couple of errors in Example 2 on page 12. Example 1 here is a revised, corrected version.

William E. Drissel

Grand Prairie, Texas

Prior Patents

Dear DDJ,

In his March 1994 "C Programming" column, Al Stevens discussed a patent (#4.540.292) for an electronic calendar display that's owned by Psytronics of Princeton, NJ.

I wrote a program in 1977 to "electronically" display and print calendars in conventional paper form. I later mailed it to D.E. Cortesi, Dr. Dobb's resident intern. He published it in the July 1981 "Dr. Dobb's Clinic" column on page 42. Because the typesetter left off the "<" and ">" symbols, the program was published again several months later.

I have no idea when Psytronics applied for their patent, but if it was after the July 1981 issue, couldn't the published article be used to establish prior art?

In any event, Al was correct. Granting the patent was absurd.

L. Barker

Chicago, Illinois

Galileo! Newton! Where Are You When We Need You?

Dear DDJ,

This is regarding Peter Varhol's review of Bart Kosko's book Fuzzy Thinking (DDJ, November 1993).

All this talk about multistate logic puts me in mind of a fad prominent with science-fiction writers circa 1940: They called it "non-Aristotelian logic" and abbreviated it null-A. There was a whole line of "Null-A" stories by Heinlein, Asimov, and the like.

Or does "fuzzy" mean nonlinear? Or probabilistic? Or analog? Or precisely what? I must say, it's aptly named--it's all so fuzzy. Is the wheel being reinvented? In light of all this fuzzy thinking, Galileo's observation that "the universe is written in the language of mathematics" bears repeating. Galileo, where are you when we need you?

One can empathize with the author's disillusionment with "the complexities of nonlinear mathematics," but there exists a little-known mathematical discipline called "relaxation analysis" that enables relaxation oscillations and other broken and finitely discontinuous functions to be handled directly in the time domain with ease and aplomb--allowing them to be readily differentiated and integrated, among other things. (See my book, Waveforms: A Modern Guide to Nonsinusoidal Waves and Nonlinear Processes, Prentice-Hall, 1986.) Thus, some seemingly intractable problems of writing analytic expressions for the nonsinusoidal functions often encountered in electronics and other walks of life are easily handled. For example, Figure 1(a) shows the integral of the AC component of a full-wave rectified sinusoid; in this case, a cosine wave. Try graphing it using Basic or whatever, and you'll see the skewed sinuous wave typical of the incompletely filtered output of a full-wave rectified sinusoid. The curve is not sinusoidal, but you have to look closely to see that! If you have a CGA (or better) card and a pipeable Basic on path (such as GWBASIC 3.22), you can graph it using the command in Figure 1(b) at the DOS prompt.

Still, whatever gets you thinking is cool. Long live fuzzy!

As for Michael Swaine's "Swaine's Flames" in the same issue, "the model is the thing" is a case in point of "familiarity breeds contempt." In this case, familiarity with the model breeds contempt for the real thing, and the model then becomes the real thing in one's thinking. I thought Sir Isaac Newton got mankind out of that destructive loop long ago.

Before Newton's extended use of the scientific method of experimentation, many wise men were convinced they could uncover all the secrets of the universe by simply reasoning about them. Boy, did that get us off track!

No, the model is not the real thing, any more than The Nightmare Before Christmas is the real world. And thinking it is represents a reversion to earlier times in which superstition ruled supreme. Lord deliver us from a revisitation of those times.

Sir Isaac, where are you when we need you?

Homer Tilton

Tucson, Arizona

Example 1: A Forth text interpreter, compiler, and debugger in pseudocode.

forever {
  get the next word (delimited by
  look it up in the dictionary
  if found
    if we are compiling
      if the word is immediate
        execute the word
        "compile" the word into the
      execute the word
   else //(not found, must be a number
                        or undefined)
    if it's a number
      if we're compiling
        "compile" a literal into the
         push the number onto the stack
       send word followed by "?" to
       stop compiling
       flush interpreter input buffer
       accept future input from keyboard
} // end of forever

Figure 1: (a) A cosine wave; (b) Basic command graphing a full-wave rectified sinusoid.

(a)  {_COS(X)_--2/PI}=SIN(ATN(TAN(X)))--(2/PI)ATN(TAN(X))+constant

(b)  Echo h=6.28:v=1:screen 2:for j=0 to 600:x=h*(j/300- 1):Q=atn(tan(x))

:y=sin(Q)-.64*Q:pset(j,100-95*y/v):next:wait 96,2|GWBASIC

Copyright © 1994, Dr. Dobb's Journal

Related Reading

More Insights

Currently we allow the following HTML tags in comments:

Single tags

These tags can be used alone and don't need an ending tag.

<br> Defines a single line break

<hr> Defines a horizontal line

Matching tags

These require an ending tag - e.g. <i>italic text</i>

<a> Defines an anchor

<b> Defines bold text

<big> Defines big text

<blockquote> Defines a long quotation

<caption> Defines a table caption

<cite> Defines a citation

<code> Defines computer code text

<em> Defines emphasized text

<fieldset> Defines a border around elements in a form

<h1> This is heading 1

<h2> This is heading 2

<h3> This is heading 3

<h4> This is heading 4

<h5> This is heading 5

<h6> This is heading 6

<i> Defines italic text

<p> Defines a paragraph

<pre> Defines preformatted text

<q> Defines a short quotation

<samp> Defines sample computer code text

<small> Defines small text

<span> Defines a section in a document

<s> Defines strikethrough text

<strike> Defines strikethrough text

<strong> Defines strong text

<sub> Defines subscripted text

<sup> Defines superscripted text

<u> Defines underlined text

Dr. Dobb's encourages readers to engage in spirited, healthy debate, including taking us to task. However, Dr. Dobb's moderates all comments posted to our site, and reserves the right to modify or remove any content that it determines to be derogatory, offensive, inflammatory, vulgar, irrelevant/off-topic, racist or obvious marketing or spam. Dr. Dobb's further reserves the right to disable the profile of any commenter participating in said activities.

Disqus Tips To upload an avatar photo, first complete your Disqus profile. | View the list of supported HTML tags you can use to style comments. | Please read our commenting policy.