home *** CD-ROM | disk | FTP | other *** search
/ Liren Large Software Subsidy 7 / 07.iso / c / c082_144 / 7.ddi / EMUSRC.ZIP / EMUVARS.ASI < prev    next >
Encoding:
Text File  |  1992-06-10  |  7.0 KB  |  212 lines

  1. ;[]-----------------------------------------------------------------[]
  2. ;|      EMUVARS.ASI  --  emulator variables for assembler            |
  3. ;[]-----------------------------------------------------------------[]
  4.  
  5. ;
  6. ;       C/C++ Run Time Library - Version 5.0
  7. ;       Copyright (c) 1986, 1992 by Borland International
  8. ;       All Rights Reserved.
  9.  
  10.  
  11. ;       This file is designed to be included both by the start-up
  12. ;       module (C0.asm, for C) and by the emulator.  The data is
  13. ;       actually allocated in startup, and externally referenced
  14. ;       from the emulator.
  15.  
  16.  
  17. ; The Use of Interrupt Vectors
  18.  
  19. ;       There are 11 interrupt vectors.  The first 8 map onto the 8 floating
  20. ;       point instruction patterns:
  21.  
  22. ;               {WAIT   ESC n } -->  INT (34h + n), where n is in (0..7)
  23.  
  24. ;       No segment prefixes may apply to these patterns.
  25.  
  26. ;       The ninth interrupt provides instructions with segment prefixes:
  27.  
  28. ;               {WAIT   ES: ESC n } --> INT (3Ch), byte (C0h + n)
  29. ;               {WAIT   CS: ESC n } --> INT (3Ch), byte (80h + n)
  30. ;               {WAIT   SS: ESC n } --> INT (3Ch), byte (40h + n)
  31. ;               {WAIT   DS: ESC n } --> INT (3Ch), byte (00h + n)
  32.  
  33.  
  34. ;       The tenth interrupt corresponds to the sequence NOP, FWAIT, and
  35. ;       is a no-op for emulation purposes.
  36.  
  37. ;       The eleventh interrupt provides Borland-defined shortcuts.
  38.  
  39.  
  40.  
  41. ;       Data space is actually allocated in the stack segment by C0.asm,
  42. ;       the start-up module, and accessed by the emulator via externs.
  43. ;       It is initialized during the first emulated FINIT instruction.
  44.  
  45.  
  46. EmuAssume@      MACRO   aSeg
  47.         ASSUME  aSeg : SEG __emu
  48. ENDM
  49.  
  50. EmuNothing@     MACRO   aSeg
  51.         ASSUME  aSeg : NOTHING
  52. ENDM
  53.  
  54. ; See EMUVARS.H for C equivalents of these declarations.
  55.  
  56.  
  57. ; An iNDP_image is put into memory by the FSTENV instruction.
  58.  
  59. iNDP_environ    STRUC
  60.         ndp_control     dw      ?
  61.         ndp_status      dw      ?
  62.         ndp_tags        dw      ?
  63.         ndp_ip          dw      ?
  64.         ndp_ip_opcode   dw      ?
  65.         ndp_dp          dw      ?
  66.         ndp_dptop       dw      ?
  67. iNDP_environ    ENDS
  68.  
  69.  
  70. fpu     struc
  71.  
  72. ;       The 80x87 present shortcuts use ws_status too.
  73. ws_status       dw      ?       ; result of comparisons
  74.  
  75. ; Variables used by emulator and '87 trap handler.
  76.  
  77. ; used for shadow mask if '87 present
  78. ws_control      dw      ?       ; processing options and exceptions.
  79.  
  80. ; used by trap handler if '87 present
  81. ws_adjust       dw      ?       ; adjusts TOS at exit
  82. ws_8087         db      ?       ; same as _8087
  83. ws_protected    db      ?       ; same as _protected
  84. ws_type         dw      ?       ; type of error, if fatal
  85. ws_LDT          dw      ?       ; same as _LDT
  86.  
  87. ; The stack.
  88. ws_TOS          dw      ?       ; current level of e87 register stack
  89. ws_lastSP       dw      ?       ; low end of stack
  90. ws_initSP       dw      ?       ; high end of stack
  91.  
  92. ; Variables used by '87 trap handler.
  93. environ iNDP_environ    <>
  94. ecount1         dw      ?
  95. ecount2         dw      ?
  96. ws_status2      dw      ?
  97. fpx1            dt      ?
  98. fpsword         dw      ?
  99.  
  100. ;       The remaining data areas are not needed if an 87 chip is present.
  101.  
  102. ;ws_fixSeg      dw      ?       ; selector implied by segFix
  103. ws_BPsafe       dw      ?       ; keep BP --> userRegs here for safety.
  104. ws_stamp        dd      ?       ; after initialization, 'emu', 87h
  105. ws_version      dw      ?       ; 1 for TC2,TP5,Q2; 2 for TB2; 3 for TC3,TP6
  106. ws_stackStyle   db      ?       ; shortcuts-88 stack frame style
  107. ws_unsigned     db      ?       ; allows handling unsigned integers
  108.  
  109. IF _Strict87_
  110. ws_instrnPtr    dd      ?       ; used with error recovery
  111. ws_dataPtr      dd      ?       ; --------- " ------------
  112. ws_instruction  dw      ?       ; bytes swapped, used for error recovery
  113. ENDIF
  114.  
  115. ;       The vector save areas are overlayed by "emws_temp32" and
  116. ;       "emws_MBZ32" for shortcuts when the 80x87 is present.
  117. ;       These two MUST be contiguous.
  118.  
  119. ws_saveVector   dd      ?       ; prior contents of NMI vector
  120. ws_nmiVector    dd      ?       ; PC/AT error vector for 80x87 exceptions
  121.  
  122. ;       Indirect Shortcuts-88 entry table.  Maintain exact match to
  123. ;       the order in emuShtCt.asm and e87ShtCt.asm.
  124.  
  125. IF _shortcuts88_
  126.         __isc88table    label   DWORD
  127.         __ifp_ldxds     dd      ?
  128.         __ifp_ldxss     dd      ?
  129.         __ifp_ldxes     dd      ?
  130.         __ifp_ldxcs     dd      ?
  131.         __ifp_lddds     dd      ?
  132.         __ifp_lddes     dd      ?
  133.         __ifp_lddss     dd      ?
  134.         __ifp_ldint     dd      ?
  135.         __ifp_lduint    dd      ?
  136.         __ifp_ldlng1    dd      ?
  137.         __ifp_ldulng1   dd      ?
  138.         __ifp_lds1      dd      ?
  139.         __ifp_ldz       dd      ?
  140.         __ifp_ld1       dd      ?
  141.         __ifp_ldpi      dd      ?
  142.         __ifp_stps      dd      ?
  143.         __ifp_stplng    dd      ?
  144.         __ifp_stpuln    dd      ?
  145.         __ifp_stpuint   dd      ?
  146.         __ifp_stpint    dd      ?
  147.         __ifp_stpdes    dd      ?
  148.         __ifp_stpdds    dd      ?
  149.         __ifp_stpdss    dd      ?
  150.         __ifp_stpxes    dd      ?
  151.         __ifp_stpxds    dd      ?
  152.         __ifp_stpxss    dd      ?
  153.         __ifp_ldcw      dd      ?
  154.         __ifp_error     dd      ?
  155.         __ifp_neg       dd      ?
  156.         __ifp_divrv     dd      ?
  157.         __ifp_subrv     dd      ?
  158.         __ifp_sub       dd      ?
  159.         __ifp_mul       dd      ?
  160.         __ifp_div       dd      ?
  161.         __ifp_add       dd      ?
  162.         __ifp_sqr       dd      ?
  163.         __ifp_rndint    dd      ?
  164.         __ifp_sin       dd      ?
  165.         __ifp_cos       dd      ?
  166.         __ifp_tan       dd      ?
  167.         __ifp_atan      dd      ?
  168.         __ifp_log       dd      ?
  169.         __ifp_log2      dd      ?
  170.         __ifp_log10     dd      ?
  171.         __ifp_exp       dd      ?
  172.         __ifp_exp2      dd      ?
  173.         __ifp_exp10     dd      ?
  174.         __ifp_cmp       dd      ?
  175.         __ifp_tst       dd      ?
  176.         __ifp_push      dd      ?
  177.         __ifp_pop       dd      ?
  178.         __ifp_subds     dd      ?
  179.         __ifp_subes     dd      ?
  180.         __ifp_subss     dd      ?
  181.         __ifp_mulds     dd      ?
  182.         __ifp_mules     dd      ?
  183.         __ifp_mulss     dd      ?
  184.         __ifp_divds     dd      ?
  185.         __ifp_dives     dd      ?
  186.         __ifp_divss     dd      ?
  187.         __ifp_addds     dd      ?
  188.         __ifp_addes     dd      ?
  189.         __ifp_addss     dd      ?
  190.         __ifp_divrvds   dd      ?
  191.         __ifp_divrves   dd      ?
  192.         __ifp_divrvss   dd      ?
  193.         __ifp_subrvds   dd      ?
  194.         __ifp_subrves   dd      ?
  195.         __ifp_subrvss   dd      ?
  196.     IF _TBasic_
  197.         __ifp_ldlng2    dd      ?
  198.         __ifp_ldulng2   dd      ?
  199.         __ifp_lds2      dd      ?
  200.     ENDIF
  201. ENDIF ; _shortcuts88_
  202.  
  203. fpu     ends
  204.  
  205. ; size of emu_temp
  206. size_emu_temp   equ     12
  207.  
  208. ; The minimum size for the emulator stack.
  209. MinFpStack      equ     (17 * size_emu_temp)
  210.