Path: utzoo!mnetor!tmsoft!torsqnt!news-server.csri.toronto.edu!cs.utexas.edu!helios!bcm!dimacs.rutgers.edu!seismo!uunet!zephyr.ens.tek.com!vice!bobb From: bobb@vice.ICO.TEK.COM (Bob Beauchaine) Newsgroups: comp.lang.pascal Subject: Re: INT 25h problem Summary: Int 25 code Message-ID: <6860@vice.ICO.TEK.COM> Date: 6 Feb 91 20:24:11 GMT References: <25848@adm.brl.mil> Reply-To: bobb@vice.ICO.TEK.COM (Bob Beauchaine) Organization: Tektronix, Inc., Beaverton, OR. Lines: 57 In article <25848@adm.brl.mil> C0361@univscvm.csd.scarolina.edu ( Thomas Jenkins) writes: >Hi, > > Seems to me the problem is best handled with Inline, linked in assembly or >the ASM block in TP 6.0 . Since the flags are left on the stack after the >call, using Intr will never work. The following is from _Turbo_Pascal_Advanced_Techniques_, by Chris Olsen and Gary Stoker, from the Que Programming Series, and is reproduced here without permission from the authors. ************************* Procedure AbsRead(var buf; drive,number,logical : word); var result : integer; begin inline( $55/ { Push BP } $1E/ { Push DS } $33/$C0/ { Xor AX,AX } $89/$86/Result/ { Mov Result,AX } $8A/$86/Drive/ { Mov AL, Drive } $8B/$8E/Number/ { Mov CX, Number } $8B/$96/Logical/ { Mov DX, Logical } $C5/$9E/Buf/ { Lds BX,Buf } $CD/$25/ { Int $25 } $5B/ { Pop BX } $1F/ { Pos DS } $5D/ { Pop BP } $73/$04/ { Jnb Done } $89/$86/Result); { Mov Result,AX } end; Procedure AbsWrite(var buf; drive,number,logical : word); var result : word; begin inline( $55/ { Push BP } $1E/ { Push DS } $33/$C0/ { Xor AX,AX } $89/$86/Result/ { Mov Result,AX } $8A/$86/Drive/ { Mov AL,Drive } $8B/$8E/Number/ { Mov CX,Number } $8B/$96/Logical/ { Mov DX,Logical } $C5/$9E/Buf/ { Lds BX,Buf } $CD/$26/ { Int $26 } $5B/ { Pop BX } $1F/ { Pop DX } $5D/ { Pop BP } $73/$04/ { Jnb Done } $89/$86/Result); { Mov Result,AX if error } end; ************************ Bob Beauchaine bobb@vice.ICO.TEK.COM