Path: csiph.com!x330-a1.tempe.blueboxinc.net!usenet.pasdenom.info!aioe.org!news.glorb.com!tr22g12.aset.psu.edu!newsflash.concordia.ca!cs.ubc.ca!utnut!news.uwaterloo.ca!not-for-mail From: Ross Ridge Newsgroups: comp.os.msdos.programmer Subject: Re: Odd problem with int 0x21, ah = 0x4A Date: Sat, 30 Apr 2011 01:02:31 -0400 Organization: University of Waterloo Lines: 21 Message-ID: References: <4db9d42a$0$41117$e4fe514c@news.xs4all.nl> NNTP-Posting-Host: caffeine.csclub.uwaterloo.ca X-Trace: rumours.uwaterloo.ca 1304139751 2307 129.97.134.17 (30 Apr 2011 05:02:31 GMT) X-Complaints-To: abuse@uwaterloo.ca NNTP-Posting-Date: Sat, 30 Apr 2011 05:02:31 +0000 (UTC) Xref: x330-a1.tempe.blueboxinc.net comp.os.msdos.programmer:69 R.Wieser wrote: >Shouldn't you round-up the "shr bx, 4" result (just add 0x000F before >shifting) ? Otherwise it might be 1 to 15 bytes too small ... > >Also, have you checked the value in BX just before the INT 0x21 call ? Does >it match your expectations ? > >My guess is that somehow your stack, and by it your program (and DS) gets >trashed. Yah, that looks like what's exactly happening here. Because of the rounding error you mentioned the program shrinks its memory so that end of the stack is no longer in allocated memory. Ross Ridge -- l/ // Ross Ridge -- The Great HTMU [oo][oo] rridge@csclub.uwaterloo.ca -()-/()/ http://www.csclub.uwaterloo.ca/~rridge/ db //