[comp.sys.ibm.pc.digest] Info-IBMPC Digest V6 #31

Info-IBMPC@C.ISI.EDU.UUCP (04/28/87)

Info-IBMPC Digest       Monday, 27 April 1987      Volume 6 : Issue 31

This Week's Editor: Billy Brackenridge

Today's Queries:

			 Redirect Com2 to Aux
		 CGA Simulation on a Monochrome AT&T
		 Windows and the SummaSketch question
		  HTPM and Timeline Data Conversion
		  ARISTO Motherboard Memory Upgrade
		 Price/Performance Between AT & PS/2
		     Dangers with SUBST Command?
		     Any advice on IBM XMA card?
		 A Small ANSI Wordprocessor (2 Msgs)
		     Lightweight Process Managers
			   Text Formatters
			 Overheating Zeniths
	 How can an European pay & Receive Software from USA?
		      Cross-Assembler for 68000
	       Matching ARC.EXE to the Appropriate File
			   VP-Planner Help
			     Typing Tutor
		       1-2-3 on Z-100 Emulator
			 Buying an IBM Clone
			 3Com Etherlink Cards
	       IBM SAA  System Application Architecture
			  2 Monitors on PS/2
		   Memtec-Streamer & Tandon PCA 40
	 WordPerfect PostScript Printing with Novell Netware
			     EGA 43 lines
			    Keeping a Log
	       NEC Multi-Sync & IBM System/2 Computers
	   Basic Compiler vs. Quickbasic External Routines
    Finding the Address of Functions in MSC, and the ^C Interrupt


      INFO-IBMPC BBS Phone Numbers: (213)827-2635 (213)827-2515

----------------------------------------------------------------------


Date: Mon, 20 Apr 87 21:53:32 est
From: snorthc@nswc-g.ARPA
Subject: Redirect Com2 to Aux

 I am trying to use turbo pascal to read and write to the com2 port.
Turbo provides a logical device for the DOS device AUX, which defaults
to com1.  I would like to use the mode command to redefine com2 as
AUX.  Can this be done?  Is there a better way?

Please reply to me and I will summarize for the net.  Thank you.
	Stephen Northcutt (703) 663-7796
	snorthc@nswc-g.arpa


------------------------------


Date: Mon, 20 Apr 87 21:14:14 PDT
From: Andrew Glen Freeman <AGFREEMAN@SUMEX-AIM.STANFORD.EDU>
Subject: CGA Simulation on a Monochrome AT&T




      I have a TURBO PASCAL compiled program which runs fine on IBM PC's
and several clones I've tried, but it hangs on my AT&T 6300 (monochrome, but
with 3 shades of gray plus background).  I have been informed that TURBO
PASCAL doesn't support AT&T style monitors with its graphics functions.  Is
this true?  If so, is it possible to patch this compiled program in some way
so that it works on my monitor?  Barring that, does software exist to simulate
IBM CGA on an AT&T style monitor.  I think I have seen similar CGA simulation
programs available for Hercules graphics adapters.

Thanks in advance,
Andy Freeman
AGFREEMAN@SUMEX-AIM.STANFORD.EDU  (ARPA)

------------------------------




Date: Tue, 21 Apr 87 07:47:51 CST
From: moore@ncsc.ARPA (Moore)
Subject: Windows and the SummaSketch question


Does any 
Summagraphics SummaSketch tablet to work as a pointing device in Windows?  No
drivers are included with the tablet.  Any help is appreciated.

Jim
Moore@NCSC.arpa

------------------------------


Date: 21 Apr 87 07:35:40 EST
From: dschultz @ belvoir-mail1.arpa
Subject: HTPM and Timeline Data Conversion

Does anybody know how to transfer data between Harvard Total Project
Manager and Timeline?  The Timeline manual says the software will convert
Harvard Project Manager files to Timeline format, but that won't
work with HTPM.

Thanks for any help anybody can give me.

David A. Schultz
dschultz @ belvoir-mail1.arpa



------------------------------


Date: 21 Apr 87 14:10 EST
From: WONG%WSV2.decnet@ge-crd.arpa
Subject: ARISTO Motherboard Memory Upgrade


I'm interested in experience anyone has had with the 640K 
motherboard upgrade sold by Aristo Computers in Houston, Texas.

I have an IBM PC with 64KB on the motherboard (using 16Kb 
chips!), all expansion slots are used up, including one for an 
AST board which is fully populated at 256KB. That brings my total 
memory to 320KB, which is pretty restrictive considering today's 
memory hungry applications.

Please send replies directly to me, and I will summarize for the 
mailing list.

Gain Wong

ARPAnet:    wong%wsv2.decnet@ge-crd.arpa
BELL:       (408) 943-7997
US Mail:    GE Western Systems, 4041 N. First St., San Jose, CA 95134

[Info-IBMPC has published several articles on how to upgrade your 256K
motherboard to 640K but none on upgrading the 64K motherboard. -wab]

------------------------------

Subject: Price/Performance Between AT & PS/2
Date: Tue, 21 Apr 87 13:46:28 -0500
From: edelheit%ernie.mitre.org@gateway.mitre.org

Ok, Everybody is saying that the entry level PS/2 equals the performance
of the AT.  Now my question is this:  If I can get a 10 mHz AT clone for about
$300 less than the PS/2, which machine should I go for and why?

Regards,

Jeff Edelheit		(edelheit@mitre-gateway.arpa)
The MITRE Corporation, 7525 Colshire Drive
McLean, VA   22102		(703) 883-7586

------------------------------


Date:         Tue, 21 Apr 1987 16:05 EDT
From:         Mike Southwell <MGSYC%CUNYVM.BITNET@wiscvm.wisc.edu>
Subject:      Dangers with SUBST Command?


I read recently in the Newsletter of the IBMPC Users' Group here in NYC
about some sort of dangers in using the SUBST command.  The suggestion
was to delete the SUBST as soon as one is through with it.  Does anyone
have any information about this?  I have never had any problems.

------------------------------


From: johnl@ima.ISC.COM (John R. Levine)
Subject: Any advice on IBM XMA card?
Organization: Javelin Software Corporation


I gather that IBM makes an expanded memory card known as an XMA, and sells
it mostly to people who have 3270 PCs.  (It was apparently the solution to
the problem that the resident code for the 3270 emulation system takes up
about 639 1/2 K.)

The usual technical reference manuals are silent on the topic of how the
XMA card works.  Does anybody know?  Has anybody actually programmed one?
There is some speculation that it might be sufficiently similar to an
Above Board that we could easily mutate some Above Board code to deal with
one.

Any help would be appreciated.

John Levine, ima!johnl or Levine@YALE.whatever

John R. Levine, Javelin Software Corp., Cambridge MA +1 617 494 1400
{ ihnp4 | decvax | cbosgd | harvard | yale }!ima!johnl, Levine@YALE.something
Where is Richard Nixon now that we need him?

------------------------------



Date:    Tue, 21 Apr 87 17:46:23 PDT
From:     dmittman@Jpl-VLSI.ARPA
Subject: A Small ANSI Wordprocessor


   I am looking for a small ANSI wordprocessor for an MS-DOS machine.

The machine, a Sharp PC5000 portable, has 192K of RAM and 128K of disk
space. Although the machine *is* MS-DOS compatible, I would prefer
an ANSI compatible program, although an MS-DOS one would do.  If need
be, I can upgrade the RAM to 256K.  I have heard of Freemacs, but am
unable to obtain a copy due to ignorance.  I can FTP over ARPAnet, if
you can supply me with directions.
   Thanks for taking the time to read this whole thing.

                                        - David Mittman
                                          DMITTMAN@JPL-VLSI.ARPA
------------------------------


Date:    Wed, 22 Apr 87 20:05:47 PDT
From:     dmittman@Jpl-VLSI.ARPA
Subject: A Small ANSI Wordprocessor


   I should have been more specific:  An ANSI compatible Wordprocessor
is one that is nice enough to output ANSI escape sequences to the
console device (i.e. screen) so that they can be run on *any* machine
which has an ANSI.SYS device driver.  The reason I requested such an
animal is because the PC5000 has a 8 x 80 line screen, and no video
RAM, unlike most IBM compatibles.  This is not a problem, if a program
uses DOS calls in writing to the screen.  Unfortunately, most WPs which
use MS-DOS calls, assume a 25 line screen.  There's the rub. 
   Although writing ANSI software seems to be a lost art (gee, something
to do with speed), I imagine that *someone* has a fully capable WP program
which either has a screen setup utility for initializing screen size
variables internal to the program, or uses the conventional ANSI way of
determining screen size:  Ask the system to place the cursor at some 
ridiculous location like 100, 100, and wait to see what the system sends
back as its report as to the actual location of the cursor.
   ANSI programs are slow...witness the existence of the NANSI.SYS device
driver which is supposed to be much faster, and include many standard
ANSI calls which IBM chose not to include in their ANSI.SYS.
   However, I think that NANSI gets much of its speed by interpreting
ANSI escape sequences and translating them into BIOS calls for whatever
hardware is installed in the IBM machine.
   That, then, is a nutshell description of what an ANSI compatible
program is.  I believe that I have used the terms ANSI calls and
ANSI escape sequences interchangeable
Oops.
Like I was saying...I have used the terms ANSI calls and ANSI escape
sequences interchangeably in the above description.  If you have any further
questions, don't hesitate to ask.           - David Mittman

P.S. The software I am looking for should be either ShareWare or PD.


DMITTMAN@JPL-VLSI.ARPA

------------------------------


From: xios.XIOS!dont@seismo.CSS.GOV (Don Taylor)
Subject: Lightweight Process Managers
Date: 17 Apr 87 01:03:39 GMT
Organization: XIOS Systems Corporation, Ottawa, Ontario, Canada


Does anyone have any experiences to offer on the various lightweight process
managers that are around?

I am looking for an MS DOS and C 4.0 compatible system, PD or commercial 
royalty-free.  Source would be more than nice!

I have seen ads for a number of them in Computer Language but before buying
I should like hear of any opinions from the net.  (Block Island's 'Interwork'
looks as if it meets my functional needs).

Please reply to me, and I will post anything of general interest.


Thx.  Don Taylor

!{...}!decvax!utzoo!dciem!nrcaer!xios!dont


------------------------------


Date:     TUE APR 21, 1987 22.10.57 EDT
From:     "Dave Heiland" <DJH2%LEHIGH.BITNET@wiscvm.wisc.edu>
Subject:  Text Formatters


     I've just finished reading about NR in Dr. Dobbs.
NR is a PC version of the text formatter NROFF on UNIX.  Has
anyone used this program yet?  I was wondering how it stacks up
against the variety of word processors out there.  Personally
I use SCRIBE on our DEC-20 with EMACS as the editor.  I've
recently acquired a copy of FreEMACS (an excellent and
powerful editor) for my PC and I wanted to get a good text
formatter. I don't normally prefer word processors, and
since I've customized FreEMACS, I'd rather not have to learn
new editor commands.
                                      Dave Heiland
===========================================================
=     David J. Heiland                        __          =
=     Box 379 Lehigh U.                |__|   __|         =
=     Bethlehem PA 18015                  |  |__          =
=        DJH2@LEHIGH                                      =
===========================================================

[You might want to try FinalWord. I haven't seen it in several generations
but it combines an EMACS like editor with a Scribe like formatter. -wab]

------------------------------


Date: 22 Apr 87 08:26:14 EST
From: dschultz @ belvoir-mail1.arpa
Subject: Overheating Zeniths



Does anybody that has the Zenith 248 with a hard disk have problems
with the hard disk after the machine has been on for a while?


Sometimes running the 'chkdsk' program shows file allocation errors and
garbage file names when the machine has been run for a lot of time in 
a very warm environment ( >85 degrees ).  After shutting the system down
for a while sometimes the problems go away...sometimes they don't.

The only thing I know is that the 248s that are in our computer room,
which is air-conditioned, don't seem to have these problems...as much.

Thanks for any help anybody can give me.

David A. Schultz
dschultz @ belvoir-mail1.arpa


------------------------------


Date: Wed, 22 Apr 87 17:18:42 GMT
From: A385%EMDUCM11.BITNET@wiscvm.wisc.edu
Subject: How can an European pay & Receive Software from USA?


  This is the first time that I have tried to get software outside of
Spain. The package we're looking for (Arity Prolog Compiler, $700)
is not distributed here.

  I already have the US address and money to pay it but, which is the
best way to send the money and receive the software?.

 Do I look for an US bank here? By mail? A friend who travels?

 Is there any problem sending software by mail outside the US?

  I'd like that someone with experience in these cases could give me
some advice.

     Thank you very much in advance.
            -Javier Lopez-            <A385%EMDUCM11.BITNET>

       Universidad Complutense de Madrid.
                  SPAIN

[Try a Visa or Master Card and a phone call to some of the mail order shops
listed in American computer publications. -wab]

------------------------------


Date: Wed 22 Apr 87 12:54-EDT
From: "Robert C. Berwick" <BERWICK%OZ.AI.MIT.EDU@XX.LCS.MIT.EDU>
Subject: Cross-Assembler for 68000


Does anyone know of a cross-assembler running under MS-DOS on an IBM
PC that produces code for the Motorola 68000?  I assume there are
various such products out.

Bob Berwick
MIT

------------------------------

From: rjb@mitre-bedford.ARPA
Subject: Matching ARC.EXE to the Appropriate File
Date: Wed, 22 Apr 87 13:56:24 EST


I downloaded two files, PCNIXF1.ARC and PCNIXF2.ARC, from the
pd:<msdos.sys-util> directory on SIMTEL-20 and then switched to the
pd:<msdos.arc-lbr> directory to get the ARC.EXE file to apply to the
archived files.

Much to my wonder and amazement (and not a little bewilderment), I
found not one, but a multitude of ARC*.* files, and am at a loss to
know which one will work properly with the two files that I want to
uncompress (decompress?).

I know that constant advances are being made in data compression
technology, which is why there are so many ARC*.* files and their ilk,
but is there some (hopefully simple) way of associating a particular
archive program with the file(s) that it was applied to?

I expect that a larger audience than myself would be interested in the
answer to this question...

thanking you in advance, I remain, yours truly, ross bettinger.

[I was under the impression that all versions of .ARC were upward compatible
and that the newest version of the program should work with all files in
all previous .arc formats. We don't support .ARC format here. I used the
program once several years/versions ago. -wab]

------------------------------


Date: Wed, 22 Apr 87 14:20:03 AST
From: rpeschke@afit-ab.arpa (Richard E. Peschke)
Subject: VP-Planner Help


Looking for any help with VP-PLANNER.  I use the software on both a Zenith
Z-181 and an AT&T PC-6300.  My problem is with the color combinations used
to highlight the active cell column letter and row number.  These two
computers display these areas as White-on-White (which makes it impossible
to read the letter/number!!).

Paperback Software said they were aware of the problem but had no plans to
fix it.  ANY HELP WILL BE APPRECIATED!!!!!

Dick Peschke @ AFIT

------------------------------


Date: Wed, 22 Apr 87 13:28:04 CST
From: moore@ncsc.ARPA (Moore)
Subject: Typing Tutor


Can someone point me to a PD touch typing tutor program for IBM compatibles?
I've looked in PC-Sig and PC-Blue with no success.  Any help is appreciated.

Jim
Moore@NCSC.arpa

------------------------------


Date: Wed, 22 Apr 87 14:31:49 AST
From: rpeschke@afit-ab.arpa (Richard E. Peschke)
Subject: 1-2-3 on Z-100 Emulator


     The Z-248s the USAF is buying can be configured with an emulation board
that allows them to emulate a Z-100.  Initial use of this emulator has
uncovered a problem with a Z-100 version of Lotus 1-2-3.  IT WILL NOT RUN
on the Z-248 in Z-100 emulation mode.
     Zenith says the reason is an incompatibility between keyboard mapping
done by both the Z-100 board and Lotus.  No fix is planned.  Any body else
run into this problem and find a fix???

     Again, thanks for the help..... Dick Peschke @ AFIT

------------------------------


Date:     Wed, 22 Apr 87 15:35 EDT
From:     <SMEYERS%CLARKU.BITNET@wiscvm.wisc.edu>
Subject:  Buying an IBM Clone



Currently, I am in the process of searching for an IBM clone.  I am looking
for a system that:

        - Runs at 8 megahertz or faster
        - Has a 20 meg. hard drive and 1 floppy
        - monochrome monitor
        - 100% IBM compatible, or close to it as you can get.

I know of a couple of systems, but I am looking to find one that full fills
these requirements and is really cheap.  And I stress that point, it must
be the cheapest (but best) one out on the market.

If anybody knows of such, please respond to me at SMEYERS@CLARKU.BITNET

-Steve Meyers

------------------------------


Date: Wed 22 Apr 87 13:13:49-PDT
From: Bob Knight <KNIGHT@SRI-NIC.ARPA>
Subject: 3Com Etherlink Cards

Message-ID: <12296609578.32.KNIGHT@SRI-NIC.ARPA>

I'm looking to buy some, I guess 3C501.  Does anybody out there have a 
good priced source for them?  Please reply directly to me, not to the
list.  Thanks in advance,
Bob

------------------------------


Date: Thu, 23 Apr 87 12:12:18 MEZ
From: IWI7B3%DERRZE1.BITNET@wiscvm.wisc.edu
Subject: IBM SAA  System Application Architecture


Does anyone of you have further information about the IBM-SAA (System Appli-
cation Architecture) ? Speaking with some IBM people here in Southern Germany
(Bavaria) I only got one little brochure about it. Perhaps you might have got-
ten more information about it using other sources...
Any more information, help or hint to people who might know more about IBM-SAA
will be very welcomed.
Thanks a lot for all your efforts in advance.

--Thorsten Glattki
  Dept.of Computer Science, University of Erlangen-Nuernberg, West-Germany
Netaccounts: IWI7B3@DERRZE1.BITNET,glattki@faui70.UUCP,tnglattk@fauern.UUCP

      (+49)9131/857020 (Uni) & (+49)9131/57747 (home)
      Dept. of Computer Science,University of Erlangen
      Institute for Communication systems,PAP-Project
      Martensstrasse 3
      8520 Erlangen

------------------------------


Date:         Thu, 23 Apr 87 12:55:05 EDT
From:         Randy Schrickel <RAAS%APLVM.BITNET@wiscvm.wisc.edu>
Subject:      2 Monitors on PS/2


Is it possible to connect both a color and a monochrome monitor to the
new PS's like you could to the PC's ? If so, what expansion card(s) is
needed ? The $1000+ Display Adapter or is there an easier way?

Thanx
 R. L. Schrickel
------------------------------


Date:     Thu, 23 Apr 87 18:49:18 +0200 (Central European Summer Time)
From:     XBR1D36K%DDATHD21.BITNET@wiscvm.wisc.edu
Subject: Memtec-Streamer & Tandon PCA 40



We recently got a Memtec Companion Streamer which we have used for
backing up our hard disks. The software delivered with this product
consists of one program 'mem.exe' which allows one to backup and restore
the entire disk or the DOS-partition in image mode or selected
subdirectories in file mode (start-stop mode). Using the DOS-partition
image backup on an Tandon PCA40 running MS-DOS 3.1 caused us a severe
problem: After an IMAGE-Restore of the disk, DOS doesn't identify the
disk as a proper system-disk. CHKDSK states up to 25 MB of lost
clusters, the volume label is destroyed and so on.

Using the same procedure on an IBM PC or clone with 20 MB hard disks
running PC-DOS 3.x works ok.

Anybody having experience with that kind of problem? Any information
about differences between Tandon's Disk organization and IBM's are
welcome. (The german distributor where we ordered the stuff is not able
to give any support regarding this trouble.)
If anybody has any idea, please respond directly to the address below
(not to that one given in the Header !!!).
We need to restore some important files from that damn tape.


Best regards
G. Hartmann


Gunther Hartmann
Technical University Darmstadt
Fachgebiet Maschinenelemente und Getriebe
D-6100 Darmstadt/Germany

BITNET/EARN:  D86V@DDATHD21.BITNET
ARPAnet    :  D86V%DDATHD21.BITNET@WISCVM.WISC.EDU

------------------------------

Date: Thu, 23 Apr 87 17:33 PDT
From: <DBUERGER%SCU.BITNET@wiscvm.wisc.edu>
Subject:  WordPerfect PostScript Printing with Novell Netware


I'm getting ready to configure a Novell Netware 286 ver 2.0a on an AT
compatible, to be used with PCs attached via ethernet cards and coax.
I want to be able to attach a QMS PS-800 laser printer, and use
WordPerfect ver. 4.2 to print via the network on the laser printer
with the PostScript option.  Has anyone done this yet?  Normally I
can dump PS files to a buffer for queued printing on the laser
printer (such as PS files from TeX).  WordPerfect, however, seems to
require that the PC host be actively involved with each print job,
and does NOT dump a PS file to the printer.  Any suggestions would be
greatly appreciated.

David J. Buerger
Santa Clara University P.C. Center
dbuerger@SCU.bitnet
dbuerger%SCU.bitnet@WISCVM.WISC.EDU

------------------------------


Date: 23 Apr 87 19:16:12 EST
From: dschultz @ belvoir-mail1.arpa
Subject: EGA 43 lines



Does anybody know how to get 43 lines on an ega screen through DOS?
Thanks.

David A. Schultz
dschultz @ belvoir-mail1.arpa


------------------------------


Date: Fri, 24 Apr 87 00:49:37 CDT
From: "Ferrin Harrison" <C321724%UMCVMB.BITNET@wiscvm.wisc.edu>
Subject: Keeping a Log

    It seems to me that it would be useful to be able to direct a
copy of all output to the console to a file, similar to the CMS Spool
Console command.  (Of course, it would be nice to do this as one or
two commands.)  This would be especially useful when using a software
for the first time, or when error messages are expected.  I am not
asking for something which can capture graphics output, nor would I
want the ASCII (extended) characters translated.  Copying output to a
file without showing it on the physical screen is not the idea!
Something which would redirect output from the printer to a file, so
it could be controlled through shift and ctrl printscreen would be
ideal.  Does anyone have a solution for this one?  Thanks to all for
your assistance.
                                 Sincerely,
                                           Ferrin

[LPTX.C in the lending library does what you want when used
with print screen and control print screen. -wab]

------------------------------


Date: Fri, 24 Apr 87 14:15:35 AST
From: ernst@afit-ab.arpa (Thomas J. Ernst)
Subject: NEC Multi-Sync & IBM System/2 Computers

Does anyone know if the NEC Multi-Sync monitor is compatible with
the new IBM Personal System/2 Computers?  Will the Multi-Sync be able
to display the new, higher resolution graphics that can be generated by
the System/2's?

------------------------------


Date:     Sun, 26 Apr 1987 22:47 PDT
From:     JAJZ801%CALSTATE.BITNET@wiscvm.wisc.edu
Subject:  Basic Compiler vs. Quickbasic External Routines


  After living with the limits and bugs of the MS basic compiler
for long enough, I finally bought a copy of Quickbasic. What I
would like to know, however, is how compatible are separately
compiled routines from other languages - assembler in particular
are between the two implementations. I have read the interfacing
information in both manuals on writing compatible routines and the
calling conventions and segmentation SEEM equivalent enough. But
I would like to know if there are any un obvious problems. This is
particularly important for some externally supplied routines in
object form only that the vendor, for some strange reason, has no
interest in providing a Quickbasic version for but also refuses to
state that the existing ones are also Quickbasic compatible. My
tests seem to indicate everything's OK but would like to know if
there are side effects I may not have seen.

  jeff Sicherman
  JAJZ801@CALSTATE.BITNET


------------------------------


Date: Mon 27 Apr 87 08:52:02-PDT
From: pozar@hoptoad.uucp (Tim Pozar)
Subject: Finding the Address of Functions in MSC, and the ^C Interrupt
Organization: Syncstream (San Francisco)



   I was wondering how one finds the address of a function and would 
apply it to setting a vector interrupt with it.  This is the code that
I came up with.  It compiles with one error (see below).  If anyone
has any insight on how this could be better done, I would like to 
hear it.
            Tim Pozar

---
/*
 * CTLC.C
 *
 *    A control-break or ^C handler demo. 
 *
 *    This program will push the "DOS CONTROL-C Exit Address" vector
 * and set it to the "bye()" function.  bye() should pop the old 
 * address and then executes the users code.  The old vector should
 * be restored if the program ends through the remaped vector or before
 * a standard exit().  bye() should also come before the retrieval of the 
 * function's address with the way MSC is set up.
 *
 *    This is a way to make graceful exits from complex programs that
 * may have several files open or be communication programs that need
 * to handle the comm paths a particular way to exit properly.  (Well, *I* 
 * thought it was an interesting hack in "C" !)
 *
 *    CTLC will count 20 seconds and exit, or if the user types a ^C or 
 * a CONTROL-BREAK the program will exit with our routine.  If a char
 * is typed before the ^C is entered, the program will exit normally 
 * because the keyboard buffer is not polled.  To correct this, keep 
 * checking on the kbhit() function supplied with MSC 4.0 and call on 
 * the console input, or keep watching the int 9 (KB_INT) for a keyboard
 * hit while you're in your routine.
 *
 *    I would guess you could make this function return back into the 
 * program by having it call a assembly function that would pop an 
 * appropriate number off the stack and then execute an "iret". (messy)
 *
 * BUGS:
 *    Because we don't disable the interrupts, if an interrupt occurs while 
 * the program is in the middle of stuffing the new or old address, your
 * up the creek.
 *    Also do not change the vector to the BIOS ^C vector (1Ah).  It seems 
 * that DOS has a go at the keyboard break first and so it exits leaving 
 * the modified vector unrestored.
 *
 *    This source is compiler dependent.  It was written for the Microsoft
 * C Compiler 4.0.  And it goes without saying, it is VERY DOS dependent.
 *    
 *    At this point there is a compile warning at "funcp = bye;" in the 
 * main function.  But everything works perfectly.  Has anyone any ideas
 * on how to make this compile cleanly?
 *
 *    Tim Pozar -- 24.April.1987
 *    pozar@hoptoad.UUCP or Tim Pozar at Fido 125/406
 *    KLOK-FM
 *    77 Maiden Lane
 *    San Francisco CA 94108
 *    (415) 788-2022
 *
 *    Copyright 1987 Timothy M. Pozar -- All rights reserved.
 *
 */
 
#include <stdio.h>
#include <dos.h>
 
#define CNTLBK 0x23
#define SET_VECTOR 0x25
#define GET_TIME 0x2c
#define GET_VECTOR 0x35	
 
typedef struct timetype {
    unsigned hour;
    unsigned minute;
    unsigned sec;
    unsigned hsec;
} TIME, *TIME_PTR;
 
unsigned int pvoff;
unsigned int pvseg;
 
/*
 *  bye()
 * 
 *  If a keyboard break occurs, this routine is executed.
 *  This routine needs to be stuck into the vector table and taken out 
 *  properly when the program exits.
 *
 */
 
bye()
{
  set_int(CNTLBK,pvseg,pvoff);	/* reset old vector */
 
/*
 *       Put code here.
 */
 
  printf("Restoring old keyboard vector and exiting. \n");
  exit(0);
}
 
main()
{
char far *funcp;
unsigned int off;
unsigned int seg;
 
  funcp = bye;
  off = FP_OFF(funcp);
  seg = FP_SEG(funcp);
 
  set_int(CNTLBK,seg,off);
 
  printf("bye() is located at %04X:%04X.\n",seg,off);
  printf("The breakint was located at %04X:%04X.\n",pvseg,pvoff);
 
  sleep(20);
  printf("No keyboard break.  Exiting normally.\n");
  bye();
}
 
/*
 * set_int(n,segm,offs)
 *
 *   Set the interrupt speced with the segment and offset passed to it,
 * and push its old address vector.
 *
 */
 
set_int(n,segm,offs)
int n;				/* interrupt number */
unsigned int segm, offs;	/* segment and offset to point to */
{
  union REGS inregs;
  union REGS outregs;
  struct SREGS segregs;
 
  inregs.h.ah = GET_VECTOR;	/* get original vector */
  inregs.h.al = n;
  intdosx(&inregs, &outregs, &segregs);
  pvoff = outregs.x.bx;		/* push it old vector offset */
  pvseg = segregs.es;		/* and segment */
 
  inregs.h.ah = SET_VECTOR;	/* set new vector */
  inregs.h.al = n;
  inregs.x.dx = offs;
  segregs.ds = segm;
  intdosx(&inregs, &outregs, &segregs);
 
  return(0);
}
 
/*
 *
 * get_time(n)
 * TIME_PTR n;
 *
 *    Fills timetype structure n with current time.  This function could
 * be replace by calles to time() and then gmtime() to get a structor,
 * but since were fooling with vectors anyway...
 *
 */
 
get_time(n)
TIME_PTR n;
{
  union REGS inregs;
  union REGS outregs;
 
  inregs.h.ah = GET_TIME;
 
  intdos(&inregs, &outregs);
 
  n->hour = outregs.h.ch;
  n->minute  = outregs.h.cl;
  n->sec  = outregs.h.dh;
  n->hsec = outregs.h.dl;
 
  return(0);
}
 
sleep(x)
int x;
{
  int i;
  unsigned s;
  TIME n;               	/* current time record */
 
  i = 0;
  get_time(&n);
  s = n.sec;
 
  while (i < x){
  printf("secs = %d \r",i);	/* for debug only */
    while (s == n.sec)          /* while Mickey's hand hasn't moved... */
      get_time(&n);
    s = n.sec;			/* if Mickey's hand moved... */
    ++i;			/* increment the counter */
  }
}


        Tim Pozar
UUCP    pozar@hoptoad.UUCP
Fido    125/406
USNail  KLOK-FM
	77 Maiden Lane
	San Francisco CA 94108



------------------------------

End of Info-IBMPC Digest
************************
-------