home *** CD-ROM | disk | FTP | other *** search
/ Programming Languages Suite / ProgLangD.iso / C++-7 / DISK7 / SOURCE / STARTUP / CRT0FP.AS$ / CRT0FP
Encoding:
Text File  |  1991-11-06  |  2.0 KB  |  88 lines

  1.     page    ,132
  2.     title    crt0fp - floating point not loaded trap
  3. ;***
  4. ;crt0fp.asm - floating point not loaded trap
  5. ;
  6. ;    Copyright (c) 1986-1992, Microsoft Corporation, All Rights Reserved
  7. ;
  8. ;Purpose:
  9. ;    To trap certain cases where certain necessary floating-point
  10. ;    software is not loaded.  Two specific cases are when 87.LIB
  11. ;    is linked in but no coprocessor is present, and when floating
  12. ;    point i/o conversions are done, but no floating-point variables
  13. ;    or expressions are used in the program.
  14. ;
  15. ;*******************************************************************************
  16.  
  17. ?DF=    1            ; this is special for c startup
  18. include version.inc
  19. .xlist
  20. include cmacros.inc
  21. include defsegs.inc
  22. include rterr.inc
  23. .list
  24.  
  25. CrtDefSegs <code, data>
  26. CrtDefSegs <nmsg>
  27.  
  28. ;    Messages used by _fptrap
  29.  
  30. sBegin    nmsg
  31. assumes ds,data
  32.  
  33. _RTERR    _RT_FLOAT, _RT_FLOAT_TXT, _RT_STANDARD    ; 'floating-point support not loaded'
  34.  
  35. sEnd
  36.  
  37. sBegin    npad
  38. assumes ds,data
  39.     dw    -1
  40. ; no padding for now;
  41. ; MAX padding would be
  42. ;    db    22 dup(0)
  43. sEnd
  44.  
  45. sBegin    code
  46. assumes cs,code
  47.  
  48. externNP _amsg_exit
  49.  
  50. page
  51. ;***
  52. ;_fptrap - trap for missing floating-point software
  53. ;
  54. ;Purpose:
  55. ;    Catches these cases of incomplete f.p. software linked into a program.
  56. ;
  57. ;    (1) 87.LIB chosen, but no coprocessor present;
  58. ;        (i.e., emulator not linked)
  59. ;
  60. ;    (2) "%e", "%f", and "%g" i/o conversion formats specified, but
  61. ;        not all conversion software has been linked in, because the
  62. ;        program did not use any floating-point variables or expressions.
  63. ;
  64. ;Entry:
  65. ;    None.
  66. ;
  67. ;Exit:
  68. ;    None.
  69. ;
  70. ;Uses:
  71. ;    AX.
  72. ;
  73. ;Exceptions:
  74. ;    Transfers control to _amsg_exit which ...
  75. ;    - Writes error message to standard error:  "floating point not loaded";
  76. ;    - Terminates the program by calling _exit().
  77. ;*******************************************************************************
  78.  
  79. labelNP <PUBLIC,_fptrap>
  80.  
  81.  
  82.     mov    ax,_RT_FLOAT    ; issue floating point not loaded
  83.     jmp    _amsg_exit    ;   and die
  84.  
  85. sEnd    code
  86.  
  87.     end
  88.