x86 Assembly

Moderators: None (Apply to moderate this forum)
Number of threads: 4556
Number of posts: 16011

This Forum Only
Post New Thread
Single Post View       Linear View       Threaded View      f

Report
help on performing ms-dos "dir" command in assembly (tasm) Posted by jomargon on 30 Jun 2004 at 6:09 AM
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!
Report
Re: help on performing ms-dos "dir" command in assembly (tasm) Posted by AsmGuru62 on 30 Jun 2004 at 7:21 PM
: 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!
:
You need INT 21H functions 4E, 4F.
Report
Re: help on performing ms-dos "dir" command in assembly (tasm) Posted by jomargon on 1 Jul 2004 at 5:35 AM
: : 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!
: :
: You need INT 21H functions 4E, 4F.
:

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?

Report
Re: help on performing ms-dos "dir" command in assembly (tasm) Posted by AsmGuru62 on 1 Jul 2004 at 5:47 AM
: : : 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!
: : :
: : You need INT 21H functions 4E, 4F.
: :
:
: 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?
:
:
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.
Report
Re: help on performing ms-dos "dir" command in assembly (tasm) Posted by jomargon on 1 Jul 2004 at 6:29 AM
: : : : 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!
: : : :
: : : You need INT 21H functions 4E, 4F.
: : :
: :
: : 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?
: :
: :
: 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.
:


got it.. big thanks for the infos..

Report
Re: help on performing ms-dos "dir" command in assembly (tasm) Posted by jomargon on 1 Jul 2004 at 6:39 AM
: : : : : 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!
: : : : :
: : : : You need INT 21H functions 4E, 4F.
: : : :
: : :
: : : 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?
: : :
: : :
: : 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.
: :
:
:
: got it.. big thanks for the infos..
:
:
mind asking, but is there a command to convert binary to ASCII??
Report
Re: help on performing ms-dos "dir" command in assembly (tasm) Posted by AsmGuru62 on 1 Jul 2004 at 3:09 PM
: : : : : : 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!
: : : : : :
: : : : : You need INT 21H functions 4E, 4F.
: : : : :
: : : :
: : : : 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?
: : : :
: : : :
: : : 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.
: : :
: :
: :
: : got it.. big thanks for the infos..
: :
: :
: mind asking, but is there a command to convert binary to ASCII??
:
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.

Report
Re: help on performing ms-dos "dir" command in assembly (tasm) Posted by jfalv on 2 Jul 2004 at 9:44 AM
: 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!
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





Report
Re: help on performing ms-dos "dir" command in assembly (tasm) Posted by Bitdog on 4 Jul 2004 at 6:13 AM
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




 

Recent Jobs

Official Programmer's Heaven Blogs
Web Hosting | Browser and Social Games | Gadgets

Popular resources on Programmersheaven.com
Assembly | Basic | C | C# | C++ | Delphi | Flash | Java | JavaScript | Pascal | Perl | PHP | Python | Ruby | Visual Basic
© Copyright 2011 Programmersheaven.com - All rights reserved.
Reproduction in whole or in part, in any form or medium without express written permission is prohibited.
Violators of this policy may be subject to legal action. Please read our Terms Of Use and Privacy Statement for more information.
Operated by CommunityHeaven, a BootstrapLabs company.