HDTenEightyP/NetNews huggingface dataset:
From: ts@uwasa.fi (Timo Salmi)
Subject: Re: Novice question: how to boot from a bat file?
Organization: University of Vaasa, Finland
Date: Mon, 31 Aug 1992 08:41:19 GMT

In article <t0gn_fr.messina@netcom.com> messina@netcom.com (Tony Porczyk) writes:
>ts@uwasa.fi (Timo Salmi) writes:
>>In article <adgn1#p.messina@netcom.com> messina@netcom.com (Tony Porczyk) writes:
>>>begin 666 reset.com
>Well, not to get picky, but the uuencoded post was 1 line long, your
>preaching was 5 pages long.  Talk about a waste of bandwith.

I am very sorry to see that there always are users who either miss
or pretend to miss the point when they have such a nifty term as
"waste of bandwidth" in their vocabulary. 

This was not about a single posting of uuencoded material, but
information about what will happen if the practice of posting
"binaries" to discussion newsgroups becomes more general again.  We
have had that in the past on UseNet with all the unfortunate
repercussions.  Please try to see the forest for the tress before
jumping the gun.  If you take a just a moment longer to read the
five pages (count again btw) and reflect a bit you'll probably be
able see why the logic of comparing the lenth of the two postings
has nothing to do with the actual issue. 

P.S.  Mike's helpful assembly listing is longer than the original
posting, but is perfectly in line with the established practices of
also this newsgroup.  Think why, and it'll come to you. 

   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
From: Jon Freivald <jaf@jaflrn.UUCP>
Newsgroups: comp.os.msdos.programmer
Subject: Re: *************** HELP in DOS 5.0 ******************
Date: Tue, 01 Sep 92 19:54:00 EDT
Organization: The Wizzard's Cave, East Meadow, NY

cholette@JSP.UMontreal.CA (Cholette Martin) writes:

> 
> Hello, I need to concatenate to text files together in DOS 5.0 , I have looke
> in many manuals but I can't seem to find the answer. It seems straight
> forward enough yet I am unable to find the answer. I need to append to text
> files into a single text file a.txt + b.txt -> c.txt
> 
> The equivalent of what I need in UNIX is:
> 
>                         cat a.txt b.txt > c.txt
> 
> Please someone help me, why can't I figure it out???

The DOS equivilent of that would be:

                          copy a.txt + b.txt c.txt
                                  -or-
                          type a.txt > c.txt
                          type b.txt >> c.txt

There are also a few PD versions of cat for DOS running around that will
do just what you want...  I've got source for one around here somewhere
that's ready to go with TurboC if you're interested.

=============================================================================
		   Jon Freivald ( jaflrn!jaf@uunet.UU.NET )
	 Nothing is impossible for the man who doesn't have to do it.
=============================================================================
From: buckley@milton.u.washington.edu ( )
Newsgroups: comp.os.msdos.programmer
Subject: Assembler troubles ...HELP!
Date: 26 Aug 92 03:03:18 GMT
Organization: University of Washington, Seattle

Hello,
  I am very new to assembly language and I have a question.  I am
trying to write a tsr that will write characters typed from they
keyboard into a file.  I have been making my attempts by using
a tsr skeleton provided in Peter Norton's Assembler book.  I have
been able to read the keystrokes and display them on a different
section of screen,make a speaker beeping noise after each keystroke
etc.  My problem is when I try to write the characters to a file.
I can open a file, but after about 5 or 6 keystrokes my system
freezes up.  I have tried all sorts of methods of writing the
characters with no luck.  I have enclosed the basic tsr skeleton
below.  It will open a file, set up the keyboard interrupt vector,
and launch the tsr section of the code.  Could someone help
me in figuring out how to write the characters to a file using
the skeleton of code below?  I could really use the help!!!
Thanks!
Jim
buckley@milton.u.washington.edu


--------------------------CODE STARTS HERE--------------------------------
INTERRUPT_NUMBER        EQU     9
	.MODEL SMALL

ROM_BIOS_DATA   SEGMENT AT 40H   ;keyboard buffer here
	ORG     1AH
	HEAD    DW      ?	 ;unread characters go from Head to Tail
	TAIL    DW      ?
	BUFFER  DW      16 DUP (?)
	BUFFER_END      LABEL   WORD
ROM_BIOS_DATA   ENDS

	.CODE
	ORG     100H
FIRST:  JMP     LOAD_PROG


	OLD_KEY_INT     LABEL   WORD
	OLD_KEYBOARD_INT        DD      ?	;location of old keybd intrpt
	FILE    DB      "D:\ABC.DAT",0		;test file name to write to
	HANDLE  DW	0			;file handle


PROG    PROC
	PUSH    AX
	PUSH    BX
	PUSH    CX
	PUSH    DX
	PUSH    DI
	PUSH    SI
	PUSH    DS
	PUSH    ES
	PUSHF
	CALL    OLD_KEYBOARD_INT

;get character typed
	ASSUME DS:ROM_BIOS_DATA
	MOV     BX,ROM_BIOS_DATA
	MOV     DS,BX
	MOV     BX,TAIL
	CMP     BX,HEAD
	JE      EXIT
	SUB     BX,2
	CMP     BX,OFFSET BUFFER
	JAE     NO_WRAP
	MOV     BX,OFFSET BUFFER_END
	SUB     BX,2
NO_WRAP: MOV    DX,[BX]  ;dx contains character typed

; NEW CODE GOES HERE --


;say an alt-s  (a DX of 1F00)  closes file

	CMP 	DX,1F00H
	JNE	WRITE
	;code to close file goes here
	JMP	EXIT
	
WRITE:
	;code to write characters to file

;end of new code--restore registers
EXIT:   POP     ES
	POP     DS
	POP     SI
	POP     DI
	POP     DX
	POP     CX
	POP     BX
	POP     AX
	IRET
PROG    ENDP


;initialize everything/open file (not part of tsr)
LOAD_PROG       PROC
	
	;OPEN FILE--ASSUME IT ALREADY EXISTS FOR NOW
	MOV     DX,OFFSET FILE
	MOV     AX,3D02H
	INT     21H
	MOV     HANDLE,AX


	;save old intrpt vector
	MOV     AH,35H		
	MOV     AL,INTERRUPT_NUMBER
	INT     21H
	MOV     OLD_KEY_INT,BX
	MOV     OLD_KEY_INT[2],ES
	;set new interrupt vecotr
	MOV     AH,25H
	LEA     DX,PROG
	INT     21H
	MOV     DX,OFFSET LOAD_PROG
	INT     27H
LOAD_PROG       ENDP
END     FIRST
--------------------------------CODE ENDS HERE--------------------------------
From: rwed@hal.gnu.ai.mit.edu (N7YVM)
Newsgroups: comp.os.msdos.programmer
Subject: Re: WANTED: Code to search DOS directory/subdirectories
Date: 1 Sep 92 17:56:31 GMT
Distribution: comp.os.msdos.programmer
Organization: /etc/organization

Heres a little bit of code I wrote to search dir trees for file specs... Its worked well for quite a while...
I used to use norton for this, but it (norton ff) doesnt work well over a CTTY COM1 link...
Theres no bells or whistles, but I want to throw in a filesize and attrib report one day when Im not in
such a rush...


#include <alloc.h>
#include <fcntl.h>
#include <string.h>
#include <io.h>
#include <dir.h>
#include <dos.h>
#include <stdlib.h>
#include <stdio.h>
#include "filefind.h"

const fattrib=FA_RDONLY|FA_HIDDEN|FA_SYSTEM|FA_ARCH;
const dattrib=FA_DIREC;

char currdir[200];

void process_dir(char *pspec,char *mname,char *mext,struct ffblk *ffblock) {
char drive[10], *dir, *name, ext[8], *path;
  dir=(char *)malloc(200);
  name=(char *)malloc(20);
  path=(char *)malloc(300);
  if ( (ffblock->ff_attrib&(FA_DIREC)) &&
       (ffblock->ff_name[0]!='.')      ) {
    fnsplit(pspec,drive,dir,name,ext);
    strcat(dir,ffblock->ff_name);
    strcat(dir,"\\");
    strcpy(currdir,dir);
    fnmerge(path,drive,dir,mname,mext);
    filefind(path);
    }
  free(dir);
  free(name);
  free(path);
  }

void filefind(char *spec) {
char drive[10], *dir,*name, ext[8], *pspec;
struct ffblk *ffblock;

  ffblock=(struct ffblk *)malloc(sizeof(struct ffblk));
  dir=(char *)malloc(200);
  name=(char *)malloc(20);
  pspec=(char *)malloc(300);

  fnsplit(spec,drive,dir,name,ext);
  fnmerge(currdir,drive,dir,"","");

  if (0==findfirst(spec,ffblock,fattrib)) {
    printf("file: %s%s \n",currdir,ffblock->ff_name);
    while (0==findnext(ffblock)) printf("file: %s%s \n",currdir,ffblock->ff_name);
    }

  fnmerge(pspec,drive,dir,"*",".*");

  if (0==findfirst(pspec,ffblock,dattrib)) {
    process_dir(pspec,name,ext,ffblock);
    while (0==findnext(ffblock)) process_dir(pspec,name,ext,ffblock);
    }

  free(dir);
  free(name);
  free(pspec);
  free(ffblock);

  }


int main(int argc, char *argv[]) {

  if (argc<2) {
    puts(" ");
    puts("File finder: ");
    puts("This utility searches the directory structure, starting");
    puts(" at the current or specified dir for a file spec (wild cards valid)");
    puts(" ");
    puts("Example:  filefind *.c");
    exit(1);
    }

  printf("Searching for %s...\n",argv[1]);

  filefind(argv[1]);

  return 0;
  }
From: ts@uwasa.fi (Timo Salmi)
Newsgroups: comp.os.msdos.programmer
Subject: Re: *************** HELP in DOS 5.0 ******************
Date: 30 Aug 92 05:20:59 GMT
Organization: University of Vaasa, Finland

In article <1992Aug30.013239.21315@cc.umontreal.ca> cholette@JSP.UMontreal.CA (Cholette Martin) writes:
>forward enough yet I am unable to find the answer. I need to append to text
>files into a single text file a.txt + b.txt -> c.txt

With copy just use copy a.txt+b.txt c.txt
Another alternative is
 type a.txt > c.txt
 type b.txt >> c.txt

>Please someone help me, why can't I figure it out???

We can try to do the former, answering the latter may be more
difficult :-).  Incidentally, this was generic MsDos information. 
It is not version 5.0 specific. 

..................................................................
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
From: maslar@iccgcc.decnet.ab.com (Mark Maslar x3095)
Newsgroups: comp.os.msdos.programmer
Subject: Read a structure from disk? 
Date: 4 Sep 92 13:50:12 EST


Does anyone know of a simple way of reading an entire structure
from a disk? I'd like to avoid having to read each element of the
structure. Here's what I tried:

/* ************************************************************ */
typedef struct
{
          char  name[33];       /* Company name */
          char  addr1[33];      /* Company address 1 */
          char  addr2[33];      /* Company address 2 */
} address;

address  data;



fscanf(fp, "%address", &data);  /* This DOESN'T work. */
/* ************************************************************ */

Please e-mail any ideas to Mark Maslar at:
     maslar@icd.ab.com     (Internet)


Thanks in advance,
                   Mark Maslar

Newsgroups: comp.os.msdos.programmer
From: brown@NCoast.ORG (Stan Brown)
Subject: Re: Novice question: how to boot from a bat file?
Organization: Oak Road Systems, Cleveland Ohio USA
Date: Wed, 2 Sep 1992 01:38:29 GMT

In article <1992Aug31.084119.29138@uwasa.fi> ts@uwasa.fi (Timo Salmi) writes:
>In article <t0gn_fr.messina@netcom.com> messina@netcom.com (Tony Porczyk) writes:
>>ts@uwasa.fi (Timo Salmi) writes:
>>>In article <adgn1#p.messina@netcom.com> messina@netcom.com (Tony Porczyk) writes:
>>>>begin 666 reset.com
>>Well, not to get picky, but the uuencoded post was 1 line long, your
>>preaching was 5 pages long.  Talk about a waste of bandwith.
>
>I am very sorry to see that there always are users who either miss
>or pretend to miss the point when they have such a nifty term as
>"waste of bandwidth" in their vocabulary. 

Sorry Timo, but I'm with Tony on this one.  _Posting_ any sort of
message to the effect that another article should not have been posted
is almost always making the problem worse.  _Emailing_ may be
beneficial.

The assumption behind your post is that people read it before they post,
and then decide not to.  I don't think that assumption is accurate.
From the way they're phrased, it seems that most of the off-charter posts 
in newsgroups are the result of people posting _without_ thinking, often 
without even reading anything in the newsgroup.

So the people who commit those offenses are not going to be reached by
your posted article because they won't read it--most likely they don't
even subscribe to the newsgroup before posting their first article.  
Posting an article won't prevent first-time offenses.  And to
discourage repeat offenders, private email is almost 
always better than a public article, because email takes (as you know) 
a far smaller share of resources; the rest of us, who already know better, 
don't have to read it; and a polite and private request may succeed
where a public rebuke, however politely phrased, falls on deaf ears (as
this one will, I fear).  When once a discussion on netiquette is
started publicly, it risks degenerating into a flame war, or at least
triggering other tedious articles (like this one, perhaps).

In this case, however, both you and Tony missed what IMHO is the most
important point: the original article omitted quite important facts
which are in the FAQ.  Disregarding those facts, as the article did, can
lead to a loss of data on one's hard disk.  The question of whether
binary should have been posted is nugatory, since the subject was more
fully covered by the FAQ list.
-- 
Stan Brown, Oak Road Systems                      brown@Ncoast.ORG
"Self-esteem, n.  An erroneous appraisement."
"Self-evident, adj.  Evident to one's self and to nobody else."
                                               --Ambrose Bierce
From: bws@ccs.carleton.ca (Brian Sullivan)
Newsgroups: comp.os.msdos.programmer
Subject: 123 and DOS 5.0 EMM
Date: 31 Aug 92 20:31:58 GMT
Organization: Carleton University

When running DOS 5.0 and EMM386 with no page buffer,
attempts to start Lotus 123, result in the 
123 Copyright screen appearing and then 
	
	DOS 123 error: Protected mode requires VCPI within virtual 8086

Does anyone know wha this mean exactly and how to get around 
it. (Stopping EMM386 will do the job, but means I can't
load network driver high ... so there is no room to load large
sreadsheets ..... sigh )
From: resnicks@netcom.com (Steve Resnick)
Newsgroups: comp.os.msdos.programmer
Subject: Re: Another MsDos batch programming challenge
Date: 31 Aug 92 19:17:03 GMT
Organization: What? Me organized? You should see my checkbook!

In article <1992Aug29.152816.14977@cs.ubc.ca> yogi@cs.ubc.ca (Yossi Gil) writes:
>ts@uwasa.fi (Timo Salmi) writes:
>
>>I have another MsDos batch programming challenge for you (I already
>>have a solution).  Write a batch that returns (sets an environment
>>variable) to give the current directory.  Only MsDos internal and
>>external commands are allowed.  (The MsDos command.com command
>>interpreter is to be assumed.  Not 4DOS, not DRDOS.)
>
>Following my tradition of suggesting dirty tricks here is my 3
>lines version: 
>
>cd >> %0
>echo echo %%set%% >> %0
>set set=^Z
>
>(The above should be invoked with the .BAT extension. It should 
>be quite easy to remove this restriction)

Didn't work for me ... I'm using DOS 5.0 - just plain old DOS' command.com.

This is the output, when I run FOO.BAT:

	cd >> foo.bat
	echo echo %set% >> foo.bat
	set set=


Cheers!
Steve

-- 
------------------------------------------------------------------------------
Steve Resnick - resnicks@netcom.com steve@axebbs.kludge.com FidoNet: 1:143/105
"Sometimes you're the windshield, sometimes you're the bug." - M. Knopfler
-----------------------------------------------------------------------------
Newsgroups: comp.os.msdos.programmer
Subject: Re: Environment variables when using system(...) command
From: hdtodd@wccnet.wcc.wesleyan.edu (H. D. Todd)
Date: Wed, 2 Sep 1992 13:01:01 GMT
Organization: Wesleyan University, Middletown, CT USA

In article <1992Sep1.194508.10559@sactoh0.sac.ca.us> sap@sactoh0.sac.ca.us (Stephan A. Puga) writes:
>Subject: Environment variables when using system(...) command
>From: sap@sactoh0.sac.ca.us (Stephan A. Puga)
>Date: Tue, 1 Sep 92 19:45:08 GMT

>If an environment variable is set before a program is run and the
>program makes use of the system(...) command, how can I use the
>environment variable in the system command?  I am writing a program
>to be used on a network and there is a variable "username" set
>before the program is run (this variable by the way is very
>important to how WordPerfect 5.1 runs on the network), my program
>invokes WP51 and tries to pass it the username variable, but it
>doesn't work!  Is there no way I can get the new "local" command
>shell to use the same "old" command shell's variables?

>-- 
>#############################################################
># "Its been surreal!"         #     sap@sactoh0.SAC.CA.US   #  
>#     -- Gogo Dodo            # UUCP=..ames!pacbell!sactoh0 #
>#############################################################

     You need to set variables in the parent-process environment, but there 
are no DOS int calls to let you do that.  You can trace back through the 
PSP's to find the parent-process environment block, though.

     We had the same problem, motivated by WP 5.1 in exactly the same way.
I wrote a program called "envtrim" to trim environment variable names for 
Netware use (specifically for WP).  I have uploaded envtrim.zip to
wsmr-simtel20.army.mil (just yesterday, actually, so it may not be available 
yet).  The distribution package contains the Turbo C source and makefile, 
the .exe file, and a user man page.  I think it'll solve exactly the problem 
you're trying to solve.


                                           David Tod
					   Wesleyan University

Newsgroups: comp.os.msdos.programmer
From: davidson@cs.ubc.ca (Mark Davidson)
Subject: Serial Port Setup
Summary: Need help with system specifics or C code
Keywords: serial input output setup
Organization: Computer Science, University of B.C., Vancouver, B.C., Canada
Date: Wed, 26 Aug 92 20:22:40 GMT


I'm writing an software interface for a PS/2 model 90 to communicate
with a Sony videodisc recorder (LVR-5000) and I'm having problems
setting up the serial port. I looked at the FAQ BTW, I'm using Borland
C++ 3.0 and running it in a DOS window in OS/2 (comp.msdos.programmer)
which refered to two books, neither of which the library or the campus
bookstore has.

I've defined the name and the settings of the port in the following
macro

#define DEFAULT_PORT "COM1: 9600, N, 8, 1"

I've tried "COM1:9600N81" with COM2 as well. I use the DEFAULT_PORT
macro as an argument to the following function:

setup_tty(char *dev_name)
{
   int ofile_d;
   if (!( ofile = fopen(dev_name, "w"))) { 
	fprintf(stderr,"Could not open %s for write\n", dev_name); 
	exit(1);
	}

   if (!( ifile = fopen( dev_name, "r"))) { 
	fprintf(stderr,"Could not open %s for read\n", dev_name);
	exit(1); 
	}
etc...

And I get the first stderr message all the time.

Could someone recommend how to properly set up a serial port for input
and output.

The machine is a PS/2 model 90 running OS/2 2.0 and I'm writing the 
program in a DOS window using Borland C++ 3.0.

Thanks,

 
-- 
******************************************************
* Mark Davidson                   davidson@cs.ubc.ca *
* University of British Columbia     _   ^           *
* Mountain Bike Heaven    ^       @_(*)/   \  ^      *
Newsgroups: comp.os.msdos.programmer
Subject: Re: Invalid Media:  Correction??
From: dueck@brandonu.ca
Date: 31 Aug 92 15:59:02 CST
Organization: Brandon University, Brandon, Manitoba, Canada

In article <1992Aug27.141456.24146@schunix.uucp>, sonix@schunix.uucp (Duane Morin) writes:
> Ok, so, I stay home for ONE sick day, and when I come back, the boss tells me
> that his computer is dead.  This is what it says:  Missing Operating System.
> 
> <deleted>
>
> My question:  We don't want to completely reformat this disk, there's alot 
> of information on it that we hope not to lose.  I would figure that the 
> boot sector has been trashed, not the file allocation tables, so maybe 
> we can resurrect some of the data.  Does anyone know the best way to tackle
> this fairly nasty problem?  Like, can I get to the hard disk to write a new
> media descriptor?  How would I go about doing that?
> 
If you have another computer with the same hard disk, use debug to
transfer a copy of the boot sector from the good disk to the bad disk.

On the machine with the good disk:
C:> debug
-l 100 2 0 1
-n bootblok
-r cx
-CX 0000
: 0200
-w
Writing 00200 bytes
-q
c:>

What you have done is to read (l=load) into cs:100 from drive c (2)
starting at block 0 for 1 block.
The n command specifies a name for the w(write) and r(read) commands.
The r cx command displays the contents of the CX register, which
you then modify to 0200 (512) bytes.
The w command writes CX bytes to the named file.

On the machine with the bad disk, read the bootblock file into
memory and write it to disk

A:> debug bootblok
-w 100 2 0 1
-q
A:>

Let me know how it works out.

Gery Dueck
dueck@brandonu.ca
From: jmt7@ns1.cc.lehigh.edu (JOHN M. TROIANO)
Newsgroups: comp.os.msdos.programmer
Subject: general purpose mouse driver code?
Date: 26 Aug 92 14:55:03 GMT
Organization: Lehigh University


Does anyone know of any (preferably free, but $$ is ok too) code
available in the form of either a link library or C source which I
could use in my own programs? I just need basic mouse functions such
as putting up a cursor, getting the current screen position of the
cursor, and detecting when a button is pressed. I do need to be able
to display the cursor after entering graphics mode (ie. via
"initgraph" in Borland C).

                                Thanks in advance, John M. Troiano
From: messina@netcom.com (Tony Porczyk)
Newsgroups: comp.os.msdos.programmer
Subject: Re: Novice question: how to boot from a bat file?
Date: 1 Sep 92 19:43:36 GMT
Organization: Messina Software

kennu@mits.mdata.fi (Kenneth Falck) writes:

>But anyway, if someone
>wants to reboot from a batch file, why not just first ask the user
>to press a key to signal that he has flushed the cache buffers,
>and then reboot freely?

And of course, if your software grabs the critical error and reboots
the software while running an unattended process (for example at
night), you are going to wait for the user to press a key, right?
Get real.

t.
Newsgroups: comp.os.msdos.programmer
From: davidson@cs.ubc.ca (Mark Davidson)
Subject: Serial Port Setup
Summary: Need help with system specifics or C code
Keywords: serial input output setup
Organization: Computer Science, University of B.C., Vancouver, B.C., Canada
Date: Wed, 26 Aug 92 20:34:29 GMT


I'm writing an software interface for a PS/2 model 90 to communicate
with a Sony videodisc recorder (LVR-5000) and I'm having problems
setting up the serial port. I looked at the FAQ BTW, I'm using Borland
C++ 3.0 and running it in a DOS window in OS/2 (comp.msdos.programmer)
which refered to two books, neither of which the library or the campus
bookstore has.

I've defined the name and the settings of the port in the following
macro

#define DEFAULT_PORT "COM1: 9600, N, 8, 1"

I've tried "COM1:9600N81" with COM2 as well. I use the DEFAULT_PORT
macro as an argument to the following function:

setup_tty(char *dev_name)
{
   int ofile_d;
   if (!( ofile = fopen(dev_name, "w"))) { 
	fprintf(stderr,"Could not open %s for write\n", dev_name); 
	exit(1);
	}

   if (!( ifile = fopen( dev_name, "r"))) { 
	fprintf(stderr,"Could not open %s for read\n", dev_name);
	exit(1); 
	}
etc...

And I get the first stderr message all the time.

Could someone recommend how to properly set up a serial port for input
and output.

The machine is a PS/2 model 90 running OS/2 2.0 and I'm writing the 
program in a DOS window using Borland C++ 3.0.

Thanks,
 
-- 
* Mark Davidson       University of British Columbia  *
* davidson@cs.ubc.ca                                  *