home *** CD-ROM | disk | FTP | other *** search
- Path: sparky!uunet!ogicse!news.tek.com!vice!bobbe
- From: bobbe@vice.ICO.TEK.COM (Robert Beauchaine)
- Newsgroups: comp.lang.pascal
- Subject: Re: Help!: ABS SECT (C:) Read/writes!!
- Message-ID: <10745@vice.ICO.TEK.COM>
- Date: 12 Nov 92 20:56:25 GMT
- Article-I.D.: vice.10745
- References: <1992Nov9.173332.1@uwovax.uwo.ca>
- Organization: Tektronix, Inc., Beaverton, OR.
- Lines: 66
-
-
- Taken from _Turbo_Pascal_Advanced_Techniques_, Ohlsen/Stoker, from
- Que.
-
- Call with drive = 0 for A, 1 for B, etc.
- Number is the count of sectors to read/write
- Logical is the starting sector
-
- Note that there is a result variable that is never actually used.
- You may examine that error code in the procedures if necessary. A
- technical DOS reference should point the way.
-
- 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/ {Pop DS}
- $5D/ {Pop Bp}
- $73/$04/ {JNB Done}
- $89/$86/Result);{Mov Result,AX}
- {Done:}
- end;
-
-
- Procedure AbsWrite(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/$26/ {Int 26 }
- $5B/ {Pop Bx}
- $1F/ {Pop DS}
- $5D/ {Pop Bp}
- $73/$04/ {JNB Done}
- $89/$86/Result);{Mov Result,AX}
- {Done:}
- end;
-
- /\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\
-
-
- Bob Beauchaine bobb@vice.ICO.TEK.COM
-
- C: The language that combines the power of assembly language with the
- flexibility of assembly language.
-
- Real friends don't let friends use UNIX.
-