home *** CD-ROM | disk | FTP | other *** search
/ Black Art of 3D Game Programming / Black_Art_of_3D_Game_Programming.iso / source / borland / chap_17 / fpmul.lst < prev    next >
Encoding:
File List  |  1995-05-25  |  2.0 KB  |  70 lines

  1. Turbo Assembler     Version 4.0        05/26/95 02:24:01        Page 1
  2. fpmul.asm
  3.  
  4.  
  5.  
  6.       1
  7.       2                     ; this    function uses 64 bit math to multiply two 32 bit fixed point numbers
  8.       3                     ; in 16:16 format
  9.       4
  10.       5        0000             .MODEL    MEDIUM            ; use medium memory    model C    function names
  11.       6
  12.       7                     .386
  13.       8
  14.       9        0000             .CODE                  ;    begin the code segment
  15.      10
  16.      11                     PUBLIC    _FP_Mul              ;    export function    name to    linker
  17.      12
  18.      13
  19.      14        0000             _FP_Mul PROC
  20.      15
  21.      16                     ARG multiplier:DWORD, multiplicand:DWORD
  22.      17
  23.      18        0000  55                 push bp          ;    create stack frame
  24.      19        0001  8B EC                 mov bp,sp
  25.      20
  26.      21        0003  66| 8B 46 0A             mov eax,multiplicand    ; move into eax multiplicand
  27.      22        0007  66| F7 6E 06             imul multiplier         ; multiply    by multiplier, result edx:eax
  28.      23        000B  66| C1 E8 10             shr eax,16             ; need to shift upper 16 bits of eax to right
  29.      24                                     ; so that result is in dx:ax instead of edx:eax
  30.      25
  31.      26        000F  5D                 pop bp             ; fixup stack
  32.      27        0010  CB                 ret             ; return to caller
  33.      28
  34.      29        0011             _FP_Mul ENDP
  35.      30
  36.      31                     END
  37. Turbo Assembler     Version 4.0        05/26/95 02:24:01        Page 2
  38. Symbol Table
  39.  
  40.  
  41.  
  42.  
  43. Symbol Name              Type     Value
  44.  
  45. ??date                  Text     "05/26/95"
  46. ??filename              Text     "fpmul      "
  47. ??time                  Text     "02:24:01"
  48. ??version              Number 0400
  49. @32Bit                  Text     0
  50. @CodeSize              Text     1
  51. @Cpu                  Text     0F0FH
  52. @DataSize              Text     0
  53. @FileName              Text     fpmul
  54. @Interface              Text     00h
  55. @Model                  Text     4
  56. @WordSize              Text     2
  57. @code                  Text     fpmul_TEXT
  58. @curseg                  Text     fpmul_TEXT
  59. @data                  Text     DGROUP
  60. @stack                  Text     DGROUP
  61. _FP_Mul                  Far     fpmul_TEXT:0000
  62. multiplicand              Number [DGROUP:BP+000A]
  63. multiplier              Number [DGROUP:BP+0006]
  64.  
  65. Groups & Segments          Bit Size Align  Combine Class
  66.  
  67. DGROUP                  Group
  68.   _DATA                  16  0000 Word      Public  DATA
  69. fpmul_TEXT              16  0011 Word      Public  CODE
  70.