How do I load and run an executable from Assembly Language?

I am trying to create a menu with options that point to various executables made also with Assembly Language.

Anyone kind enough to point me to the right direction? I've been Googling the whole day to no avail. I'm in my beginner-advanced stage, so bear with me. I am using ASMENV, if that helps.

Thanks a lot guys.

Comments

  • : I am trying to create a menu with options that point to various
    : executables made also with Assembly Language.
    :
    : Anyone kind enough to point me to the right direction? I've been
    : Googling the whole day to no avail. I'm in my beginner-advanced
    : stage, so bear with me. I am using ASMENV, if that helps.
    :
    : Thanks a lot guys.
    :

    This is plaform dependant. Which OS are you using? The OS will expose functions to do this, but they are specific to that OS.
    You'll need to know how to 'import' these functions in your Assembler. You should look up the Assemblers documentation; it is probably described there.
    I only have (limited) experience with Windows. For Windows, you'll have to link against shell32.dll and import ShellExecute. You can then call this function to run other executables. Alternatively, you could also use CreateProcess with is exposed by kernel32.dll. This means you don't have to link against any further DLL's because any Windows program has to link to at least kernel32.

    Best Regards,
    Richard

    The way I see it... Well, it's all pretty blurry
  • I'm all new to this. I only know the basics. So how do I link DLLs? How do I call them? How do I know what commands are in them?
  • : I'm all new to this. I only know the basics. So how do I link DLLs?
    : How do I call them? How do I know what commands are in them?
    :

    I don't actually know myself, but I think the following site contains the information you need:
    http://www.oopweb.com/Assembly/Documents/Win32ASM/Volume/conapp.htm

    The way to link libraries and import their functions is different per Assembly Language variation (NASM, MASM, TASM, etc...) so you'll need to look at the Assembler's own documentation on how to do this.
    Best Regards,
    Richard

    The way I see it... Well, it's all pretty blurry
  • Thanks for your help.

    I tried "including" another ASM file. It runs but it won't go back to the main ASM.

    Isn't there no other way?

    I only want to make something like...

    A. Exe File 1
    B. Exe File 2
    C. Exe File ...
    D. Exe File n
    E. Exit

    Choice:

    Then after choosing a letter, runs the file. After running the file, going back to the menu.
  • : I'm all new to this. I only know the basics. So how do I link DLLs?
    : How do I call them? How do I know what commands are in them?
    :

    With all due respect, ASMENV was made in 1993. Have you considered upgrading
    to something modern like Fasm (or Windows for that matter)?

    Anyway, there is no concept of a 'Dynamically Linked Library' in DOS, .dll
    files are Windows-only.
  • Our professor is making us use ASMENV. Haha.

    That being the case, how do I run EXEs from my program then? Or how do I run another ASM from my ASM?
  • : Our professor is making us use ASMENV. Haha.

    Bummer :-D

    : That being the case, how do I run EXEs from my program then? Or how
    : do I run another ASM from my ASM?

    You can use interrupt 21h, function 4bh:
    http://www.htl-steyr.ac.at/~morg/pcinfo/hardware/interrupts/inte833k.htm
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