help on performing ms-dos "dir" command in assembly (tasm)

good day. pls help me on showing a list of files together with its attributes (i.e., file size, date created/modified, location) on the dos prompt just like typing 'dir' in ms-dos. thanks!

Comments

  • : good day. pls help me on showing a list of files together with its attributes (i.e., file size, date created/modified, location) on the dos prompt just like typing 'dir' in ms-dos. thanks!
    :
    [blue]You need INT 21H functions 4E, 4F.[/blue]
  • : : good day. pls help me on showing a list of files together with its attributes (i.e., file size, date created/modified, location) on the dos prompt just like typing 'dir' in ms-dos. thanks!
    : :
    : [blue]You need INT 21H functions 4E, 4F.[/blue]
    :

    got it.. i was able to show the searched file's filenames.. but how can i output its size, location, date/time modified?? are those in ascii format which needs to be converted?

  • : : : good day. pls help me on showing a list of files together with its attributes (i.e., file size, date created/modified, location) on the dos prompt just like typing 'dir' in ms-dos. thanks!
    : : :
    : : [blue]You need INT 21H functions 4E, 4F.[/blue]
    : :
    :
    : got it.. i was able to show the searched file's filenames.. but how can i output its size, location, date/time modified?? are those in ascii format which needs to be converted?
    :
    :
    [blue]size and date/time are inside the FCB in binary format, so you need to convert these values to ASCII. What do you mean by 'location'? If you talking about full path - it is not there - you have to keep track of the path in your code. There is an interrupt returning current working path.[/blue]
  • : : : : good day. pls help me on showing a list of files together with its attributes (i.e., file size, date created/modified, location) on the dos prompt just like typing 'dir' in ms-dos. thanks!
    : : : :
    : : : [blue]You need INT 21H functions 4E, 4F.[/blue]
    : : :
    : :
    : : got it.. i was able to show the searched file's filenames.. but how can i output its size, location, date/time modified?? are those in ascii format which needs to be converted?
    : :
    : :
    : [blue]size and date/time are inside the FCB in binary format, so you need to convert these values to ASCII. What do you mean by 'location'? If you talking about full path - it is not there - you have to keep track of the path in your code. There is an interrupt returning current working path.[/blue]
    :


    got it.. big thanks for the infos..

  • : : : : : good day. pls help me on showing a list of files together with its attributes (i.e., file size, date created/modified, location) on the dos prompt just like typing 'dir' in ms-dos. thanks!
    : : : : :
    : : : : [blue]You need INT 21H functions 4E, 4F.[/blue]
    : : : :
    : : :
    : : : got it.. i was able to show the searched file's filenames.. but how can i output its size, location, date/time modified?? are those in ascii format which needs to be converted?
    : : :
    : : :
    : : [blue]size and date/time are inside the FCB in binary format, so you need to convert these values to ASCII. What do you mean by 'location'? If you talking about full path - it is not there - you have to keep track of the path in your code. There is an interrupt returning current working path.[/blue]
    : :
    :
    :
    : got it.. big thanks for the infos..
    :
    :
    mind asking, but is there a command to convert binary to ASCII??
  • : : : : : : good day. pls help me on showing a list of files together with its attributes (i.e., file size, date created/modified, location) on the dos prompt just like typing 'dir' in ms-dos. thanks!
    : : : : : :
    : : : : : [blue]You need INT 21H functions 4E, 4F.[/blue]
    : : : : :
    : : : :
    : : : : got it.. i was able to show the searched file's filenames.. but how can i output its size, location, date/time modified?? are those in ascii format which needs to be converted?
    : : : :
    : : : :
    : : : [blue]size and date/time are inside the FCB in binary format, so you need to convert these values to ASCII. What do you mean by 'location'? If you talking about full path - it is not there - you have to keep track of the path in your code. There is an interrupt returning current working path.[/blue]
    : : :
    : :
    : :
    : : got it.. big thanks for the infos..
    : :
    : :
    : mind asking, but is there a command to convert binary to ASCII??
    :
    [blue]No CPU command like that, but you can find some code on the Web... basically, you divide the value by 10 until zero is left:

    2390 / 10 - 239 and remainder 0 (add to rem. '0' and you get an ASCII digit '0')

    239 / 10 - 23 and remainder 9 (add to rem. '0' and you get an ASCII digit '9')

    and so on...

    save digits on stack to display them in reverse order.
    [/blue]
  • : good day. pls help me on showing a list of files together with its attributes (i.e., file size, date created/modified, location) on the dos prompt just like typing 'dir' in ms-dos. thanks!
    [code]
    The code below converts a hex DIGIT (0 thru 0Fh) in al to its ascii equivalent, also in al:

    cmp al,10 ;CF = 1 iff al < 10
    sbb al,69h ;subtract w borrow
    das ;now al = ascii(value originally in al)

    I hope you find this useful. Do note that it's only for a DIGIT.

    jf



    [/code]

  • Hello,
    Ralf Brown's interrupt list is available on the net with a Google search.
    It has the INT info for the kinds of stuff you're looking for.
    Get/send data to DTA instead of FCB (File Control Block (extinct)) &
    it works ok. Then a search through the old messages here will get you code for value conversions like binary/hex/decimal to ASCII binary/hex/decimal etc,. There are links listed to code & info here also.
    On the left of this message "ADVANCED SEARCH" is a good place to start.
    One INT does a wild card search & sends the data to DTA. (werks great)

    Gud luk
    Bitdog

Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories