HDTenEightyP/NetNews huggingface dataset:
From: sjm@miles.com (Scott Mark)
Subject: Re: Borland C++'s printf
Organization: Miles Inc., Diagnostics Division, Elkhart, IN
Date: Tue, 26 Jan 1993 10:21:43 GMT

In article <1jvp5jINNe3q@uniwa.uwa.edu.au> rmascaro@uniwa.uwa.edu.au (Robert Mascaro) writes:
>I am not sure that this is the right group but here goes. 
>I am writing a TSR using C++ (borland's) and are having trouble with the
>printf statement. I am outputing integer variables to the screen and
>need a printf("%i",x) etc statement. The problem is that it crashes at
>the point of output each time. I have tryed a "cputs" to test the
>problem and this works fine, however any printf statement will crash the
>machine.
>As background, the TSR I mentioned makes a clock tick on the screen
>while using DOS.
>Any suggestions, advice??
>Thanks in advance,
>Rob.

This may help to explain the problem- it may not.

When you try using things like printf() in a TSR you run the risk of
interfering with another "thread" of the function that is running in
the foreground.

There are two ways of preventing disaster in this case.  The simplest way
is to have a semaphore that all the threads fight over.  A semaphore works
the same way as a railroad semaphore -- the guy with the green light gets
to go and everyone else waits to use the track.

When you use a semaphore, you are free to declare local static data
foo()
{
	static char data[36];
}
because only your thread will be writing into that area.

A slightly more complicated way to do this is to write the functions to
be "re-entrant", which means that there is no static local data used by
the function (or any functions that it calls).  With a re-entrant function,
each thread has its own copy of the data on the stack, so the threads don't
interfere with each other's variables.

If memory serves, the printf() function for Microsoft C6 was written to
be re-entrant.  I wouldn't bet your purchase price for C7 on it, though.
It's been a long time since I've been in contact with Peter Golde, who
wrote the thing.

It's common for routines like printf() to either use static data areas or
to call functions that do.  This may be what is happening to your TSR.

Have you tried using sprintf() and then cputs()?  You may have to write
your own routine to do this job.

Scott Mark
sjm@miles.com
Newsgroups: comp.os.msdos.programmer
From: jzawodn@andy.bgsu.edu (jeremy zawodny)
Subject: Re: Borland Pascal with Objects 7.0
Followup-To: sender
Summary: manuals expalin it..
Keywords: pascal, bp
Organization: Bowling Green State Univ.
Distribution: na
Date: Sat, 23 Jan 1993 20:57:11 GMT

In article <PSHUANG.93Jan23132133@freeside.ai.mit.edu> pshuang@zurich.ai.mit.edu (Ping Huang) writes:
>Can somebody who has Borland Pascal 7.0 tell me if the manuals which
>come with it describe the technical details of the compiler output code?
>(For example, TP 3.0 manuals described parameter passing conventions on
>the stack, register usage, etc.) I would like to know in particular if
>it has useful details on how it implements calling functions from .DLL's
>from both DOS and Windows code.

Yes, the manuals explain it fairly well.  Haven't had a need to to it
myself, so my estimation may not be the best.  However, the manuals DO
cover it.

Hope this helps,

Jeremy


-- 
Jeremy Zawodny, Computer Nerd (student) @ Bowling Green State University

jzawodn@andy.bgsu.edu
From: yuval@violet.berkeley.edu (Yuval Oren;B1E;26199;8436073;ZA87)
Newsgroups: comp.os.msdos.programmer
Subject: Re: Dvorak keyboard in DOS 5.0
Date: 23 Jan 1993 08:42:01 GMT
Organization: University of California, Berkeley
NNTP-Posting-Host: violet.berkeley.edu

In article <1993Jan23.050058.26137@freenet.carleton.ca> aa682@Freenet.carleton.ca (Norman Henderson) writes:
>
>I need a means to map the keyboard to the Dvorak layout in DOS -

I use a dvorak layout myself. This is what I did:

Popped all the keys off my keyboard, put them in the DVORAK layout.

Got a TSR called dvorak.com to remap the keys. But I don't know where
I got it, so you can get /pc/keyboard/dvorak.zip from garbo.uwasa.fi,
which will do it through ANSI keyboard redefinition (you need an
ANSI.SYS equivalent). Or, you can get
mirrors/msdos/keyboard/keymap00.zip from wuarchive.wustl.edu. This
lets you easily switch between the two, but you'll have to mess around
with it a bit to get it to default to dvorak.

For Windows, all you need to do is go to the Control
Panel:International and select the Dvorak layout.

Problems:

There is no way to fool programs that do their own keyboard reads.
Lots of games do this.

Yuval

P.S. I really like my new layout. After a few weeks, I can finally
type half-decently! Pretty soon, I'll be burning rubber.



-- 
________________________________________________________________________
|Yuval Oren						               |
|yuval@ocf.berkeley.edu     				               |
| "One spoiled green bird is worth two cooks in the other grass broth."|
Newsgroups: comp.os.msdos.programmer
From: eball12@ursa.calvin.edu (Edward Ball)
Subject: need C++/C MOD player...
Organization: Calvin College
Date: Sat, 23 Jan 1993 05:15:46 GMT

Hi!  I was wondering if anyone out there knows where I can find something
(object code, source code, general info, anything...) that will aid me in my
quest to play a MOD from within a C++/C program (preferrably from memory).
I know about MODOBJ by Mark Cox -- I was wondering if there's anything else
out there that I could look into.  Thanks for any info you can provide...

--
-- Edward Ball, .sigless Knight ------------------------- eball12@calvin.edu --
                                                                             --
Newsgroups: comp.os.msdos.programmer
From: fyu@shanghai.oracle.com (Francis H. Yu)
Subject: Tracing function call path on Ctrl-C break?
Originator: fyu@fyusparc2.us.oracle.com
Organization: Oracle Corporation
Date: Tue, 26 Jan 1993 19:49:39 GMT
X-Disclaimer: This message was written by an unauthenticated user
              at Oracle Corporation.  The opinions expressed are those
              of the user and not necessarily those of Oracle.

Is there any way to let a C program trace back to the function and the
statement in the source file when a Ctrl-C break occur?  I do not want
to run the program in CodeView.

I know that I can use signal() to trap SIGINT, but how do I retrieve
the line number in the source code and function call path?  If I
compile with CodeView debugging flags, the information must be there.

Please kindly reply to fyu@oracle.com.  Thanks.
-- 
Francis H. Yu
Oracle Corporation, 500 Oracle Parkway, Box 659504, Redwood Shores, CA  94065
Email:  fyu@shanghai.oracle.com  Voice:  (415) 506-3129  FAX:  (415) 506-7103
From: beaurega@ireq.hydro.qc.ca (Denis Beauregard)
Newsgroups: comp.os.msdos.programmer
Subject: Re: Unerase - how does it wor
Date: 23 Jan 93 21:09:11 GMT
Organization: Institut de recherche d'Hydro-Quebec, Varennes, Canada

In article <markus.409.727646157@clement.info.umoncton.ca> markus@clement.info.umoncton.ca (PAULIN MARC) writes:
>	Ok.  And what if you have more contiguous space than the actual file 
>size?  UNERASE will bring back a file larger than its original size?  If so, 
>unfragmenting can cause UNERASING problems too.

The size of the file is not erased!

-- 
  \_\    Denis Beauregard  *  internet:beaurega@ireq.hydro.qc.ca
 /   \   Ge'ne'alogiste des familles : Beauregard/Jarret/Jarest/Vincent
J   __>  Un Que'bec renouvele' dans une Ame'rique renove'e
\_.-===  Ope'rateur de "Racines du Que'bec" (514) 922-9636 BBS/Genealogie
From: stb@isbank.is (Steintor Bjarnason)
Newsgroups: comp.os.msdos.programmer
Subject: Wanted: C library for displaying text
Date: 28 Jan 93 15:01:58 GMT
Organization: Islandsbanki, Reykjavik Iceland

I have been using Turbo C Tools from Blaise Computing for the last
2 years but recently programs which have been stable have started 
crashing and acting strangely. I strongly suspect that this is 
connected to the fact that we upgraded to DOS 5.0 and Novell 3.11 recently
and therefore I tried to call Blaise Computing for an update of the package.
Strangely enough there is no one answering the phone and when I looked
through BYTE adverts for the last year I noticed that Blaise Computing
hasn't run an advert for a long time.  

  Is Blaise Computing gone out of business  ? 
  If so can someone suggest a good C library which I can use instead
  of Turbo C Tools ?  What I need is a library which can handle normal
  text output, scroll areas of the screen (instead of the whole screen),
  has decent windowing functions and good keyboard drivers. I have read
  about Greenleafs Super functions and Greenleafs Data Windows.  Has 
  someone used those ?

Please e-answer by e-mail because I suspect that most people are not 
interested in reading about text libraries (instead of GUI libraries) and 
C (instead of something with the word "object" in it).

Thanks
  Steinthor

-- 
Steinthor Bjarnason    | ICEUUG chairman         | This space available for 
Islandsbanki h.f.      | Internet: stb@isbank.is | rent.....
Kringlan 7             |      Tel: +354-1-608000 |
155 Reykjavik, Iceland |      Fax: +354-1-678711 |
Newsgroups: comp.os.msdos.programmer
From: dboese@spartan.ac.BrockU.CA (Darcy Boese)
Subject: Re: Font woes
Organization: Brock University, St. Catharines Ontario
X-Newsreader: Tin 1.1 PL4
Date: Tue, 26 Jan 1993 18:01:59 GMT

I think I can reduce my earlier question about the font modes to this one:

What BIOS calls do you need to make so that a VGA or SVGA card will respond
like an EGA?  I know that VGA etc. can simulate the EGA cards, which would
be perfect?

Also:  How do I detect if a card is already in EGA mode?  I assume that if
       I send the "go to EGA mode" command to an EGA card something bad will
       happen...

Newsgroups: comp.os.msdos.programmer
From: umwan011@ccu.umanitoba.ca (Nga Tat Eddy Wan)
Subject: Direct output to a file.
Organization: University of Manitoba, Winnipeg, Manitoba, Canada
Date: Sat, 23 Jan 1993 20:59:16 GMT
From: exuhag@exu.ericsson.se (James Hague)
Newsgroups: comp.os.msdos.programmer
Subject: Re: Suggestions wanted: A good programmers
Date: 21 Jan 93 14:55:17 GMT
Reply-To: exuhag@exu.ericsson.se
Organization: Ericsson Network Systems, Richardson, TX
X-Disclaimer: This article was posted by a user at Ericsson.
              Any opinions expressed are strictly those of the
              user and not necessarily those of Ericsson.

James Hague writes:
>
>QEdit's big weakness is that it doesn't integrate well with
>compilers or make utilities.  You can call any compiler, yes,
>and redirect output to a file and load that file into a window.
>But there isn't a way to nicely jump from one error to the next
>as most "professional" editors will do.  The macro language isn't
>complete enough to handle the general case of this. 

After having talked with SemWare technical support, I found that
this most definitely _is_ possible.  I had misunderstood some of
the finer points of NextFile and PrevFile.  Actually, I was confusing
the QEdit implementation with a different method used in another
editor.  I have now written macros to jump from error to error using
makefile output (handles multiple source files, etc.).

>I'm curious if anyone has figured out a nice way around this.  I'd
>switch to QEdit in a second if so.

And so I will.  My registration is in the mail.

--
James Hague   
exuhag@exu.ericsson.se
Date: Thursday, 28 January 1993 20:32:15 EST
X-Mailer: TMail version 1.14R
From: "Tim Triemstra" <empath@ais.org>
Organization: Empath Software
Subject: Re: Wanted - PCX Compression algorithm (non 24-bit)
Newsgroups: comp.os.msdos.programmer
Distribution: world

In <1993Jan28.031932.20214@sbcs.sunysb.edu>, ejohnfel@libws4.ic.sunysb.edu () wrote:
   >	OK, I gots myself a teeny problem. I had a book, which had the
   >algo. The I had to register, needless to say I had to return the book. Then
   >I bought a book, almost the same type except its PCX compression algo was
   >for 24-bit only :(
   >
   >	All I need is a quik overview of the algo, and the run and string
   >codes (the actual flag values, ie 0xff or 0xc5 etc.....)

If you still have the book with the 24bit version, the only difference 
between the 24bit version of PCX files and regular 8bit (256 color) files
is that 24bit files are 3 8bit planes of each of the R,G and B values.  So,
you'd read in the palette (the last 768 bytes of the 256 color image) then
grab the header (should be the same for a 24bit image, just expect 1 plane,
not the 3 for a 24bit file) and decode the image.  The rest of the 
compression is the same I believe.

If this isn't a help, I have both Bit-Mapped Graphics and Supercharged
Bit-Mapped Graphics by Rimmer.  I can get a real file put together for you.

I also have the ZSoft specs sheet lying around the other machine.  Let me
know if you need more.  I've written a few different PCX viewers in alot of
languages so I could probably help (although I haven't done much with 24bit
files yet.)

Tim.

-------------------------------------------------------
| When the end comes, there will be two men standing: |
|   Me, and the guy I gotta kill.   - Gosh I'm EVIL   |
------ Tim Triemstra ------------- empath@ais.org -----
Newsgroups: comp.os.msdos.programmer,comp.os.msdos.misc,comp.programming
From: bittware@grebyn.com (Bittware)
Subject: Re: Random number function (SUPPLIED)
Organization: Grebyn Timesharing
Date: Tue, 26 Jan 1993 02:11:58 GMT

I coded this up from an article I think in EDN, by an engineer at 
Tektronix.  The code in the article was in some DSP assembler, and I
converted it to C (isn't that backwards??).  Anyway, it works.  I tested
it on a DSP32c output to a D/A and to a spectrum analyzer.

-----BEGIN RAN32.C-----

#include <math.h>

/* generate 32-bit random noise using DSP32c */

void ran32 (ioval)
unsigned long *ioval;
{

#define  C    0x234567
#define  Alo  0x007465
#define  Ahi  0x000010

  unsigned long Rlo, Rhi;
  unsigned long ar1, ar2, ar3;
  unsigned long t1, t2, t3;

  Rlo = *ioval & 0x00ffff;
  Rhi = *ioval >> 16;
  ar1 = Alo * Rlo;
  ar2 = Alo * Rhi;
  ar3 = Ahi * Rlo;
  t1 = (ar2 + ar3);
  t2 = t1 << 16;
  t3 = ar1 + t2;
  *ioval = C + t3;
}
From: fwbent@watmsg.uwaterloo.ca (Fred Bent)
Newsgroups: comp.os.msdos.programmer
Subject: Microsoft .CRF file format
Date: 21 Jan 93 18:15:45 GMT
Organization: University of Waterloo

Does anyone know the format of Microsoft's .CRF cross reference
file?  I checked the MS-DOS Encyclopedia, but there doesn't seem
to be any information on the .CRF file format in it...

Or, Borland's .XRF file format.  Either one will do...

--
Fred Bent				Department of Computer Science
fwbent@plg.uwaterloo.ca			University of Waterloo
Newsgroups: comp.os.msdos.programmer
From: douglas@cs.scarolina.edu (G. David Douglas Jr.)
Subject: Re: Help - DOS commands from program...
Organization: USC  Department of Computer Science
Date: 27 Jan 93 02:31:43 GMT

jmeyers@ecst.csuchico.edu (Jeff Meyers) writes:

>I have written a simple installation program in Turbo Pascal and am having
>trouble executing DOS commands from within this program.

>If the user types "a:install" everything works fine.  But, if they log to
>the floppy first, then run install ( A:\>install <cr> ) things choke.

>Specifically, the destination directory is not created and so the files
>are all copied into a file in the root directory.  I use the Turbo Pascal
>command exec() to call the following command:

>    \command.com /C md C:\DEST

>I also had trouble logging drives and changing directories under program
>control, but got around that by haveing the install program create the
>appropriate batch file, then executing it...

>Question: am I missing something? Why don't the DOS commands work the
>same as at the command line??

>-- 
>============================================================================
>| Jeff Meyers      |  jmeyers@ecst.csuchico.edu      | 39x43'N  121x48'W   |
>| Chico, Ca 95926  |  KD6DIS@KE6LW.#NOCAL.CA.USA.NA  | Grid: CN80-CM99 ??  |
>============================================================================

Well, ideally I'd like to have more information, but here's a hunch:

Does the floppy disk you're trying to run the utility from have a
copy of COMMAND.COM on it?  If not, and if you're trying to execute
\COMMAND.COM instead of C:\COMMAND.COM, for instance, it probably won't
work -- can't find COMMAND on the floppy disk, so can't execute it.

Also, I don't know which version of Turbo Pascal you're using, but:  does a
command like getenv (or get environment entry) exist in your version?  If so,
you could retrieve the (it _should_ be there) string associated with the
COMSPEC environment variable, and use THAT for the drive-name/directory-path
to a copy of COMMAND.COM to execute.


Just my opinion on what MIGHT be wrong.

One last note:  I once wrote a utility (under Turbo Pascal 3.1 (old, I
know :-)) that does some of the operations (change drive, change
directory, etc.) you describe; problem is, nothing like the  exec  command
was around (had to write my own code to do that).  If I remember correctly,
version 3.1 had a command called  chdir  (change directory) -- does yours?
(Change drive was something else -- I ended up using the DOS-services
(MSDOS ?) function to change disk drive, change file attributes, etc.)
Drop me a line if you'd like a copy of the source code (now just collecting
dust on my disk drive :-).


David Douglas
douglas@usceast.cs.scarolina.edu

Xref: sparky comp.os.msdos.programmer:12514 alt.msdos.programmer:3268 rec.games.programmer:5536 comp.os.ms-windows.programmer.misc:5430
From: scalawag@carson.u.washington.edu (Keith Frederick)
Newsgroups: comp.os.msdos.programmer,alt.msdos.programmer,rec.games.programmer,comp.os.ms-windows.programmer.misc
Subject: MS-DOS,Windows Books/SOftware for Sale
Summary: Misc. software development books/software for sale
Date: 27 Jan 93 08:26:48 GMT
Article-I.D.: shelley.1k5h08INNleb
Distribution: usa
Organization: University of Washington, Seattle
NNTP-Posting-Host: carson.u.washington.edu


 Programming Books and Software for Sale
 -------------------------------------- 


 ALL PRICES _INCLUDE_ SHIPPING IN THE UNITED STATES.


 BOOKS (all in excellent condition)
 ----------------------------------

 Lee Adam's Visualization Graphics in C                 - $10
 Developing Windows Applications with Borland C++ 3     - $15
 Windows API Bible                                      - $20
 Borland C++ Programming for Windows by Norton and Yao  - $15
 Advanced C by Shildt                                   - $10
 An Introduction to Programming in Modula-2             - $10
 PC & PS/2 Video Systems by Walton                      - $20 
 Fundamentals of Fortran 77 programming                 - $12



 MS-DOS SOFTWARE (all with original documentation and disks)
 -----------------------------------------------------------

 C/Math Toolchest with C/Math library and C/Math GRAFIX source	- $30
 Disks for "Computer Graphics" by Foley and Van Dam		- $5
 Borland C++ v3.1 with Application Frameworks & ProtoGen	- $125
 
 (I will provide a stamped envelope and letter that can be sent in order to
  transfer the registration. While I am the registered owner of Borland C++
  I also have a registration card for v3.1 [I originally registered with
  v3.0 and I think they automatically registered me for 3.1 so I never sent
  in the registration card]...anyway, I will transfer the registration over
  to the buyer).  
 ________________________________________________________________________
|                                  |                                     |
| Keith R. Frederick               | Happiness is our moral purpose.     |
| (206)285-1576                    | If you see Dr. Fu Manchu, Kill Him! | 
| scalawag@carson.u.washington.edu | Reason is our only absolute.        |
| I'm not a number, I'm a free man!|-------------------------------------|
| CIS: 73760,3521  UWID: 8722277   | :::   Grad School or Bust!!!    ::: |
|__________________________________|_____________________________________|
From: mcastle@cs.umr.edu (Michael R Castle)
Newsgroups: comp.os.msdos.programmer
Subject: Re: WANTED:  GCC aout -> exe
Date: 27 Jan 93 11:18:54 GMT
Article-I.D.: umr.1993Jan27.111854.14481
Organization: University of Missouri - Rolla, Rolla, MO

In article <EMORENO.93Jan26140004@scheria.NMSU.Edu> emoreno@scheria.NMSU.Edu (Elena M. Castruita) writes:
>
>	Thanks to all who replied about FSF's aout2exe.  I already
>have that.  What I wanted is something that creates an exe file ( out of
>a GCC aout format file ) that DOES NOT use go32.  aout2exe prepends a
>call to go32 to the aout file.  In order to run program hello.exe
>(compiled on machine X) on machine Y, I would need to install go32 on
>machine Y.  That is something I want to avoid if at all possible.  
>
>	Anyone know of anything that will do what I want?

Do this then:

copy /b go32.exe+a.out new.exe

use filenames as appropriate.

Some notes:

This will be slower than using (the supplied) aout2exe.  aout2exe aligns
the appended a.out file on a 4k boundary, which makes for about a 10-25%
increase in paging speed (go32, when it needs to page out something, if 
the victim page is code, it is just discarded and read back in later 
from the a.out file).

This method, if you have several go32 binaries, will eat up a LOT more
disk space. (go32=50430 bytes, stub=6572 bytes)


You can solve the first problem by recompiling aout2exe.  There is a
program someone in the djgpp distribution that filters a binary file
and makes it into a .h file that is all hex.  Usually it's run one 
stub.exe, and aout2exe is built containing all of stub.exe internally.
You should just as easily just use go32.exe instead of stub.  This will
both prepend go32 and page align it for faster execution.



remember, you HAVE to have go32 somewhere in order to run the a.out style
files.   

mrc

-- 
Mike Castle .-=NEXUS=-.  Life is like a clock:  You can work constantly
  mcastle@cs.umr.edu     and be right all the time, or not work at all
S087891@UMRVMA.UMR.EDU   and be right at least twice a day.  -- mrc
    We are all of us living in the shadow of Manhattan.  -- Watchmen
From: djm@adirondacks.eecs.umich.edu (David Musliner)
Newsgroups: comp.os.msdos.programmer
Subject: Q: info on Dr. Halo output formats (.pic/.cut)
Date: 26 Jan 93 19:45:17 GMT
Distribution: usa
Organization: University of Michigan EECS Dept., Ann Arbor, MI

Hi folks, I've got a newbie stupid question for you, and I can't
seem to find the answer in any FAQ or the SIMTEL mirrors....

I need some (Turbo) Pascal code that will read in (and display, eventually)
output from the Dr. Halo drawing program.  I gather that this data has
(at least) two possible formats, called CUT and PIC.  So I'm looking
for either full documentation on those formats or, preferably, some
source code that does the parsing job.

Please email any information you have.  
Thanks! 
-->Dave
djm@eecs.umich.edu
Newsgroups: comp.os.msdos.programmer
From: stoned@wimsey.bc.ca (Darren Stone)
Subject: PHAR LAP Dos-Extender help needed.
Organization: Wimsey Information Services
Date: Fri, 22 Jan 1993 18:23:18 GMT
X-Newsreader: Tin 1.1 PL5

Hiya.  I've just acquired Phar Lap's 286 DOS-Extender.  It seems to work
great with Borland C++ 3.1, with one exception.

Using farmalloc(), I can only seem to allocate 1MB contiguous pieces of
memory - no larger.

What I want is just a few (I assume) lines of code that will return
a char huge * to the largest contiguous piece of memory in my machine
(which I can then reference into like an array).

ie,  unsigned char huge *p = (unsigned char huge *)farmalloc(16*OneMeg);

Phar Lap tech support has not helped that much.  They haven't shown me
a code snippet that works; they've just claimed something about an arbitrary
1MB limit and speculated on workarounds.  At the same time, their manual
claims that farmalloc() has no arbitrary limits, and that you should be able
to grab as much physical memory as you can in one fell swoop.

Has anybody experienced or solved this problem?

Thanx...

- Darren Stone
  stoned@wimsey.bc.ca
  Xanth Software F/X
  Vancouver, B.C.
.

Anybody
should be able to give you as much
Newsgroups: comp.os.msdos.programmer