flat assembler
Message board for the users of flat assembler.
Index
> DOS > Executing batch files... |
Author |
|
OzzY 06 May 2004, 23:34
How to execute a ms-dos batch file (*.bat) from an asm program using function ah=4B,al=00 - int 21h ??
|
|||
06 May 2004, 23:34 |
|
Tomasz Grysztar 07 May 2004, 05:35
You should execute system shell (in particular, command.com), with the /C parameter and path to the bath file.
|
|||
07 May 2004, 05:35 |
|
Tomasz Grysztar 09 May 2004, 10:14
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 _end-$ ; length of command line db '/C test.bat' _end 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 |
|||
09 May 2004, 10:14 |
|
Bitdog 07 Jul 2004, 04:20
Resize memory block in a .COM file doesn't seem to do anything usefull.
The only thing I found it usefull for is SB sound DMA probramming where an ABS full seg was needed, then you could find the next ABS seg from CS:0000h and if it left enough room for your .COM code, you could resize & move the stack into the remaining .COM's allocated memory. If you resize memory for the .COM you don't have more segment space to allocate to other external segments since a .COM is only allotted one seg and can't allocate other segments. Please correct me if I'm wrong on anything. Bitdog |
|||
07 Jul 2004, 04:20 |
|
< Last Thread | Next Thread > |
Forum Rules:
|
Copyright © 1999-2024, Tomasz Grysztar. Also on GitHub, YouTube.
Website powered by rwasa.