*/
If you have a PH account, you can customize your PH profile.
*/

View \ABSREAD.ASM

Read the bootsector of a floppy disk

Submitted By: WEBMASTER
Rating: (Not rated) (Rate It)


; ABSREAD.ASM Reads absolute locigcal disk sector
; Function AbsRead(Drive, nSecs, LogSec : Word;
;                  var Buffer); Integer; external;

code    segment byte public
        assume cs:code
        public AbsRead

; Parameters
        Drive   equ       Byte Ptr [BP+12]
        nSecs   equ       Word Ptr [BP+10]
        LogSec  equ      Word Ptr [BP+8]
        Buffer equ     DWord Ptr [BP+4]

; Entry

AbsRead  Proc     Near
        push    Bp
        mov     Bp, sp
        push    ds

; Set up and call Int 25h

        mov     al, Drive
        mov     cx, nSecs
        mov     dx, LogSec
        lds     bx, Buffer
        push    bp
        int     25h
        pop     ax
        pop     bp

; Check for success

        jc      fail
        mov     ax, nSecs
        jmp     exit
fail:   xor        ax, ax

exit:
        pop     ds
        mov     sp, bp
        pop     bp
        ret     10
AbsRead  Endp
code        Ends
                End

corner
© 1996-2008 CommunityHeaven LLC. All rights reserved. Reproduction in whole or in part, in any form or medium without express written permission is prohibited.
Violators of this policy may be subject to legal action. Please read our Terms Of Use and Privacy Statement for more information.
North American business development: Nicolai Wadstrom. Publisher: Lars Hagelin.