DOS Command

I need to write an assembly program simulate to the DEL DOS Command..??
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

It is not a problem. Use debug program under dos and everything will be ok.

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Somebody asks for a program and you, Stefan, suggest to use a debugger?

What would you suggest if someone asks for a printer? perhaps a sound card?

I have a rough understanding of how debug can help your assembly piece if you are having trouble with a compiler or compiled version of what you think should work.  I have no clue on the intent of the effort or how that would help, as in:

Why not just use DOS, or more clearly, what is meant by

"simulate to"

Is your intent to delete the file the same way that DOS does? Or to 'pretend to' delete.  If I wanted to do 'like DOS' does it, my personal preference would be to skip the code and do DOS.

I'd recommend checking your assembler (documentation or help) for its method to 'shell' out to DOS (CLI).

Or perhaps you are looking for how to tell a program to run any DOS command, for example, the delete command (if the assembler does not have good online help).  That'd be more a programming q:.

If you really want to get into coding, the question may be more appropriate for the programming section here. Perhaps you are trying to beef up on how Microsoft uses s/w 'interrupts' for example. [implying, a q: on how to access s/w interrupts from assembly lang]
Delete file is INT 21H, function 41H

Call with DS:DX pointing to zero terminated ASCII string with file name. Wild cards are not allowed.

Returns AX with error code. 00H = Success, 02H = File Not Found, 05H = Access Denied (file is R/O)

Assuming that you had a string in memory you could code:

PUSH CS         'Save code segment on stack
POP DS           'Load into data segment
MOV DX, 80H   'Point to address where string is saved
MOV AL, 21H   'DOS services code
MOV AH, 41H  'Delete file opcode
INT 21H          'Have DOS do it
MOV AH, 4CH  'Terminate (Status returns in AL)
INT 21H         'Bye!

THis is just about compilable as a COM program...


It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today

From novice to tech pro — start learning today.