Source code of Windows XP (NT5)
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

82 lines
3.1 KiB

  1. ;
  2. ;
  3. ; Copyright (C) Microsoft Corporation, 1986
  4. ;
  5. ; This Module contains Proprietary Information of Microsoft
  6. ; Corporation and should be treated as Confidential.
  7. ;
  8. subttl emdoc.asm - Documentation
  9. page
  10. ;--------------------------------------------------------------------
  11. ;
  12. ; WARNING - This may not be accurate for the stand-alone emulator.
  13. ;
  14. ; Glossary:
  15. ; TOS - top-of-stack (e.g. simulated 8087 register stack)
  16. ; single - single precision real number in one of two formats:
  17. ; memory (IEEE), internal (on stack, see below)
  18. ; double - double precision real number in one of two formats:
  19. ; memory (IEEE), internal (on stack, see below).
  20. ;
  21. ; This source is organized into the following sections:
  22. ; 1. Introductory documentation of instructions and data structures
  23. ; 2. External routines, data segment, and const segment definitions
  24. ; 3. Startup and terminate, utility truncTOS
  25. ; 4. User memory macros
  26. ; 5. Macros and procedures for stack push and pop, error handling
  27. ; 6. Main entry point and effective address calculation routine
  28. ;
  29. ; Assumptions about segment usage:
  30. ; SS = user's stack
  31. ; DS = user's emulator data segment (not user's DS)
  32. ; ES = effective address segment for memory operands
  33. ; = user's emulator data segment (all other times)
  34. ;
  35. ; BASstk is DS offset of the stack base
  36. ; CURstk is DS offset of the current register (TOS).
  37. ; LIMstk is DS offset of LAST reg in stack
  38. ;
  39. ; CURerr has internal exception flag byte (<>0 iff exception occured).
  40. ; UserControlWord has user set values
  41. ; ControlWord has remapped version of UserControlWord
  42. ; CWcntl (high byte of ControlWord) has Rounding, precision, Inf modes
  43. ;
  44. ; Macros:
  45. ; PUSHST allocates a new 12 byte register, and POPST frees one.
  46. ; Both return an address in SI and save all other 8086 registers.
  47. ;
  48. ; Five macros handle all data movement between user memory and local
  49. ; memory or registers.
  50. ;
  51. ; Note standard forms:
  52. ;
  53. ; Bits are counted from least significant; bit 0 is 1's, bit 7 is 128's.
  54. ;
  55. ; IEEE format is used, naturally, for values in user memory:
  56. ;
  57. ; IEEE single precision:
  58. ; +0: least significant byte of mantissa
  59. ; +1: next sig. byte of mant.
  60. ; +2: bits 6..0: most sig. bits of mant.
  61. ; +2: bit 7: low order bit of exponent
  62. ; +3: bits 6..0: rest of exponent
  63. ; +3: bit 7: sign bit
  64. ; mantissa does not include "hidden bit".
  65. ; with hidden bit, mantissa value is 1.0 to 2.0
  66. ; exponent is in biased form, with bias of 127
  67. ; exponent of all 0's means a value of zero
  68. ; exponent of all 1's means a value of "indefinite"
  69. ;
  70. ; IEEE double precision:
  71. ; +0: least significant byte of mantissa
  72. ; +1..+5 next sig. bytes of mant.
  73. ; +6: bits 3..0 (lo nibble): most sig. bits of mant.
  74. ; +6: bits 7..4 (hi nibble): least sig. bits of exp.
  75. ; +7: bits 6..0: most sig. bits of exponent
  76. ; +7: bit 7: sign bit
  77. ; mantissa does not include "hidden bit".
  78. ; with hidden bit, mantissa value is 1.0 to 2.0
  79. ; exponent is in biased form, with bias of 1023
  80. ; exponent of all 0's means a value of zero or Denormal
  81. ; exponent of all 1's means a value of NAN or Infinity
  82.