🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.os.msdos.programmer
Article #3495

Help with DOS function 4B00 (Exec)

#3495
From: Scott C. Sadow
Date: Mon, 05 Oct 1992 14:12
93 lines
2528 bytes
I am having a problem with using DOS function 4B00 (Exec). It is returning
carry set with error code 3 - Path Not Found. I have tried using DOS
function 4E (FindFirst) and it can find the file. I have tried using DOS
function 59 (Get extended error), but it also tells me Path Not Found. I
don't know where else to look. Does anyone have any ideas? (by the way,
this is not the "real" code, but this is a small sample code that shows
the problem.)

Reply via email for long answers and I will summarize...


Here is the source code:


        .186
        ideal
        jumps
        model   small,pascal

        stack
        codeseg


struc   Pointer
Ofs     dw      0
Seg     dw      0
ends    Pointer



Start:
        MOV     AX,[DS:2CH]             ;PSP Environ Seg
        MOV     [EnvSeg],AX

        MOV     [CmdTail.Seg],DS
        MOV     [CmdTail.Ofs],80H       ;PSP Command Length

        MOV     [FCB1.Seg],DS
        MOV     [FCB1.Ofs],5CH          ;PSP Unopened FCB1

        MOV     [FCB2.Seg],DS
        MOV     [FCB2.Ofs],6CH          ;PSP Unopened FCB2

        MOV     BX,SP                   ;calculate memory needed
        ADD     BX,15                   ;round up
        SHR     BX,4
        MOV     AX,SS
        ADD     BX,AX
        MOV     AX,DS
        SUB     BX,AX
        MOV     AH,4AH                  ;DOS ModifyMem
        INT     21H
        JC      @@Exit

        MOV     DX,CS
        MOV     DS,DX
        MOV     DX,offset Filename

        XOR     CX,CX
        MOV     AH,4EH                  ;DOS FindFirst
        INT     21H

        MOV     BX,CS
        MOV     ES,BX
        MOV     BX,offset ExecParam

        MOV     AX,4B00H                ;DOS Exec
        INT     21H

@@Jmp   Pointer ?

        MOV     AH,59H                  ;DOS GetExtendErr
        INT     21H

@@Exit:
        MOV     AH,4CH                  ;DOS Exit
        INT     21H

ExecParam:
EnvSeg          dw      ?
CmdTail         Pointer ?
FCB1            Pointer ?
FCB2            Pointer ?

Filename        db      'C:\EXE\TEST.EXE',0

        end     Start


   Scott C. Sadow
   scott@mycro.UUCP
   ...gatech!nanovx!mycro!scott
Technical Details
Message-ID: <1992Oct05.101203@mycro.UUCP>
Path: arc1-ca.pugleaf.net!sparky!uunet!ukma!wupost!emory!wa4mei!nanovx!mycro!scott

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!sparky!uunet!ukma!wupost!emory!wa4mei!nanovx!mycro!scott
From: scott@mycro.UUCP (Scott C. Sadow)
Newsgroups: comp.os.msdos.programmer
Subject: Help with DOS function 4B00 (Exec)
Message-ID: <1992Oct05.101203@mycro.UUCP>
Date: 5 Oct 92 14:12:03 GMT
Lines: 93