The MASM Forum Archive 2004 to 2012

Miscellaneous Forums => 16 bit DOS Programming => Topic started by: ninjarider on June 26, 2007, 12:30:57 AM

Title: int 13h
Post by: ninjarider on June 26, 2007, 12:30:57 AM
got a small program that dumps the floppy data to the screen 1 sector at a time. Theres 18 sectors per track, 2 heads, and lik 80 cylinders.

Would code work

BeginingofLoop:
inc cl
cmp cl, 19
je ChangeSector
...


jump BeginingofLoop

ChangeSector:
mov cl, 1
xor dh, 1
cmp dh, 1
je BeginingofLoop
inc ch
jump BeginingofLoop
Title: Re: int 13h
Post by: sinsi on June 26, 2007, 01:46:07 AM

    sub ch,ch    ;start track 0
DoTrack:
    sub dh,dh    ;start head 0
DoSide:
    mov cl,1     ;start sector 1
DoSector:
    ;read one sector
    ;display it or whatever
    inc cl
    cmp cl,18
    jbe DoSector
    inc dh
    cmp dh,1
    jbe DoSide
    inc ch
    cmp ch,80
    jbe DoTrack

Title: Re: int 13h
Post by: ninjarider on June 26, 2007, 02:12:08 AM
with the code you pasted wouldn't it be cmp cl, 19 or is it cmp al, 18
Title: Re: int 13h
Post by: sinsi on June 26, 2007, 02:13:29 AM
18 with JBE, 19 with JB

oops, should also be

    cmp ch,79
    jbe DoTrack

since track is 0..79
Title: Re: int 13h
Post by: ninjarider on June 26, 2007, 02:35:57 AM
thnx. i'll check it out tonight to see if it works the way it should.