Leaked source code of windows server 2003
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.

85 lines
2.3 KiB

  1. /*++
  2. Copyright (c) 1995 Microsoft Corporation
  3. Module Name:
  4. wordfns.c
  5. Abstract:
  6. Instuctions which operate on 16-bit WORDS
  7. Author:
  8. 29-Jun-1995 BarryBo
  9. Revision History:
  10. --*/
  11. #include <nt.h>
  12. #include <ntrtl.h>
  13. #include <nturtl.h>
  14. #include <windows.h>
  15. #include <stdio.h>
  16. #include "cpuassrt.h"
  17. #include "threadst.h"
  18. #include "instr.h"
  19. #include "decoderp.h"
  20. #include "wordfns.h"
  21. ASSERTNAME;
  22. // set up to include common functions
  23. #define GET_REG get_reg16
  24. #define MANGLENAME(x) x ## 16
  25. #define MSB 0x8000
  26. #define MOD_RM mod_rm_reg16
  27. #define UTYPE unsigned short
  28. #define STYPE signed short
  29. #define GET_VAL GET_SHORT
  30. #define PUT_VAL PUT_SHORT
  31. #define PUSH_VAL PUSH_SHORT
  32. #define POP_VAL POP_SHORT
  33. #define OPNAME(x) OP_ ## x ## 16
  34. #define LOCKOPNAME(x) OP_SynchLock ## x ## 16
  35. #define DISPATCHCOMMON(fn) DISPATCH(fn ## 16)
  36. #define CALLFRAGCOMMON0(fn) CALLFRAG0( fn ## 16 )
  37. #define CALLFRAGCOMMON1(fn, pop1) CALLFRAG1( fn ## 16 , pop1)
  38. #define CALLFRAGCOMMON2(fn, pop1, op2) CALLFRAG2( fn ## 16 , pop1, op2)
  39. #define AREG GP_AX
  40. #define BREG GP_BX
  41. #define CREG GP_CX
  42. #define DREG GP_DX
  43. #define SPREG GP_SP
  44. #define BPREG GP_BP
  45. #define SIREG GP_SI
  46. #define DIREG GP_DI
  47. #define DEREF(Op) DEREF16(Op)
  48. // include the common functions with 8/16/32 flavors
  49. #include "common.c"
  50. // include the common functions with 16/32 flavors
  51. #include "comm1632.c"
  52. // create the mod_rm_reg16() decoder function
  53. #define MOD11_RM000 GP_AX
  54. #define MOD11_RM001 GP_CX
  55. #define MOD11_RM010 GP_DX
  56. #define MOD11_RM011 GP_BX
  57. #define MOD11_RM100 GP_SP
  58. #define MOD11_RM101 GP_BP
  59. #define MOD11_RM110 GP_SI
  60. #define MOD11_RM111 GP_DI
  61. #define REG000 GP_AX
  62. #define REG001 GP_CX
  63. #define REG010 GP_DX
  64. #define REG011 GP_BX
  65. #define REG100 GP_SP
  66. #define REG101 GP_BP
  67. #define REG110 GP_SI
  68. #define REG111 GP_DI
  69. #define MOD_RM_DECODER mod_rm_reg16
  70. #include "modrm.c"