home *** CD-ROM | disk | FTP | other *** search
/ Programming Languages Suite / ProgLangD.iso / Fortran.51 / DISK5 / DOS / CRT0MSG.AS$ / CRT0MSG.bin
Text File  |  1989-10-24  |  3KB  |  127 lines

  1.     page    ,132
  2.     title    crt0msg - startup messages
  3. ;***
  4. ;dos/crt0msg.asm - startup error messages
  5. ;
  6. ;    Copyright (c) 1985-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; also contains _FF_MSGBANNER
  11. ;    for writing the first portion of run-time error messages.
  12. ;
  13. ;*******************************************************************************
  14.  
  15.  
  16. ?DF=        1            ; this is special for c startup
  17. include version.inc
  18. .xlist
  19. include cmacros.inc
  20. include rterr.inc
  21. .list
  22.  
  23. createSeg    HDR,    nhdr,    byte,    public, MSG,    DGROUP
  24. createSeg    MSG,    nmsg,    byte,    public, MSG,    DGROUP
  25. createSeg    PAD,    npad,    byte,    common, MSG,    DGROUP
  26. createSeg    EPAD,    nepad,    byte,    common, MSG,    DGROUP
  27.  
  28. createSeg    _TEXT,    code,    word,    public, CODE,    <>
  29. createSeg    _DATA,    data,    word,    public, DATA,    DGROUP
  30.  
  31. defGrp    DGROUP                ; define DGROUP
  32.  
  33.  
  34. public    __acrtmsg
  35. __acrtmsg=    9876h
  36.  
  37. ;    Messages used by crt0.asm
  38.  
  39. sBegin    nmsg
  40. assumes ds,data
  41.  
  42.     _RTERR    _RT_STACK, 'stack overflow', _RT_STANDARD
  43.     _RTERR    _RT_INTDIV, 'integer divide by 0', _RT_STANDARD
  44.     _RTERR    _RT_SPACEENV, 'not enough space for environment', _RT_STANDARD
  45.     ; Special error message entries
  46.     _RTERR    _RT_CRNL, <13,10>, _RT_STRING
  47.     _RTERR    _RT_BANNER, 'run-time error ', _RT_STRING
  48.  
  49. sEnd    nmsg
  50.  
  51. sBegin    npad
  52. assumes ds,data
  53.     dw    -1
  54. ; no padding for now;
  55. ; MAX padding would be
  56. ;    db    114 dup(0)
  57. sEnd
  58.  
  59. externP     _NMSG_WRITE
  60.  
  61. sBegin    data
  62.     assumes ds,data
  63.  
  64. globalCP    _adbgmsg,0    ; For C, _FF_DBGMSG is inactive, so
  65.                 ; _adbgmsg is set to null;
  66.                 ; For FORTRAN, _adbgmsg is set to
  67.                 ; point to _FF_DBGMSG in dbginit
  68.                 ; initializer in dbgmsg.asm
  69.  
  70. sEnd    data
  71.  
  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.  
  106. cBegin
  107.     mov    ax,_RT_CRNL        ; "\r\n" to begin error message
  108.     push    ax
  109.     callcrt _NMSG_WRITE
  110. if sizeC
  111.     cmp    word ptr [__adbgmsg+2],0
  112. else                    ; not needed for C-only version
  113.     cmp    [__adbgmsg],0
  114. endif
  115.     jz    dbgmsg_inactive
  116.     call    [__adbgmsg]        ; near or far call as appropriate
  117. dbgmsg_inactive:
  118.     mov    ax,_RT_BANNER        ; run-time error message banner
  119.     push    ax
  120.     callcrt _NMSG_WRITE
  121. cEnd
  122.  
  123. sEnd    code
  124.  
  125.  
  126.     end
  127.