home *** CD-ROM | disk | FTP | other *** search
/ Programming Languages Suite / ProgLangD.iso / Fortran.51 / DISK5 / OS2 / CRT0MSG.AS$ / CRT0MSG.bin
Text File  |  1989-08-31  |  3KB  |  128 lines

  1.     page    ,132
  2.     title    crt0msg - OS/2 startup messages
  3. ;***
  4. ;os2/crt0msg.asm - OS/2 startup error messages
  5. ;
  6. ;    Copyright (c) 1986-1990, Microsoft Corporation.  All rights reserved.
  7. ;
  8. ;Purpose:
  9. ;    Core collection of error messages contained in programs
  10. ;    which use the C startup code.
  11. ;
  12. ;*******************************************************************************
  13.  
  14.  
  15. ?DF=    1            ; this is special for c startup
  16. include version.inc
  17. .xlist
  18. include cmacros.inc
  19. include rterr.inc
  20. .list
  21.  
  22. createSeg HDR,    nhdr,    byte,    public, MSG,    DGROUP
  23. createSeg MSG,    nmsg,    byte,    public, MSG,    DGROUP
  24. createSeg PAD,    npad,    byte,    common, MSG,    DGROUP
  25. createSeg EPAD, nepad,    byte,    common, MSG,    DGROUP
  26.  
  27. createSeg _TEXT, code,    word,    public, CODE,    <>
  28. createSeg _DATA, data,    word,    public, DATA,    DGROUP
  29.  
  30. defGrp    DGROUP            ; define DGROUP
  31.  
  32.  
  33. public    __acrtmsg
  34. __acrtmsg= 9876h
  35.  
  36. ;    Messages used by crt0.asm
  37.  
  38. sBegin    nmsg
  39. assumes ds,data
  40.  
  41.     _RTERR    _RT_STACK, 'stack overflow', _RT_STANDARD
  42.     _RTERR    _RT_INTDIV, 'integer divide by 0', _RT_STANDARD
  43.     _RTERR    _RT_SPACEARG, 'not enough space for arguments', _RT_STANDARD
  44.     _RTERR    _RT_SPACEENV, 'not enough space for environment', _RT_STANDARD
  45.  
  46.     ; Special error message entries
  47.     _RTERR    _RT_CRNL, <13,10>, _RT_STRING
  48.     _RTERR    _RT_BANNER, 'run-time error ', _RT_STRING
  49.  
  50. sEnd    nmsg
  51.  
  52. sBegin    npad
  53. assumes ds,data
  54.     dw    -1
  55. ; no padding for now;
  56. ; MAX padding would be
  57. ;    db    113 dup(0)
  58. sEnd
  59.  
  60. externP _NMSG_WRITE
  61.  
  62.  
  63. sBegin    data
  64.     assumes ds,data
  65.  
  66. globalCP    _adbgmsg,0        ; For C, _FF_DBGMSG is inactive, so
  67.                     ; _adbgmsg is set to null;
  68.                     ; For FORTRAN, _adbgmsg is set to
  69.                     ; point to _FF_DBGMSG in dbginit
  70.                     ; initializer in dbgmsg.asm
  71. sEnd    code
  72.  
  73. sBegin    code
  74.     assumes cs,code
  75.     assumes ds,data
  76.  
  77. page
  78. ;***
  79. ;_FF_MSGBANNER - writes out first part of run-time error messages
  80. ;
  81. ;Purpose:
  82. ;    This routine writes "\r\nrun-time error " to standard error.
  83. ;
  84. ;    For FORTRAN $DEBUG error messages, it also uses the _FF_DBGMSG
  85. ;    routine whose address is stored in the _adbgmsg variable to print out
  86. ;    file and line number information associated with the run-time error.
  87. ;    If the value of _adbgmsg is found to be null, then the _FF_DBGMSG
  88. ;    routine won't be called from here (the case for C-only programs).
  89. ;
  90. ;Entry:
  91. ;    No arguments.
  92. ;
  93. ;Exit:
  94. ;    Nothing returned.
  95. ;
  96. ;Uses:
  97. ;    AX,BX,CX,DX,ES are destroyed.
  98. ;
  99. ;Exceptions:
  100. ;    None handled.
  101. ;
  102. ;*******************************************************************************
  103.  
  104. cProc    _FF_MSGBANNER,<PUBLIC>,<>
  105. cBegin
  106.     mov    ax,_RT_CRNL        ; "\r\n" to begin error message
  107.     push    ax
  108.     callcrt _NMSG_WRITE
  109. if sizeC
  110.     cmp    word ptr [__adbgmsg+2],0
  111.     jz    dbgmsg_inactive
  112.     call    dword ptr [__adbgmsg]    ; call __FF_DBGMSG for FORTRAN
  113. else                    ; not needed for C-only version
  114.     cmp    [__adbgmsg],0
  115.     jz    dbgmsg_inactive
  116.     call    word ptr [__adbgmsg]
  117. endif
  118. dbgmsg_inactive:
  119.     mov    ax,_RT_BANNER        ; run-time error message banner
  120.     push    ax
  121.     callcrt _NMSG_WRITE
  122. cEnd
  123.  
  124.  
  125. sEnd    code
  126.  
  127.     end
  128.