flat assembler
Message board for the users of flat assembler.
Index
> DOS > How to execute an external program in ASM? Help please..... |
Author |
|
Tomasz Grysztar 19 Sep 2003, 21:49
Yeah, the function 4Bh may be a little hard to use for the beginner. Here's a little example:
Code: org 100h ; first, we need to free the conventional memory we don't use, ; so there will be some memory available for the program we want ; to run, if we used MZ format of executable, the directive ; "heap 0" would be enough for this purpose, in case of .com ; program we have to free that memory manually be resizing the ; memory block starting at our PSP (es is already set to it) mov ah,4Ah ; resize memory block mov bx,10010h shr 4 ; only memory needed for .com int 21h ; now set up the pointer to command line in the parameters block mov word [cmdline],_command mov word [cmdline+2],ds ; we are ready to execute the program now mov ax,4B00h ; load and execute program mov dx,_program ; ASCIIZ path of program mov bx,params ; parameter block int 21h int 20h ; exit program _program db 'c:\command.com',0 _command db 0 ; length of command line db 13 ; must end with CR character params: environment dw 0 ; segment of environment, 0 means to use parent's one cmdline dd ? ; pointer to command line default_fcb1 dd 0 ; pointers to file control blocks default_fcb2 dd 0 |
|||
19 Sep 2003, 21:49 |
|
OzzY 19 Sep 2003, 21:58
Yeah!! That's hard to do... but that's what I was looking for, now I'll get to study
Thanks a lot for the help!!! |
|||
19 Sep 2003, 21:58 |
|
Picnic 07 May 2007, 19:27
I was searching for this. Thanks for the script. This post was old, sorry
-What do you want? -Me? -Yeah. -Two days bed and board. Vriess might want to snag|a part or two. I mean, if it's not imposing... Aliens 4 |
|||
07 May 2007, 19:27 |
|
rugxulo 24 May 2007, 05:45
Isn't there some (old DOS?) bug that needs SS:SP to be saved first?
|
|||
24 May 2007, 05:45 |
|
bttr 24 May 2007, 13:38
Why do you guess? Just read http://www.ctyme.com/intr/rb-2939.htm
|
|||
24 May 2007, 13:38 |
|
< Last Thread | Next Thread > |
Forum Rules:
|
Copyright © 1999-2025, Tomasz Grysztar. Also on GitHub, YouTube.
Website powered by rwasa.