home *** CD-ROM | disk | FTP | other *** search
/ ftp.update.uu.se / ftp.update.uu.se.2014.03.zip / ftp.update.uu.se / pub / rainbow / msdos / misc / make.lzh / EXEC.ASM < prev    next >
Assembly Source File  |  1986-01-19  |  896b  |  47 lines

  1. ;EXECute a process - DOS call 4B
  2. ;Call:
  3. ;    exec (seg, fspec, param)
  4. ;where
  5. ;    seg    =    segment containing next two args
  6. ;    fspec    =    offset of filespec of program to run
  7. ;    param    =    offset of parameter block for DOS call 4B
  8.  
  9.  
  10. public exec, childcode
  11.  
  12. code    segment public
  13.     assume cs:code
  14.  
  15. exec:    push bp
  16.     mov bp,sp
  17.     push ds
  18.     push es
  19.     mov cs:savess,ss    ;save regs trashed by 4B call
  20.     mov cs:savesp,sp
  21.     mov ax,4[bp]        ;segment containing args
  22.     mov ds,ax
  23.     mov es,ax
  24.     mov dx,6[bp]        ;filespec
  25.     mov bx,8[bp]        ;parameter block
  26.     mov ax,4B00H
  27.     int 21H
  28.     jc fail
  29.     mov ax,0        ;success indicator
  30. fail:    mov ss,cs:savess
  31.     mov sp,cs:savesp
  32.     pop es
  33.     pop ds
  34.     pop bp
  35.     ret
  36.  
  37. savess:    dw (?)
  38. savesp:    dw (?)
  39.  
  40. childcode:
  41.     mov ah,4DH
  42.     int 21H
  43.     ret
  44.  
  45. code    ends
  46.     end
  47.