Annotation of os2sdk/startup/os2/execmsg.asm, revision 1.1.1.1

1.1       root        1:        TITLE   execmsg - exec messages
                      2: ;***
                      3: ;5execmsg.asm - OS/2 exec error messages
                      4: ;
                      5: ;      Copyright (c) 1987, Microsoft Corporation.  All rights reserved.
                      6: ;
                      7: ;Purpose:
                      8: ;      error messages used with exec*() library functions
                      9: ;      (and spawn*() functions with P_OVERLAY).
                     10: ;
                     11: ;*******************************************************************************
                     12:        page    ,132
                     13: 
                     14: include        version.inc
                     15: .xlist
                     16: include        cmacros.inc
                     17: .list
                     18: 
                     19: createSeg HDR, nhdr,   byte,   public, MSG,    DGROUP
                     20: createSeg MSG, nmsg,   byte,   public, MSG,    DGROUP
                     21: createSeg PAD, npad,   byte,   common, MSG,    DGROUP
                     22: createSeg EPAD,        nepad,  byte,   common, MSG,    DGROUP
                     23: 
                     24:        page
                     25: 
                     26: ERROR_BAD_ENVIRONMENT = 10
                     27: ERROR_NOT_ENOUGH_MEMORY = 8
                     28: 
                     29: externP        _exit
                     30: externP        _NMSG_WRITE
                     31: externP        _FF_MSGBANNER
                     32: 
                     33: sBegin NMSG
                     34: assumes        ds,data
                     35: 
                     36:        dw      5
                     37:        db      'R6005',13,10,'- not enough memory on exec',13,10,0
                     38:        dw      6
                     39:        db      'R6006',13,10,'- bad format on exec',13,10,0
                     40:        dw      7
                     41:        db      'R6007',13,10,'- bad environment on exec',13,10,0
                     42: 
                     43: sEnd   NMSG
                     44: 
                     45: sBegin NPAD
                     46: assumes        ds,data
                     47:        dw      -1
                     48: ; no padding for now;
                     49: ; MAX padding would be
                     50: ;      db      67 dup(0)
                     51: sEnd
                     52: 
                     53:        page
                     54: 
                     55: sBegin CODE
                     56: assumes        cs,CODE
                     57: 
                     58: page
                     59: ;***
                     60: ;_execmsg - handles fatal exec*() error messages
                     61: ;
                     62: ;Purpose:
                     63: ;      prints out fatal error message for exec failures
                     64: ;      using __FF_MSGBANNER and __NMSG_WRITE,
                     65: ;      and then terminates hard by calling __exit.
                     66: ;
                     67: ;Entry:
                     68: ;      AX == DosExecPgm error return code
                     69: ;
                     70: ;Exit:
                     71: ;      none.
                     72: ;
                     73: ;Uses:
                     74: ;      AX, BX, CX, DX, ES.
                     75: ;
                     76: ;Exceptions:
                     77: ;      Warning:  This routine does not return to the caller, it will always
                     78: ;                exit through __exit().
                     79: ;*******************************************************************************
                     80: 
                     81: cProc  _execmsg,<PUBLIC, NEAR>
                     82: 
                     83: cBegin nogen
                     84: 
                     85:        or      ax,ax           ;See if any DOS error at all
                     86:        jz      Exec_Exit
                     87: 
                     88:        mov     dx,7            ;See if "Bad Environment"
                     89:        cmp     ax,ERROR_BAD_ENVIRONMENT
                     90:        je      Exec_Msg
                     91: 
                     92:        mov     dx,5            ;See if "Out of Memory"
                     93:        cmp     ax,ERROR_NOT_ENOUGH_MEMORY
                     94:        je      Exec_Msg
                     95: 
                     96:        mov     dx,6            ;See if not "Bad Exec"
                     97: 
                     98: Exec_Msg:
                     99:        push    dx              ;Parmeter is the message index number.
                    100:        call    __FF_MSGBANNER  ;write out 13,10,'run-time error '
                    101:        call    __NMSG_WRITE
                    102: 
                    103:        mov     ax,-1
                    104: 
                    105: Exec_Exit:
                    106:        push    ax
                    107:        call    __exit          ;Terminate job.
                    108: 
                    109: cEnd   nogen
                    110: 
                    111: sEnd   CODE
                    112:        end

unix.superglobalmegacorp.com

This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.