HDTenEightyP/NetNews huggingface dataset:
From: leadfoot@bigbootay.sw.stratus.com (Mark Curtis)
Newsgroups: comp.os.msdos.programmer
Subject: Re: Any idea why NUL is busy inside of windows?
Date: 3 Sep 92 23:26:13 GMT

In article <1992Sep3.202411.3690@dcatlas.dot.gov>, joet@dcatlas.dot.gov (Joe Trott) writes:
|> leadfoot@bigbootay.sw.stratus.com (Mark Curtis) writes:
|> 
|> >I can not get MS's C7 pwb to compile inside a dos window.  It gets
|> >a sharing violation on the dev NUL.  NUL is used to throw away
|> >unwanted output.  Outside of windows all is fine, but inside a dos
|> >window any write accesses to NUL produce share violations.
|> 
|> >copy \autoexec.bat nul               inside a dos window causes A/R/F
|> >                                     error message.  PWB displays an
|> >                                     error prompt and aborts.
|> 
|> It is hard to resist thinking that this is an act of self preservation on
|> the part of Windows.  Only by plugging up NUL can it prevent itself from
|> being sucked into the void where it belongs.

I found the problem.  When I installed C7 somewhere in the docs it
said something about redirecting kernel debug messages.  I don't have
a second monitor or a dedicated terminal on com1, so I redirected the
debug output to nul.  In system.ini I added:
[debug]
OutputTo=nul

This was the problem!

I'm not sure what to use so I just put a file name in there for
right now.  Fixed the problem.

Mark
From: bobk@ESD.3Com.COM (Bob Konigsberg)
Newsgroups: comp.os.msdos.programmer
Subject: Re: Is a floppy formatted ?
Date: 28 Aug 92 16:43:55 GMT

stern@mble.philips.be writes:

>Could anybody explain me how to detect if a floppy is already formatted
>or not? And also if it is simple to program a 'quick format' like in
>DOS 5.0 format.

I'm posting this time, having answered this before.

In assembler

mov ah,2	;Read Sector function
mov dl,driv_num	;0-3 allowed
mov dh,0	;head number
mov cx,0001	;track 0, sector 1
les bx,buffer	;es:bx points to read buffer of 512 bytes
mov al,1	;1 sector to read.  This will fail on HP-150s
int 13		;do the I/O thing
jc error	;Carry flag set on error.  This actually can cover
		;a number of things: not formatted, door open,
		;diskette in sideways

;If you want to be really cute, you can pass a far address of a variable
;in C and use that to let a C/C++ program know the results.

BobK
Newsgroups: comp.os.msdos.programmer
Subject: Hooked interrupts fail under Windows/DOS
From: dueck@brandonu.ca
Date: 31 Aug 92 16:21:16 CST
Organization: Brandon University, Brandon, Manitoba, Canada

I have a TSR that hooks the clock interrupt (8) in order to
perform a periodic activity. When in the DOS shell under Windows,
another program that depends on the value of the clock bytes in the
DOS segment fails because the clock bytes never get changed.
The second program works properly if the TSR is not loaded before entering
Windows.

Does anyone have an explanation for this behaviour?

Gery Dueck
dueck@brandonu.ca
Newsgroups: comp.os.msdos.programmer
From: cambler@zeus.calpoly.edu (Christopher J. Ambler, Phish)
Subject: XMS memory manager for C/C++ needed
Organization: Fantasy, Incorporated: Reality None of Our Business.
Date: Thu, 03 Sep 1992 05:19:03 GMT

I'm looking for an XMS memory manager package that can make XMS available
to the heap via malloc() or new calls transparently. Protected mode
interfaces do not qualify for my application. Most that I've seen will
do this, but require malloc() calls to use their custom handles, and since
I cannot afford the time on the project to rewrite all the calls to new
in Turbo Vision, I need something transparent.

Commercial with tech support is a must, though if anyone knows of an
exceptional shareware/freeware package, I will give it a look.

Your help is appreciated, email please and I'll summarize. Please no
"meeto" mail, I do promise to summarize.

-- 
If you insist upon living in a  | cambler@zeus.calpoly.edu | Fubar Systems BBS
dream, you may be taken as mad. |                          | (805) 54-FUBAR
  I like my dream.              | Because all you of       | 3/12/24, MNP5, 8N1
Then you *are* mad!             | Earth are IDIOTS!!       | FSBBS 2/FSUUCP 1.3
Newsgroups: comp.os.msdos.programmer
From: dspascha@eos.ncsu.edu (DAVID SCOTT PASCHAL)
Subject: Re: Changing and restoring Video Mode
Originator: dspascha@c00015-118dan.eos.ncsu.edu
Reply-To: dspascha@eos.ncsu.edu (DAVID SCOTT PASCHAL)
Organization: North Carolina State University, Project Eos
Distribution: comp
Date: Wed, 2 Sep 1992 15:48:57 GMT


In article <HENRIK.JOHANSSON.92Sep2140043@ariel.nexus.comm.se>, Henrik.Johansson@nexus.comm.se (Henrik Johansson) writes:
|> Newsgroups: comp.os.msdos.programmer
|> Path: taco!rock!stanford.edu!agate!ames!sun-barr!cs.utexas.edu!qt.cs.utexas.edu!yale.edu!ira.uka.de!math.fu-berlin.de!news.netmbx.de!Germany.EU.net!mcsun!sunic!seunet!comm!newshost!Henrik.Johansson
|> From: Henrik.Johansson@nexus.comm.se (Henrik Johansson)
|> Subject: Changing and restoring Video Mode
|> Message-ID: <HENRIK.JOHANSSON.92Sep2140043@ariel.nexus.comm.se>
|> Sender: news@c3consult.comm.se
|> Organization: Communicator NEXUS AB, Uppsala, Sweden
|> Distribution: comp
|> Date: Wed, 2 Sep 92 09:00:43 GMT+5:00
|> Lines: 18
|> 
|> 
|> How do I save _all_ relevant information about current video mode so
|> that I can restore it afterwards exactly as it was?
|> 
|> This problem comes from a Device Driver that is triggered and needs
|> some input from the user.  Therefore the screen gets blanked, user
|> input requested, some action taken, and afterwards the driver must
|> return to wherever the pc was running with the video mode completely
|> intact.
|> 
|> Anyone?
|> 
|> /hj
|> --
|> Real life:   Henrik Johansson            Email:  Henrik.Johansson@Nexus.Comm.SE
|> Snailmail:   Communicator Nexus          Phone:  +46 18 171811
|>              Box 857                     Fax:    +46 18 696516
|>              S - 751 08 Uppsala, Sweden
|> 

Hi.  You need to save the video-relevant variables in the ROM-BIOS data area
(at segment 40h), all the VGA registers (you can't do this on an EGA since
most of them are write-only), and the entire video buffer (which can be
anything between 256K to 4 megabytes depending on the adapter).

Then set the mode you want and do anything you like.

Then use the ROM-BIOS to put the mode back to what it was before (which is one
of the variables in the saved copy of the ROM-BIOS data area but you could have
also just gotten it with INT 10h function 0Fh), copy the ROM-BIOS data back,
copy the registers back, and copy the video buffer back (and be sure to restore
the registers you used to traverse the video buffer).

I know it's complicated (and possibly memory-comsuming) to be able to swap
over any text or graphics mode on any adapter, but you would need to code your
(interrupt?) handler to refuse to swap over any mode you don't recognize.  And
you could make it a whole lot simpler just by refusing to swap over any graphics
mode (i.e. you'd only have to swap 80x25x2 bytes rather than 256K or more).

Tschuess,
David Paschal
From: ara@zurich.ai.mit.edu (Allan Adler)
Newsgroups: comp.os.msdos.programmer
Subject: inventing new disk formats
Date: 2 Sep 92 21:20:14 GMT
Distribution: comp
Organization: M.I.T. Artificial Intelligence Lab.


I'm not sure whether this is the right place for this, but here goes.
Suggestions for other groups are welcome.

I'm working with an 80386 MSDOS system with an AMI bios. I am interested
in learning how to do the following:
(1) invent a new format for a floppy disk or hard disk (but I'll start with
    a floppy :-) ).
(2) write the information on the floppy that tells the motherboard how to
    boot from it. It would be booting antoher operating system, that
     I would also have to write. I know how to physically write everything
    on the floppy: one just uses rawrite. But I don't know WHAT to write.


Can someone suggest how to learn this, e.g. books that explain it in
words of one syllable, programs that help one do it, etc.?

Allan Adler
ara@altdorf.ai.mit.edu
From: hollen@megatek.UUCP (Dion Hollenbeck)
Newsgroups: comp.os.msdos.programmer
Subject: Re: New and farcoreleft()
Date: 3 Sep 92 19:45:00 GMT
Organization: Megatek Corporation, San Diego, California

In article <1992Sep3.134102.17553@news2.cis.umn.edu>
wright@epx.cis.umn.edu (Mark Wright) writes:

Mark>      In a C++ program I've been writing, strategically placed
Mark>   farcoreleft()'s seem to be saying that my objects are not being
Mark>   de-allocated correctly when I 'destroy' them.  Should I worry about
Mark>   this, or is farcoreleft() designed for use with malloc()?  If so,
Mark>   is there a C++ function which will tell me how much mem. I have
Mark>   left?  I'm using Borland C++ v3.1.

Yes it is designed for use with malloc().  It is probably working
correctly, you probably do not know how it is working.

Start out with 1000 bytes to allocate

	a = malloc(10)
	b = malloc(10)
	farcoreleft() will return 980
	free(a)
	farcoreleft() will return 980
	free(b)
	farcoreleft() will return 1000

farcoreleft() will return the amount of memory between the last amount
of memory allocated and the top of memory, therefore not accounting
for the memory returned to the pool when you free chunks not at the
end of the pool.  farcoreleft() will eventually return the "base"
value seen before any allocations were made, once you have freed
everything allocated.

If this does not explain the behavior you are seeing, then maybe there
is something wrong.

-- 
Dion Hollenbeck       UUCP: {uunet, ucsd, sun}!megatek!hollen
                      INTERNET:            hollen@megatek.com
Megatek Corporation  9645 Scranton Rd.  San Diego, Ca.  92121
Newsgroups: comp.os.msdos.programmer
From: joet@dcatlas.dot.gov (Joe Trott)
Subject: Re: Timed batchfile execution
Organization: U.S Dept. of Transportation
Date: Tue, 1 Sep 1992 14:36:33 GMT

hshulman@magnus.acs.ohio-state.edu (Harvey G Shulman) writes:

>I want to set up a processing job on my PC to start running in the
>evening after I've gone home.  Is there a tsr utility available that can 
>run a batch file at a  designated time?

Many of the schedulers included with tape backup programs can run batches
or programs other than the tape software.  Some let you specify a DOS
command line; others require your batch to have a particular name
(e.g. BATCH_1.BAT).
Another choice, if you can start the batch job when you leave, is to include
a program in it that does nothing but loop until a certain time and then
terminates (batch processing continues...).  You can write this one yourself
in most any language; I think PC Mag has one called WAITUNTL.COM.
A third choice (really part of the first) would be the scheduling ability of
a program such as PC SHELL, one of Central Point Software's PC TOOLS.  It is
primarily intended to start automatic backups, but it one of the programs
that can start any batch at a particular time.

Hope this helps.

-JTT

Newsgroups: comp.os.msdos.programmer
From: espenk@ifi.uio.no (Espen Frimann Koren)
Subject: Re: Algorithm for ordering vertices
Organization: Dept. of Informatics, University of Oslo, Norway
Date: Fri, 4 Sep 1992 07:58:41 GMT
Originator: espenk@yrsa.ifi.uio.no


In article <1992Sep3.194209.10620@athena.mit.edu> you write:
> 	I have a polygon with known vertices, but these points are
> arranged in random order.  I need an algorithm to put these points
> in an order such that I can trace the perimeter of this polygon.
> Note that this arbitrary polygon can be concave and weird-shaped,
> but it is simple enough that there is only ONE way to connect all
> these points to form a polygon.
> 
> 	Any help would be greatly appreciated.  Thanks in advance.
> 
> Gilbert
> 


An arbitrary set of vertices does not always become a polygon. It could
turn up to be a line. What you need to sort, is the EDGES of the polygon.
Then you can trace the perimeter easy.

You represent the egdes on the form (xmin, ymin, xmax, ymax) and if you
sort after these criterias:

	ymin, xmin, m  (where m is the elevation of the edge, that is
                        m = (ymax-ymin)/(xmax-xmin))

then a polygon like this (the P's are the crosspoints)




                Pp
               p  pp  (4)
               p    pp
         (3)  p       pP
             p         p
            p          p
            p          p
           Ppp        p  (2)
              ppp     p
             (1) ppp  p
                    ppP

be sorted after the shown numbering.

(This is in fact the way you sort edges if you are going to graphicly fill the
 polygon using scan-conversion)

Espen.


Newsgroups: comp.os.msdos.programmer
From: dmurdoch@mast.queensu.ca (Duncan Murdoch)
Subject: Re: WANTED again:64bits(double long) arthmetics
Organization: Queen's University
Date: Wed, 2 Sep 1992 02:13:31 GMT

In article <1992Sep1.053802.3664@sparc4.ncu.edu.tw> cs8023@ee21.ncu.edu.tw (ee76536) writes:
>Hi, all assembly lang experters:
>
>I recently search a fast 64bit (double long) arthmetics,
>if you have any idea on which books/documents/tools, please inform
>me, thanks anyway.

That's a type supported in hardware in the 80x87 coprocessors.  I don't 
think all of the basic integer operations are provided, but they shouldn't 
be hard to write if you use the FPU instructions.  Look up those with 
mnemonics FIxxx for integer support, and remember that internally, 
everything is done in floating point - so you might need some FRNDINT 
instructions if you don't save intermediate values to memory.

In Turbo Pascal this is called the Comp type, in the Intel 486 manual, it's 
called a long integer.  Your compiler could call it anything.

Duncan Murdoch
From: sap@sactoh0.sac.ca.us (Stephan A. Puga)
Newsgroups: comp.os.msdos.programmer
Subject: Anyone have source for a screen saver?
Date: 25 Aug 92 19:35:21 GMT
Article-I.D.: sactoh0.1992Aug25.193521.1012
Organization: Sacramento Public Access Unix

Hi, basically the subject say it all.  I really only need to
routines that check for any type of input and the clock routine.
Or what would be really great is if someone knows where to get a
screen saver that displayed a user-defined picture(pcx, bmp or
whatever) on the screen.

-- 
#############################################################
# "Its been surreal!"         #     sap@sactoh0.SAC.CA.US   #  
#     -- Gogo Dodo            # UUCP=..ames!pacbell!sactoh0 #
#############################################################
From: sue@byron.u.washington.edu (Shu-Chen Eclipse)
Newsgroups: comp.os.msdos.programmer
Subject: Novice question: how to boot from a bat file?
Date: 30 Aug 92 03:39:12 GMT
Article-I.D.: u.1992Aug30.033912.729
Organization: University of Washington, Seattle

Hellow,

i have 2 alternate versions of config.sys and autoexec.bat.
I want to write a simple bat file that, when invoked by the user interatively,
will ask the user which version he wants, delete the current files, copy the
correct ones from "reserved" files, then re-boot.

My problem is I don't know how to emulate the cntry-al-delete boot that
the user would normally type in to have these new files take effect.

So, how do I put "cntrol-al-delete" in this bat file so that it automatically
reboots the PC without requiring the user to type "cntrol-alt-delete"???

thanx for answering,
sue@byron.u.washington.edu
From: dj@ctron.com (DJ Delorie)
Newsgroups: comp.os.msdos.programmer
Subject: Re: gcc (djgpp) default file mode (text vs binary) question?
Date: 31 Aug 92 23:43:15 GMT
Reply-To: dj@ctron.com
Organization: None whatsoever

In article <BtJuws.ACx@acsu.buffalo.edu>, bandu@acsu.buffalo.edu (Jagath Samarabandu) writes:
> I'm trying to port a bunch of unix image processing programs using djgpp and
> have trouble setting the default file mode to binary. 
> 
> The file 'libc.doc' that comes with the distribution says I can set the global
> variable _ftype to O_TEXT or O_BINARY and it should set the default file type.
> But this doesn't seem to work. 

At least in the latest version (1.08), you can call setmode() on a
file.  This is required for stdin/stdout/stderr, which are already
opened by the time you call main().  Also, it's always safe to use
"rb" or "wb" when you can.

> PS: Hats off to those who toiled to port gcc (djgpp). It even beats the pants
> off of Borland C++ 3.1 for my application (both code size and speed).

Thanks!

DJ
dj@ctron.com
Life is a banana.
Newsgroups: comp.os.msdos.programmer
From: karl@BofA.COM (Karl Nicholas)
Subject: Finding CPU type
Organization: Bank of America, Capital Products, RMTG #5906
Date: Thu, 3 Sep 92 20:26:19 GMT




I am using msc 7.0 and am trying to figure out how
to do a few strange things

1: Find out the CPU type of the system I am on.
  How do I do this with a C program.
  
  
2: Find out how much extended memory is available

   a: How do I find out the amount available.
   
   b: How do I find out the amount installed.
   
   
Thank you all in advance who provide usefull answers.

Send me a copy of the FAQ if you think that will help.



Karl.


-- 
 +---------------------------------------------------------------------------+
 | Karl Nicholas   (415) 953-0409    | Beer is good food.  Food is not beer. |
 | karl@BofA.COM   uunet!odinba!karl | *** BofA is not me, I am not BofA *** |
 +---------------------------------------------------------------------------+
From: ardtlong@adam.adelaide.edu.au (Dale T. Long)
Newsgroups: comp.os.msdos.programmer
Subject: C++ vs Quick BASIC : HELP NEEDED
Date: 2 Sep 92 06:27:13 GMT


I was wonding what the 'pros and cons' are with Microsoft Quick BASIC and
C++ (Borland). I need to buy a language I can use to create a flexible
string based data base (as well as for general programming). I can only buy
one and would like to know what would best suit my needs.

Any information or opinions would be most welcome. Might there be another
language that would better suit my needs?

Dale Long.
ardtlong@adam.adelaide.edu.au
From: pshuang@zurich.ai.mit.edu (Ping Huang)
Newsgroups: comp.os.msdos.programmer
Subject: Re: text based windowing libraries
Date: 31 Aug 92 14:47:28 GMT
Distribution: usa
Organization: M.I.T. Artificial Intelligence Lab.
In-reply-to: jon@ais.org's message of 12 Aug 92 13:35:27 GMT


 > I'm looking for a text based windowing library - something that I can
 > use to develop a windows like program that runs under dos in text mode.

I have used Mewel, a text-based windowing library which works pretty
well, for a non-trivial application. It emulates as much of the Windows
API as makes sense under text-mode. However, if you're not interested in
trying for single-source tree for your application code to compile under
both Windows and DOS, Mewel probably has a higher overhead in terms of
speed and memory footprint than is desirable.

There are a large number of others... a new one recently came out which
also provides Windows API support. This question needs to be put into
the FAQ.

--
| Ping Huang (INTERNET: pshuang@martigny.ai.mit.edu) speaking for himself.
| "One Thing to name them all, One Thing to define them,
|  One Thing to place them in environments and bind them..."
From: dspascha@eos.ncsu.edu (DAVID SCOTT PASCHAL)
Newsgroups: comp.os.msdos.programmer
Subject: Re: Trapping INT 21 is easy.
Date: 1 Sep 92 21:54:23 GMT
Reply-To: dspascha@eos.ncsu.edu (DAVID SCOTT PASCHAL)
Organization: North Carolina State University, Project Eos
Originator: dspascha@c00089-100lez.eos.ncsu.edu


Hi.  Whenever the 80x86 invokes an interrupt handler, it clears the interrupt
and trap flags after it pushes the old copy onto the stack.  In a non-hardware
interrupt handler it's generally a good idea to re-enable interrupts (with STI)
but always disable them when you chain to the previous handler.  I'm not sure if
this is the problem in your case (sounds really weird!) but it might be
something to check on.

Tschuess,
David Paschal
Organization: Penn State University
Date: Wed, 2 Sep 1992 14:32:03 EDT
From: Kevin <F13@psuvm.psu.edu>
Newsgroups: comp.os.msdos.programmer
Subject: Turbo Debugger and Turbo Help conflict ?

   Hi !  I want to use the THELP utility (supplied with TC++ 2.0) with TD in
50 line mode.  TD runs just fine in 50 line mode, but when I try to access
TC++ help, the program hangs.  Hitting Escape fixes everything, which makes
me think that THELP really did come up, but in an invisible window.  THELP
runs perfectly so long as I am in 25 line mode.  What do I have to do to
make THELP work in 50 line mode ?
   Here's the sequence I use to start TD with THELP.
       subst e:\ c:\tc\bin
       e:\thelp--> Start THELP
       c:\td\td %1--> Start TD with a file already loaded
       e:\thelp /u  --> unloads THELP
I wrote a letter to Borland's Tech Support, but they have never replied.  I
don't want to call them, because I live in Pennsylvania.  So do any of you
have an idea as to why THELP won't work in 50 line mode ?

Kevin Furrow (f13@psuvm.psu.edu)
From: mpue2@syma.sussex.ac.uk (James E. Talbut)
Newsgroups: comp.os.msdos.programmer
Subject: Time keeping
Date: 20 Aug 92 08:04:47 GMT
Organization: University of Sussex, five miles away from Brighton

Is there any way I can access a more accurate clock than the system
clock on an old XT ?
To be useful to me it needs to be accurate to within about 10ms, the
system clock on every machine I've looked at so far updates itself every
50 or 60 ms.

Please send any replys by email as I don't subscribe to this group.

Thanks
	J.T.
-- 
Fine beer may be judged with just one sip,
	but it's better to be thoroughly sure.  -  Czech proverb

James Talbut            mpue2@syma.susx.ac.uk
Newsgroups: comp.os.msdos.programmer
From: angevine@eavax.sanders.lockheed.com (William S. Angevine)
Subject: Re: Help with Strange Error Message
Reply-To: angevine@rapnet.sanders.lockheed.com
Organization: Lockheed Sanders Inc.
Date: Wed, 26 Aug 92 20:47:58 GMT


Previously I posted:
>	We are getting the following error message when trying to run a program.
>
>C:\MENU> mcad_get
>Cannot execute C:\MENU\MCAD_GET.EXE

<text deleted>

First thanks to all those who replyed.  The net came through again!  Special
thanks to phil@cs.utexas.edu who hit it on the nose.

For those who are interrested the .EXE was corrupt.  I compared the .EXE on
the hard disk with the one on backup (Yes, I backup regularly thank goodness).
The .EXE on the hard disk was about 1/3 the size of the backup one.  After
talking with all the people who use the PC I came to find out that some of the
blocks on the disk went bad and were cleaned up.  Hence how I probably lost
some of the .EXE

	Again, thanks to all those who responded.

		Bill
			angevine@rapnet.sanders.lockheed.com
Newsgroups: comp.os.msdos.programmer
Subject: Re: Efficient byte/word mirroring request
From: dueck@brandonu.ca
Date: 31 Aug 92 16:03:28 CST
Organization: Brandon University, Brandon, Manitoba, Canada

In article <1992Aug28.083405.164422@dstos3.dsto.gov.au>, egg@dstos3.dsto.gov.au writes:
> Does anyone know how to quickly and efficiently mirror a byte.
> ie
>     11001010 to 01010011
> 
> the only way I know is this
> 
>    mov  al,byte_to_shift
>    mov  cx,8
> ShiftLoop:
>    rcr  al
>    rcl  ah
>    loop ShiftLoop
>    mov  shifted_byte,ah
> 
> There must be an easier (and smarter) way to speed this up using logical
> op's perhaps ?
> Any Help appreciated.
> 
If its speed you are after, generate a table with 256 one-byte entries
and use table lookup.

table:
   dw 0, 1, 2		; first three entries
   ...
   dw 40h, 80h, 0ffh    ; last three entries


To do the lookup:

   mov bl, byte_to_shift
   xor	bh,hx
   mov	al, table[bx]

Gery Dueck
dueck@brandonu.ca
Newsgroups: comp.os.msdos.programmer