HDTenEightyP/NetNews huggingface dataset:
From: ts@uwasa.fi (Timo Salmi)
Subject: A batch programming contest for you
Organization: University of Vaasa, Finland
Date: Tue, 18 Aug 1992 05:20:17 GMT

As you might know I have a large collection of batch files and
tricks garbo.uwasa.fi:/pc/ts/tsbat36.zip. I am always looking for
useful new information for it.

I have a puzzle for you gentle fellow programmers who are interested
in batch programming. The task is the following.  With the standard
batch commands write a batch that returns the extension of the
(file) name given to the batch as the parameter (%1). No external
commands or programs are allowed to perform the task.

Please note that this is not because I would need the solution. I
already have devised one working solution myself (it has 14 lines
the actuial testing part taking 7 up). I'll be including it to the
next version of TSBAT. But I thought we could for a change try a
programming contest just for everyone's enjoyment. And who knows
what useful batch programming ideas might pop up in the process.

Please post your potential suggestions and solutions in here for
everyone to see. 

   All the best, Timo

..................................................................
Prof. Timo Salmi
Moderating at garbo.uwasa.fi anonymous FTP archives 128.214.87.1
Faculty of Accounting & Industrial Management; University of Vaasa
Internet: ts@uwasa.fi Bitnet: salmi@finfun   ; SF-65101, Finland
Newsgroups: comp.os.msdos.programmer
From: yogi@cs.ubc.ca (Yossi Gil)
Subject: Re: A batch programming contest for you
Organization: Computer Science, University of B.C., Vancouver, B.C., Canada
Date: Wed, 19 Aug 92 08:30:33 GMT

ts@uwasa.fi (Timo Salmi) writes:

>In article <1992Aug18.233207.1159@cs.ubc.ca> yogi@cs.ubc.ca (Yossi Gil) writes:
>>I am away from my DOS machine now, but I think that the above ideas
>>will work after some polishing. 
>>
>>	erase echo.*
>>	copy %1 echo.*
>>	for %%f in (echo.*) do %%f > ext 
>>
>>The extension of %1 should be in the file ext now.
>>
>>Joseph (Yossi) Gil                 {alberta,uw-beaver,uunet}!ubc-cs!yogi

>@echo off
>rem That's a very inventive trick, Yossi.  I expanded a bit. The snag is
>rem the the file must exist in order to get the extension. Another
>rem question is how do you get the extension name into an environment
>rem variable so that we can utilize it.

>if not exist %1 goto _out
>if exist echo.* erase echo.*
>copy %1 echo.* > nul
>for %%f in (echo.*) do %%f > ext
>type ext
>if exist ext erase ext
>:_out

Well, here is how to set it into a variable. It is a bit complex,
and I didn't bother to polish, to make even cryptier (as I really
should have) or document. But, as my students often say, it works
so what else is important? 

set Z=%%Z%%
set G=%%.ext%%
echo %Z%
copy %1 for%Z%.*
echo set Z= %%%%g in (>c.bat
for %%f in (for%Z%.*) do echo %%f ) do set .ext=%%%%g>> c.bat
echo echo %G% >> c.bat
c.bat

>..................................................................
>Prof. Timo Salmi
>Moderating at garbo.uwasa.fi anonymous FTP archives 128.214.87.1
>Faculty of Accounting & Industrial Management; University of Vaasa
>Internet: ts@uwasa.fi Bitnet: salmi@finfun   ; SF-65101, Finland
--
Joseph (Yossi) Gil                 {alberta,uw-beaver,uunet}!ubc-cs!yogi
Dept. of Computer Science          yogi@cs.ubc.ca (cs.ubc.ca=137.82.8.5)
6356 Agricultural Road., Univ. of B.C.,             Tel: +1-604-822-8175
Vancouver, British Columbia, V6T 1Z2, Canada.       Fax: +1-604-822-5485
From: johnb@fexco.ie (John Bowler)
Newsgroups: comp.os.msdos.programmer
Subject: Another test post
Distribution: world
Date: Sat, 15 Aug 92 21:15:08 GMT
Organization: Foreign Exchange Company Ltd.

This is the second test post to the programmer newsgroup.
From: jim@n5ial.chi.il.us (Jim Graham)
Newsgroups: comp.os.msdos.programmer
Subject: problems w/ badly behaved TSRs
Date: 21 Aug 92 13:12:03 GMT
Reply-To: jim@n5ial.chi.il.us
Organization: me?  have you seen my desk?  : -)
Originator: jim@eddie


here's yet another semi-dumb question from me....  I've just released
a program for Amateur Radio (a packet radio terminal program, to be exact),
and it seems to have one little problem.

on slower systems (so far, primarily XT clones, and ONCE on a 286), it
seems that if there are any particularly badly behaved TSRs (the type
that grab the system clock interrupt and don't give it back to the
system, or insist on being the only program attached to that interrupt),
the program crashes, and sends the computer off into the land of null
pointers.

this program does use some functions that operate in the background,
and requires the clock tick interrupt to do this.

is there any way (short of simply telling people not to use those TSRs)
to either
   1) detect that this is GOING to be a problem, or
   2) prevent the problem in advance?

if (1) can be done, is there a way to identify which TSR is associated
with the danger?

also, does anyone know of any problems with Turbo C++ 1.0 (after the 2
patches found on SIMTEL20 are applied) that might cause this?

PS:  the windowing lib, which provides for the background functions, is
UltraWin version 2.10, if that helps people be more familiar with exactly
what I'm using.

any help appreciated.
   --jim

\input std_disclaimer                     % 73 DE N5IAL (/9)
------------------------------------------------------------------------------
"[...] the plural of `mongoose' ought to be `polygoose'." [Jargon file 2.9.10]

INTERNET:  jim@n5ial.chi.il.us  |  grahj@gagme.chi.il.us  |  j.graham@ieee.org
UUCP:  gagme!n5ial!jim@clout.chi.il.us
AMATEUR RADIO:  n5ial@n9hsi (Chicago.IL.US.Earth)
------------------------------------------------------------------------------
From: jimh@ultra.com (Jim Hurley)
Newsgroups: comp.os.msdos.programmer
Subject: DOS Help request - programming without video or keyboard.
Date: 15 Aug 92 21:18:52 GMT
Organization: Ultra Network Technologies

That subject line is a bit vague, let me expand. I am writing
an application in an embedded DOS environment. The product will
have no keyboard or video, I am just using DOS as a file-system,
basically. I will have a small task-switching kernel and
some extra hardware to attach to a special bus where I/O to the
user will occur.

I'm haven't much experience in DOS programming, so I'm not sure
about this part:

If I want one of my processes to, say, format the disk from
a user command, how do I do that? The DOS call will output
all the stuff about inserting the disk, format another?, etc.
But I don't have a keyboard that the BIOS function can get to.

I suppose I will be using the Microsoft C 'system()' call to
do the formatting. As I understand it, this will spawn a second
Command.com environment, but the child task will not inherit
the stdin and stdout of the parent.

The only way I can think of doing it is to write a device driver
for all my I/O processes and issue a redirection to them.

For example, if I have a device called PORTIN: and PORTOUT:
and install proper drivers, I can issue the format command
like this:

    error = system("format a: /s < PORTIN: > PORTOUT:");

and my I/O devices will get the proper characters.
I suppose I have to hook into the critical error interrupts,
control-break stuff, etc., to avoid other problems.

Has anyone done anything like this? Other possibilities,
gotchas, etc?

As I understand it, the device drivers get chained together.
If I have 30 or 40 I/O device drivers installed, will there be
any problems? Are there limits or significant real-time hits?

Any help at all will be greatly appreciated, I can study books to
figure out how to do the stuff, I just want to get off in the
right direction.
-- 
Jim Hurley --> jimh@ultra.com  ...!ames!ultra!jimh  (408) 922-0100
Ultra Network Technologies / 101 Daggett Drive / San Jose CA 95134
Newsgroups: comp.os.msdos.programmer
From: yogi@cs.ubc.ca (Yossi Gil)
Subject: Re: A batch programming contest for you
Organization: Computer Science, University of B.C., Vancouver, B.C., Canada
Date: Wed, 19 Aug 92 16:58:33 GMT

infidel+@pitt.edu (Todd J Derr) writes:

>In article <1992Aug18.213600.27969@cs.ubc.ca> yogi@cs.ubc.ca (Yossi Gil) writes:
>>
>>Don't know about useful, but interesting... Well, how about the self
>>printing batch program that I posted to alt.hackers some time ago:
>>
>>SELFPRNT.BAT:
>>	Bad command or file name
>>
>>And yet another teaser: The above batch file doesn't self print
>>on 4DOS! 

>well, it doesn't self-print with COMMAND.COM either...  when you "List"
>it:

>C:>type selfprnt.bat
>Bad command or file name
>Bad command or file name
>...

>and when you execute it:

>C:>selfprnt

>C:>Bad command or file name
>Bad command or file name

>C:>Bad command or file name
>Bad commmand or file name

I believe there is a typo in the above: Only one of the two pairs
of lines shows up.

>close...  but you are supposed to get *The Same* output if you "List" it
>or Execute it- and you don't.

Stricly speaking, the output is only one "Bad command or file name".
In fact, none of them are the output: one is the standard error
and the other is just an echo. But, otherwise if you wish to consider
the echo as output then I suppose you could always do

REM blah

Not mentioning the ultimate:

	CTTY NUL

or even the more destructive

	CTTY CLOCK$ 



>later,

>todd.

>-- 
>todd j. derr - the c.o.m.a. moderator!  "i've got nothing to say but
>infidel+@pitt.edu       (412) 363-9027   it's ok."
>infidel@pittunix (BIT)  work: 648-1247 
>if your mail bounces, send it to infidel@unix.cis.pitt.edu.  thanks!
--
Joseph (Yossi) Gil                 {alberta,uw-beaver,uunet}!ubc-cs!yogi
Dept. of Computer Science          yogi@cs.ubc.ca (cs.ubc.ca=137.82.8.5)
6356 Agricultural Road., Univ. of B.C.,             Tel: +1-604-822-8175
Vancouver, British Columbia, V6T 1Z2, Canada.       Fax: +1-604-822-5485
From: slb1b@cc.usu.edu (Holographic Banana)
Newsgroups: comp.os.msdos.programmer
Subject: BC++ 3.0 wierd compiler bug? or me?
Date: 13 Aug 92 17:12:17 MDT
Organization: Utah State University

This is really bizzare --

In Borland C++ v3.0 I'm passing a bunch of const char * and char *. The
parameters comming that are giving me wierd results are constant strings,
e.g.

foo("blah");

What is happening is that in the call to foo(),  I get a pointer to a
terminating '\0', i.e. the compiler is treating my calls the same as

foo("");

Has anyone experienced this and have found a remedy???
I'm running DOS 5.0, and compiling with overlays, C++, huge memory model,
fastest code, standard stack frame for debugging.

Thanks, 

James


Newsgroups: comp.os.msdos.programmer
From: fijma@cs.utwente.nl (Duco Fijma)
Subject: Re: OS writing
Organization: University of Twente, Dept. of Computer Science
Date: Wed, 12 Aug 1992 11:49:56 GMT

In article <11AUG199214424286@sscvx1.ssc.gov>, dlittle@sscvx1.ssc.gov (DENNIS LITTLE) writes:
|> In article <yqoBPB2w164w@jksclub.scol.pa.us>, jks@jksclub.scol.pa.us (Jeremy K Summe writes...
|> >I am interested in learning more about how OS's are  created.  Would 
|> >anyon know of a good book or reference for me?  
|> > 
|> >  J|eremy    |  /
|> >  K|enneth   |_/  jks@jksclub.scol.pa.us
|> >  S|ummers   | \  jks@hogbbs.scol.pa.us
|> >         ____|__\
|> There is a book put out that may help that includes the source code to Minix.
|> I haven't personnally ever read the bood (although I may when I have move time)
|> but it should do the trick...  Was put out by Prentice Hall (sp) and I 
|> believe was called Operating Systems Programming.
|> 
|> me

You probably mean: "Operating systems, design and implementation", by
A.S.Tanenbaum. Indeed published by Prentics Hall. A well written book, with a
good balance between theory and practice.

Duco Fijma

Newsgroups: comp.os.msdos.programmer,alt.msdos.programmer
From: Frank Hoffmann <fh.pad@sni.de>
Subject: Re: nonIBM compatibility problem/error?
Organization: Siemens Nixdorf Info.Sys. AG, Paderborn, Germany
Date: Thu, 13 Aug 1992 18:03:22 GMT

aabdalla@pollux.usc.edu (Ahmed Abd-Allah) writes:


>We have written a piece of software that uses a home-grown, text-mode
>windows library.
>...

>Unfortunately, something is simply not working.  Our customer has the
>same software running on an IBM PS/2 with no problem.  But on the 
>above IBM-compatible, at a specific place in the code, the program
>consistently locks up.  We have gone over this area of the source 
>over and over again, and we can see nothing wrong.
>
>One last thing: We asked our customer to send us the computer he was
>using to check it, and we sent him a replacement (another IBM-compatible
>with EGA card, non-IBM PS/2).  The funny thing is we can run the 
>software perfectly in our lab off the computer he sent us!  And what's
>worse is that the new computer we sent him is also failing now too!!
>One more last thing: Our customer uses our system in a clean room.  Is
>there enough noise to mess up program execution - but in the same place
>consistently?!?

With this information given i would tend to say that your customer probably
has an electricity problem. If you're dealing with any peripherals in the
code that locks up, i.e. accessing a printer or a built-in streamer, the
power needed to operate the system increases rapidly. If the electrical in-
stallation is at end, there might be not enough resource to supply the power.

Anyway, if that isn't the case you may email the piece of code here or at
my email-address below. Probably we'll find something obscure in there.

>Thanks for reading this, and more thanks if you can help us...
>Please email at "aabdalla@pollux.usc.edu"

You're welcome...

>Ahmed

frank
-------------------------------------------------------------------------------
    __________                  Frank Hoffmann
     /             /    Siemens-Nixdorf Info. Systems Voice: [+49] 5251 812 209
    /__           /      Dept: AP 52 / SW-Production    Fax: [+49] 5251 811 599
   /' _  _   __  //            Fuerstenallee 7          USA: fh.pad@sni-usa.com
__/__/__(_(_/ /_/^\__    W-4790 Paderborn / Germany    !USA: fh.pad@sni.de
-------------------------------------------------------------------------------
( * )  <--- The green dot.  This mail is reusable. Copy to /dev/null instantly.
-------------------------------------------------------------------------------
From: ralf+@cs.cmu.edu (Ralf Brown)
Newsgroups: comp.os.msdos.programmer
Subject: Re: Why can't I hook INT 21h???
Date: 21 Aug 92 23:16:54 GMT
Organization: School of Computer Science, Carnegie Mellon

In article <1992Aug21.175406.3881@alw.nih.gov> gregh@alw.nih.gov (Gregory Humphreys) writes:
}IMUST disagree here.  I have written numerous similar programs in C and hooking 
}interrupts is just as reliable in C.  There is NOTHING you can't do in C that you CAN in assembley.

Hmm, I sense a challenge.  OK, how about a TSR that only takes 64 bytes when
resident?  Or a swapping spawn() that takes less than 300 bytes while the
child program executes?

-- 
Internet: RALF+@CS.CMU.EDU   |The University would disclaim this if it knew...
FIDO: Ralf Brown 1:129/26.1  |
BIT: RALF%CS.CMU.EDU@CARNEGIE|"Success has a simple formula: do your best,
AT&Tnet: (412)268-3053 school| and people may like it."   -- Sam Ewing
From: tyrant@Aardvark.Rain.COM (Rex Goode)
Newsgroups: comp.os.msdos.programmer
Subject: Re: some questions
Date: 19 Aug 92 15:02:17 GMT
Organization: Steve's UNIX System, Portland, Oregon

blo@fwi.uva.nl writes:

>- Is it possible to link the generated object-code of different languages
>  ( e.g. C, Pascal, C++, etc.) with each other to one executable?

Yes, sort of. You can mix languages at link time given that you know the
rules for doing so in each of the languages are planning on mixing (and of
course follow those rules.) There are probably some combinations not
possible. I could never get IBM BASIC 2.0 (compiler) to mix with C. C/C++
and assembler makes a good combination. You can even link together things
like R:Base and C. The key is knowing the rules which should be spelled
out in the manuals that come with the various compilers.
-- 
----------------------------------------------------------------------------
Stephen Rex Goode        | But common men must have their cheap marvels    |
tyrant@aardvark.rain.com | and wonders. - H.G. Wells                       |
----------------------------------------------------------------------------
Newsgroups: comp.os.msdos.programmer
From: af458@yfn.ysu.edu (Jon K. Salmon)
Subject: Re: How to detect base address of COMx ports?
Organization: Youngstown State University/Youngstown Free-Net
Date: Tue, 18 Aug 1992 02:14:12 GMT


Well, in theory you can look at the 4 WORD values at 40h:00h, which
SHOULD be the port addrs for COM1-COM4.  How safe/reliable this
technique is, I do not know.  There is a similar table of LPT port
addrs (next 4 WORDs?  I don't recall), but I KNOW that is unreliable.

For what it's worth...

-- Jon
-- 
Newsgroups: comp.os.msdos.programmer
From: joe@proto.com (Joe Huffman)
Subject: Re: SVGA drivers for Borland C++ ?
Organization: Prototronics @ Sandpoint, Idaho
Distribution: na
Date: Sat, 15 Aug 1992 07:30:04 GMT

parki@csri.toronto.edu (Brian Parkinson) writes:

>The title line sums it up - I need SVGA drivers.

>Does anyone out there know where I can get a set of drivers
>for Borland C++ ?

Try some of the commerically available graphics libraries.  Take a look
at the libraries from Genus, FlashTek, and Metagraphics.  The FlashTek
library has a BGI interface available so you don't have to rewrite all
your code, just relink and you have SVGA support with a BGI interface.

I work for FlashTek...

-- 
netcom!proto!joe
joe@proto.com
Newsgroups: comp.os.msdos.programmer
From: dmurdoch@mast.queensu.ca (Duncan Murdoch)
Subject: Re: Why can't I hook INT 21h???
Organization: Queen's University
Date: Mon, 17 Aug 1992 20:31:06 GMT

In article <eoq.25.0@vthnw.cvm.msu.edu> eoq@vthnw.cvm.msu.edu (Edward Quillen) writes:
>In article <14339@mindlink.bc.ca> Charlie_Hutchins@mindlink.bc.ca (Charlie Hutchins) writes:
>>Okay, maybe someone could help me here.  I am trying to write a TSR
>>that hooks interrupt 21h but whenever I try and hook that vector I
>>get an invalid command.com error and my system crashes.  

>>void interrupt new21handler(void)
>>{
>>        (old21handler)();
>>}
>>
>Please post replies to this ? because I've always wanted to hook INT 21h
>but have never been able to. Thanks!!!

This is the wrong way to intercept a service interrupt.  Service interrupts 
take arguments in the registers (and sometimes on the stack, but no INT 
21h interrupts do this) and return results in the registers (and sometimes 
on the stack).  

The new21handler above probably changes the values in several registers
before the call, so it'll pass the wrong request to the old handler.  It 
restores the old register values from the stack when it returns; this wipes 
out the result from the service.

Intercepting service interrupts is tricky.  I've no idea how to do it in C, 
but the basic idea is the following:

  1.  On entry, save the registers, and do any preprocessing.
  2.  Restore the registers; if necessary, restore the stack; call the
      old handler.  Note that if parameters are being passed on the stack,
      you need to do some fiddling here to do the call without messing
      up the stack frame.
  3.  When the old handler returns, save the registers, and do any
      postprocessing.
  4.  Restore the returned register values, and return to the original 
      caller.  You have to handle this return carefully:  use RETF 2, not
      IRET.  Otherwise, you'll lose any status information being returned
      in the flags.  

Duncan Murdoch
dmurdoch@mast.queensu.ca
Newsgroups: comp.os.msdos.programmer,comp.sys.ibm.pc.programmer
From: cafe@cbnewse.cb.att.com (richard.dib)
Subject: Programming the 8253 timer
Organization: AT&T
Date: Tue, 18 Aug 1992 15:06:56 GMT
Followup-To: poster
Keywords: 8253 timer interrupts

Hi There:

How can I program the 8253 timer so that it generates an interrupt every
1/2 second, and then execute a particular function?  I am using C language.

Why I want to do this?  I have an interactive type of program already written. 
There is something I want the program to do every 1/2 a second at the same time
the program is doing something else.  That is why I would like to set a timer
to interrupt the program every 1/2 sec and then execute a particular function.

With something like this, minimal modifications will have to be done to the 
original program (25,000 lines) and that is what I am looking for.

Please let me know if you know how to do this using C (Borland C), or if you 
have some book references that I can use. 

Thanks in advance!

Richard Dib
AT&T Bell Laboratories
 
Newsgroups: comp.os.msdos.programmer
From: glowe@nyx.cs.du.edu (Glen Lowe)
Subject: Re: Summary: How to flush keyboard buffer
X-Disclaimer: Nyx is a public access Unix system run by the University
	of Denver for the Denver community.  The University has neither
	control over nor responsibility for the opinions of users.
Keywords: Keyboard buffer, DOS
Organization: Nyx, Public Access Unix at U. of Denver Math/CS dept.
Date: Fri, 14 Aug 92 00:20:06 GMT

In article <1992Aug13.100340.26026@NCoast.ORG> brown@NCoast.ORG (Stan Bro
n) writes:
>In article <3748@keele.keele.ac.uk> coa44@seq1.keele.ac.uk (Mark Scase) 
rites:
>>
>>Many thanks to all the people who replied to my recent question I
>>posted in comp.os.msdos.programmer asking how to flush the keyboard
>>buffer in Borland C under DOS.
>>
>>I received 3 different ways of flushing the keyboard buffer which
>>worked.  They are:
>>
>>while (kbhit()) getch();
>>while (bioskey(1)) bioskey(0);
>
>These two are very likely the same thing.  If they are implemented in
>the obvious way, however, they will miss keystrokes like F12.
>
>>while (bioskey(1)) if (!getch()) getch();
>
>This is a roundabout version of the others.  The difference is that if
>an extended key (function or cursor key) is waiting in the buffer, it
>will be flushed in one pass through the loop rather than two.  But
>there's no advantage to that feature, and it makes the source program
>longer.
>
>I can understand why keyboard input is so confusing.  At a quick count I
>see eight DOS and BIOS functions to take keystrokes from the buffer or
>check the buffer for waiting keystrokes, or both.  No wonder people get
>confused!
>
>-- 
>Stan Brown, Oak Road Systems                      brown@Ncoast.ORG
>
>"Ingrate, n.  One who receives a benefit from another, or is otherwise
>an object of charity."                          --Ambrose Bierce


Try fflush(stdin);

Glen Lowe
(sorry no fancy sig...)
Newsgroups: comp.os.msdos.programmer
From: parki@csri.toronto.edu (Brian Parkinson)
Subject: SVGA drivers for Borland C++ ?
Organization: CSRI, University of Toronto
Distribution: na
Date: 13 Aug 92 12:28:45 GMT

The title line sums it up - I need SVGA drivers.

Does anyone out there know where I can get a set of drivers
for Borland C++ ?

Any help on this matter would be greatly appreciated.

Your,
parki...
-- 
					What's the point in callin' shots
Brian Parkinson				This cue ain't straight in line
<parki@csri.toronto.edu.ca>		The cue-ball's made of styrofoam
					And no-one's got the time

Newsgroups: comp.os.msdos.programmer
From: holder@telesoft.com (Robert L. Holder @ignite)
Subject: gmake for dos
Keywords: GNU gmake
Organization: TeleSoft, San Diego, CA, USA
Date: Fri, 14 Aug 1992 22:04:42 GMT

Does GNU gmake exist for msdos?
From: nevries@accucx.cc.ruu.nl (Nico E de Vries)
Newsgroups: comp.os.msdos.programmer
Subject: Re: Compression Algorithms Required !
Date: 18 Aug 92 13:18:32 GMT
Organization: Academic Computer Centre Utrecht

In <ebolog.4@elaine.ee.und.ac.za> ebolog@elaine.ee.und.ac.za (EDWIN BOLOGNA : THIRD) writes:


>If anyone out there has or knows where I can get my hands on ASM, C, or
>PAS compression routines for LZH, or any other good compression algorithm
>could you please mail me a copy.

There are zilions of this. comp.compression FAQ is a very good starting
place.

>                Fellow Programmer
>                        E.B. (EBOLOG@ELAINE.EE.UND.AC.ZA)

Nico
Newsgroups: comp.os.msdos.programmer