🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.os.msdos.programmer
Article #3979

Re: stealing an interrupt

#3979
From: Doug Dougherty
Date: Tue, 18 Dec 1990 19:59
29 lines
1789 bytes
brandis@inf.ethz.ch (Marc Brandis) writes:

>In article <90351.150210TOMIII@MTUS5.BITNET> TOMIII@MTUS5.BITNET (Thomas Dwyer III) writes:
>>Hi there.  Would some kind soul please tell me why my machine hangs when
>>I run this TSR?  What am I doing wrong?

>[some stuff deleted]
>>        assume  cs:code,ds:code,es:code
>....
>>        mov     word ptr [old_int+2],es         ; Save old vector
>>        mov     word ptr [old_int],bx

>Here, there is a rather unsafe assumption that ds points to the code segment
>after DOS has been called. You should better set ds explicitly to code (e.g.
>by push cs, pop ds) or use an segment prefix for cs. However, it is correct
>in this place that ds points to code, it is just unsafe.

Oh, come on.  You can surely assume two things:

	1) DS = CS on entry to a COM program
	2) No DOS call is gonna change DS (unless explicitly stated in
	the documentation; I can't imagine that any do as of this
	writing)

Yes, it is a good idea to be a little paranoid (maybe a lot paranoid)
when doing assembly language programming, but you are taking it too far.

But then again, you probably code in MASM or TASM or something like
that, so it figures you'd be a little paranoid about segment registers...
Technical Details
Message-ID: <valley.661550344@gsbsun>
Path: arc1-ca.pugleaf.net!utzoo!attcan!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!samsung!sdd.hp.com!zaphod.mps.ohio-state.edu!casbah.acns.nwu.edu!accuvax.nwu.edu!midway!valley
References: <90351.150210TOMIII@MTUS5.BITNET> <18633@neptune.inf.ethz.ch>

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!attcan!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!samsung!sdd.hp.com!zaphod.mps.ohio-state.edu!casbah.acns.nwu.edu!accuvax.nwu.edu!midway!valley
From: valley@uchicago (Doug Dougherty)
Newsgroups: comp.os.msdos.programmer
Subject: Re: stealing an interrupt
Message-ID: <valley.661550344@gsbsun>
Date: 18 Dec 90 19:59:04 GMT
References: <90351.150210TOMIII@MTUS5.BITNET> <18633@neptune.inf.ethz.ch>
Sender: news@midway.uchicago.edu (News Administrator)
Organization: University of Chicago
Lines: 29