|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
Stay one step ahead of the competition. Evaluate and give feedback
on some of the hottest web development tools on the market today.
Make your opinion heard! Click
Here
|
|
#1
|
||||
|
||||
|
Implementing dir/s in assembly
Hi,
I'm forced to write a program with assembly language ( masm assembler ) which perform multiple tasks, and one of them is to implement dir /s command on it, I mean the ability to find all files and folders in the hard disk and then save it to a file, I've done something like this in C programming language some years ago, but even in C ( which uses dyamic data structures such as link list ) it was difficult to implement, does anyone have any idea, or suggesstion to do this in assembly ? any help would be appreciated ! sincerely,
__________________
I have given a name to my pain and call it "dog": it is just as faithful, just as obtrusive and shameless, just as entertaining, and just as clever as any other dog ! |
|
#2
|
||||
|
||||
|
any opinions ?
|
|
#3
|
||||
|
||||
|
If all you're doing is saving the filenames as soon as you find them, all you need to store is the current directory hierarchy.
Which is pretty easily achieved by using recursion. Prototype a really simple example in C, then translate to ASM (or just save the compiler's asm output and massage it into MASM syntax).
__________________
If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut. |
|
#4
|
||||
|
||||
|
dude, I should only use MASM and assembly for this project , I cannot use programming languages such as C, etc
In this case , how to implement search algorithms such as DFS ,BFS , etc ... in assembly ? !!! as far as I know, there's another way , but I don't know how , I think I should use some interrupts to read the filenames directly from the hard disk. implemeting the logic in assembly would not work in this case , ? can anyone help me with that interrupt ? thanks all ! |
|
#5
|
||||
|
||||
|
just figure out what algorithm in your going to use in C then convert the sytax to asm. It's not exactly cheating, if this is for an assignment or something then it's training you for a real a job and in a real job your going to write it in C first simply because it would be quicker and simpler.
You don't have to write out the whole program in C, just write out the algorithm in pseudo code on a piece of scrap paper first with C's conditionals (if, while, switch) and then start structuring your asm program. the art of assembly book goes over converting those conditionals to asm and even gives you tips on altering them for certain situations to gain a few cpu cycles . Creating complex conditionals through jumps and cmp's in asm without a planned out structure of your program just gives you a headache as it just looks like mud. |
![]() |
| Viewing: Dev Shed Forums > Programming Languages - More > Other Programming Languages > Implementing dir/s in assembly |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|