home *** CD-ROM | disk | FTP | other *** search
/ Programming Languages Suite / ProgLangD.iso / Fortran.51 / DISK5 / CRT0FP.AS$ / CRT0FP.bin
Text File  |  1989-09-27  |  2KB  |  95 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-1990, 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 rterr.inc
  22. .list
  23.  
  24. createSeg _TEXT, code,    word,    public, CODE,    <>
  25. createSeg _DATA, data,    word,    public, DATA,    DGROUP
  26.  
  27. createSeg HDR,    nhdr,    byte,    public, MSG,    DGROUP
  28. createSeg MSG,    nmsg,    byte,    public, MSG,    DGROUP
  29. createSeg PAD,    npad,    byte,    common, MSG,    DGROUP
  30. createSeg EPAD, nepad,    byte,    common, MSG,    DGROUP
  31.  
  32. defGrp    DGROUP            ; define DGROUP
  33.  
  34.  
  35. ;    Messages used by _fptrap
  36.  
  37. sBegin    nmsg
  38. assumes ds,data
  39.  
  40.     _RTERR    _RT_FLOAT, 'floating-point support not loaded', _RT_STANDARD
  41.  
  42. sEnd
  43.  
  44. sBegin    npad
  45. assumes ds,data
  46.     dw    -1
  47. ; no padding for now;
  48. ; MAX padding would be
  49. ;    db    22 dup(0)
  50. sEnd
  51.  
  52. sBegin    code
  53. assumes cs,code
  54.  
  55. externNP _amsg_exit
  56.  
  57. page
  58. ;***
  59. ;_fptrap - trap for missing floating-point software
  60. ;
  61. ;Purpose:
  62. ;    Catches these cases of incomplete f.p. software linked into a program.
  63. ;
  64. ;    (1) 87.LIB chosen, but no coprocessor present;
  65. ;        (i.e., emulator not linked)
  66. ;
  67. ;    (2) "%e", "%f", and "%g" i/o conversion formats specified, but
  68. ;        not all conversion software has been linked in, because the
  69. ;        program did not use any floating-point variables or expressions.
  70. ;
  71. ;Entry:
  72. ;    None.
  73. ;
  74. ;Exit:
  75. ;    None.
  76. ;
  77. ;Uses:
  78. ;    AX.
  79. ;
  80. ;Exceptions:
  81. ;    Transfers control to _amsg_exit which ...
  82. ;    - Writes error message to standard error:  "floating point not loaded";
  83. ;    - Terminates the program by calling _exit().
  84. ;*******************************************************************************
  85.  
  86. labelNP <PUBLIC,_fptrap>
  87.  
  88.  
  89.     mov    ax,_RT_FLOAT    ; issue floating point not loaded
  90.     jmp    _amsg_exit    ;   and die
  91.  
  92. sEnd    code
  93.  
  94.     end
  95.