News:

MASM32 SDK Description, downloads and other helpful links
MASM32.com New Forum Link
masmforum WebSite

int 13h

Started by ninjarider, June 26, 2007, 12:30:57 AM

Previous topic - Next topic

ninjarider

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

sinsi


    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

Light travels faster than sound, that's why some people seem bright until you hear them.

ninjarider

with the code you pasted wouldn't it be cmp cl, 19 or is it cmp al, 18

sinsi

18 with JBE, 19 with JB

oops, should also be

    cmp ch,79
    jbe DoTrack

since track is 0..79
Light travels faster than sound, that's why some people seem bright until you hear them.

ninjarider

thnx. i'll check it out tonight to see if it works the way it should.