Results 1 to 12 of 12

Thread: INT 13h and Debug->

  1. #1

    Thread Starter
    Frenzied Member
    Join Date
    Feb 2003
    Posts
    1,945

    INT 13h and Debug->

    I tried to get information about a diskdrive using
    the "Get Current Drive Parameters Interrupt", this is the
    code I executed using Debug:

    Code:
    MOV     AH,08
    MOV     DL,00
    INT     13
    RET
    Now this code should have returned information in
    the register and in memory at address ES:BX.
    There is no information in the registers however.

    This program below should read one sector from
    a disk and dump it into the video memory at B800:0.
    I ran this program using Debug as well.
    It uses the "Read Disk Sectors" interrupt.

    Code:
    MOV     AH,02
    MOV     AL,01                  Number of sectors to read.
    MOV     CH,00                  Track.
    MOV     CL,01                  Sector.
    MOV     DH,00                  Head.
    MOV     DL,00                  Drive to access. 
    MOV     BX,B800
    MOV     ES,BX
    MOV     BX,0000
    INT     13
    RET
    Except for the diskdrive becoming active for
    a second (you can see the drive status light turn on)
    Nothing seems to happen.

    Did I do something wrong in the programs above and
    if so what?

    Debug by the way was started from Dos Mode in Windows 95
    so it couldn't be Windows interfering.
    The programs are based on information from Help Pc 2.10
    by David Jurgens.

  2. #2
    Fanatic Member
    Join Date
    Jan 2003
    Posts
    1,004
    What information are you looking for?

  3. #3

    Thread Starter
    Frenzied Member
    Join Date
    Feb 2003
    Posts
    1,945
    I am not sure what you mean, all I was trying to
    do when was working in Debug was to access a disk
    by using BIOS interrupts. Some how the interrupts don't work.
    I posted the message hoping some one would know
    why the interrupts aren't working.

  4. #4
    Fanatic Member
    Join Date
    Jan 2003
    Posts
    1,004
    Now this code should have returned information in
    the register and in memory at address ES:BX.
    There is no information in the registers however.
    There is always a number in the registers. It jus the matter of knowing if it is gibberish or not.

    So, basically, what information are you using out of which registers for your INT13h function 08h?
    "Can't" and "shouldn't" are two totally separate things.

    All questions should be answered. All answers should be true. That is why I post.

  5. #5

    Thread Starter
    Frenzied Member
    Join Date
    Feb 2003
    Posts
    1,945
    Okay, I should have put it differently:
    not "there is no information" but:

    "The registers ES:BX contain the same data as before
    I ran the program."

    When I do a memory dump of the location specified
    by ES:BX the data in memory is the same after
    I run the program as before I ran the program.

    When I enter the following debug command:
    L 100 2 0 1

    The first sector of my first harddisk will loaded at
    DS:100.

    After the L command the data in memory is different
    from what it was before so it seems to be working.

    Basically I am trying to do the same thing
    as with L with my program.

  6. #6
    Fanatic Member
    Join Date
    Jan 2003
    Posts
    1,004
    Well INT 13h function 08h gives the following:
    BL Diskette type
    CH High cylinder/ track number
    CL Cyclinder number and high sector number
    DH High head number
    DL Number of drives attached to the controller
    ESI For diskettes, the segmentffset address of an 11-byte diskette drive parameter table

    Clears the Carry Flag if valid, sets if invalid.

    Is that what you are using for your registers?
    "Can't" and "shouldn't" are two totally separate things.

    All questions should be answered. All answers should be true. That is why I post.

  7. #7

    Thread Starter
    Frenzied Member
    Join Date
    Feb 2003
    Posts
    1,945
    Okay, I think I have been confusing things a little, .

    Let's start over and forget what I said in previous posts:

    I wrote this program in Debug and ran it:

    Code:
    MOV     AH,02                  Select interrupt function "Read Disk Sectors".
    MOV     AL,01                  Number of sectors to read.
    MOV     CH,00                  Track.
    MOV     CL,01                  Sector.
    MOV     DH,00                  Head.
    MOV     DL,00                  Drive to access. 
    MOV     BX,B800
    MOV     ES,BX
    MOV     BX,0000
    INT     13                     Load a sector into memory at ES:BX.
    RET
    This should have loaded a sector into memory, right?
    Well as far as I can tell nothing was loaded.
    Any idea as to why not?

    Oh, like I mentioned before:
    The program is based on information from Help Pc 2.10 by David Jurgens.

    If you want to look at the information yourself
    and don't have Help Pc, you can look for Helppc21.zip
    on the internet.

  8. #8
    Fanatic Member
    Join Date
    Jan 2003
    Posts
    1,004
    Code:
     
    MOV     BX,B800
    MOV     ES,BX
    MOV     BX,0000
    What are you trying to do with that?

    Furthermore, function is:
    Code:
    INT 13h
    "Can't" and "shouldn't" are two totally separate things.

    All questions should be answered. All answers should be true. That is why I post.

  9. #9

    Thread Starter
    Frenzied Member
    Join Date
    Feb 2003
    Posts
    1,945
    code:--------------------------------------------------------------------------------
    MOV BX,B800
    MOV ES,BX
    MOV BX,0000
    --------------------------------------------------------------------------------

    What are you trying to do with that?
    The "Load a sector into memory at ES:BX."
    bit should tell you that. But anyway:
    Code:
    MOV     BX,B800	Set segment address for buffer.
    MOV     ES,BX	Move segment address into segment register.
    MOV     BX,0000	Set offset within segment for buffer.
    Furthermore, function is:


    code:--------------------------------------------------------------------------------
    INT 13h
    Debug assumes all numbers are hexadecimal
    you can't specify otherwise as far as I know.
    That is why I forgot to mention that all numbers
    are hexadecimal.

  10. #10
    Fanatic Member
    Join Date
    Jan 2003
    Posts
    1,004
    Oops. Sorry. NASM on the brain.

    Was the carry flag set after execution?
    "Can't" and "shouldn't" are two totally separate things.

    All questions should be answered. All answers should be true. That is why I post.

  11. #11

    Thread Starter
    Frenzied Member
    Join Date
    Feb 2003
    Posts
    1,945

    Peter Swinkels

    I tried writing my program to read sectors from the disk
    in Nasm before I read this post. The program seemed to work
    this time. I might have some questions later on though.

  12. #12
    Fanatic Member
    Join Date
    Jan 2003
    Posts
    1,004
    Here. I found this while exploring. I don't know if this interest you in any bit.

    http://www.vbforums.com/showthread.p...hreadid=137625
    "Can't" and "shouldn't" are two totally separate things.

    All questions should be answered. All answers should be true. That is why I post.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width