NASM - The Netwide Assembler

NASM Forum => Example Code => Topic started by: nobody on October 28, 2008, 08:29:45 AM

Title: How can read a sector of HDD?
Post by: nobody on October 28, 2008, 08:29:45 AM
mov ah, 2
mov al, 1         ; How many?
mov ch, 0         ; Cylinder
mov cl, 2       ; Sector
mov dh, 0         ; Head
mov dl, 0               ; Drive
int 0x13
----------------------------------------------
This reads 2th sector of Floppy.

If HDD, the following is the code?
(I wish to read 64th sector of HDD.)

mov ah, 2
mov al, 1
mov ch, 0
mov cl, 64
mov dh, 0
mov dl, 80
int 0x13
Title: Re: How can read a sector of HDD?
Post by: nobody on October 28, 2008, 10:08:47 AM
1. Your code is CHS code - obsolete (OK for obsolete floppy).
2. Address where to read ?
3. OS ? EXE type ? Your "code" will work only from RM in DOS or raw ... maybe also DPMI, but sure not in Linux :-D
4. This looks like a beginners question, not example code :-(
Title: Re: How can read a sector of HDD?
Post by: nobody on October 28, 2008, 12:51:57 PM
Sorry