home *** CD-ROM | disk | FTP | other *** search
/ PC Online 1998 February / PCO_0298.ISO / filesbbs / os2 / pgp263.arj / PGP263I.SRC / PGP263II.ZIP / src / mpw32asm.c < prev    next >
Encoding:
C/C++ Source or Header  |  1995-08-05  |  1.9 KB  |  112 lines

  1.  
  2.  
  3. #if defined(USE_WIN32_ASSEMBLER)
  4.  
  5.  
  6.  
  7. #include "mpilib.h"
  8.  
  9.  
  10.  
  11. #if defined(SMITH)
  12.  
  13.  
  14.  
  15. extern unit reciph,recipl;
  16.  
  17. extern int  mshift;
  18.  
  19.  
  20.  
  21. #if !defined(_MSC_VER)
  22.  
  23. #error "This code needs a Microsoft compiler"
  24.  
  25. #endif
  26.  
  27.  
  28.  
  29. #if defined(_M_IX86)
  30.  
  31.  
  32.  
  33. #pragma warning(disable:4035)
  34.  
  35.  
  36.  
  37.  
  38.  
  39. unit P_QUO_DIGIT (unitptr dividend)
  40.  
  41. {
  42.  
  43.     __asm{
  44.  
  45.         mov    esi,DWORD PTR [dividend]
  46.  
  47.         push    ebp
  48.  
  49.         mov    eax, DWORD PTR [esi-8]
  50.  
  51.         not    eax
  52.  
  53.         mul    DWORD PTR [reciph]
  54.  
  55.         add    eax,DWORD PTR [reciph]
  56.  
  57.         adc    edx,0
  58.  
  59.         mov    ebx,eax
  60.  
  61.         mov    edi,edx
  62.  
  63.         mov    eax,DWORD PTR [esi-4]
  64.  
  65.         not    eax
  66.  
  67.         mul    DWORD PTR [recipl]
  68.  
  69.         inc    edx
  70.  
  71.         mov    ebp,edx
  72.  
  73.         and    ebp,edi
  74.  
  75.         and    ebp,1
  76.  
  77.  
  78.  
  79.         add    eax,ebx
  80.  
  81.         adc    edi,edx
  82.  
  83.         rcr    edi,1
  84.  
  85.         mov    eax,DWORD PTR [esi-4]
  86.  
  87.         not    eax
  88.  
  89.         mul    DWORD PTR [reciph]
  90.  
  91.         mov    ebx,eax
  92.  
  93.         mov    ecx,edx
  94.  
  95.         mov    eax, DWORD PTR [esi]
  96.  
  97.         not eax
  98.  
  99.         mul    DWORD PTR [recipl]
  100.  
  101.         xor    eax,ebx
  102.  
  103.         and    ebp,eax
  104.  
  105.         xor    eax,ebx
  106.  
  107.         add    eax,ebx
  108.  
  109.         adc    edx,ecx
  110.  
  111.         rcr    edx,1
  112.  
  113.         rcr    eax,1
  114.  
  115.         add    eax,edi
  116.  
  117.         adc    edx,0
  118.  
  119.         add    eax,ebp
  120.  
  121.         adc    edx,0
  122.  
  123.         shl    eax,1
  124.  
  125.         rcl    edx,1
  126.  
  127.         rcl eax,1
  128.  
  129.         rcl    edx,1
  130.  
  131.         rcl    eax,1
  132.  
  133.         and    eax,3
  134.  
  135.         mov    ecx,eax
  136.  
  137.         mov    ebx,edx
  138.  
  139.         mov    eax,DWORD PTR [esi]
  140.  
  141.         not eax
  142.  
  143.         mul    DWORD PTR [reciph]
  144.  
  145.         shl    eax,1
  146.  
  147.         rcl    edx,1
  148.  
  149.         add    eax,ebx
  150.  
  151.         adc    edx,ecx
  152.  
  153.         mov    ecx, DWORD PTR [mshift]
  154.  
  155.         cmp    DWORD PTR [mshift],32
  156.  
  157.         je    L2
  158.  
  159.         shrd    eax,edx,cl
  160.  
  161.         shr        edx,cl
  162.  
  163.         or    edx,edx
  164.  
  165.         je    L1
  166.  
  167.         mov    eax,-1
  168.  
  169.         jmp    L1
  170.  
  171.     L2:
  172.  
  173.         xchg    eax,edx
  174.  
  175.     L1:
  176.  
  177.         pop    ebp
  178.  
  179.     }
  180.  
  181. }
  182.  
  183.  
  184.  
  185. #pragma warning(default:4035)
  186.  
  187.  
  188.  
  189. #endif /* X86 */
  190.  
  191.  
  192.  
  193. #if defined(_M_PPC)
  194.  
  195. #error "We've not written the PowerPC Code Yet!"
  196.  
  197. #endif /* _M_PPC */
  198.  
  199.  
  200.  
  201. #if defined(_M_ALPHA)
  202.  
  203. #error "We've not written the Alpha Code Yet!"
  204.  
  205. #endif /* _M_ALPHA */
  206.  
  207.  
  208.  
  209. #if defined(_M_MRX000)
  210.  
  211. #error "We've not written the MIPS Code Yet!"
  212.  
  213. #endif /* _M_MRX000 */
  214.  
  215.  
  216.  
  217. #endif /*#defined(SMITH) */
  218.  
  219.  
  220.  
  221. #endif /* USE_WIN32_ASSEMBLER */
  222.  
  223.