home *** CD-ROM | disk | FTP | other *** search
/ Power-Programmierung / CD1.mdf / pascal / library / dos / math / ultra101 / ult32_c.asm < prev    next >
Encoding:
Assembly Source File  |  1992-03-26  |  2.5 KB  |  114 lines

  1. ; Program:      ULTRA.ASM (80386 Turbo C version)
  2. ; Description:  The greatest random number generator that ever was
  3. ;               or ever will be.  Way beyond Super-Duper.
  4. ;               (Just kidding, but we think its a good one.)
  5. ; Authors:      Arif Zaman (arif@stat.fsu.edu) and
  6. ;               George Marsaglia (geo@stat.fsu.edu).
  7. ; Date:         18 March 1992
  8. ; Version:      1.01
  9. ; Copyright:    To obtain permission to incorporate this program into
  10. ;               any commercial product, please contact the authors at
  11. ;               the e-mail address given above or at
  12. ;
  13. ;               Department of Statistics and
  14. ;               Supercomputer Computations Research Institute
  15. ;               Florida State University
  16. ;               Tallahassee, FL 32306.
  17. ;
  18. ; See Also:    The file ULTRA.DOC contains detailed comments
  19. ;
  20. ; Compilation:  The variable mem must be set to the memory model to compile:
  21. ;        Eg:    TASM /dm=medium ult32_c.asm
  22. ;        will compile this program using the medium memory model.
  23. ;
  24. DOSSEG
  25. .MODEL m,c
  26.  
  27. ;===== B: GLOBAL FUNCTIONS, SUBROUTINES and VARIABLES =================
  28. ;
  29.     public  i31bit, i15bit, i7bit,  i1bit,  uni,    duni,
  30.     public  i32bit, i16bit, i8bit,  rinit,  vni,    dvni
  31.     public  swbfill,swbx,   swbn
  32.  
  33. ;===== D. MACRO DEFINITIONS ===========================================
  34. ;
  35. ; RinitProcStart should take two 32-bit arguments conx and shrx
  36. ;   and place them in eax and ebx.
  37. ;   es and ds should both point to the data segment.
  38. ;   conx must be odd (so we or with 1 just to make sure).
  39. ; FillProc
  40. ;   DS is already the data segment. ES should also be made the same.
  41.  
  42. EnterProcedure   macro
  43.     if @DataSize eq 2
  44.       mov  dx,seg x
  45.       push ds
  46.       mov  ds,dx
  47.     endif
  48. endm
  49.  
  50. ExitProcedure    macro
  51.     if @DataSize eq 2
  52.       pop ds
  53.     endif
  54.     ret
  55. endm
  56.  
  57. RinitProcStart   macro
  58.   rinit   proc conx:dword, shrx:dword
  59.   EnterProcedure
  60.     push si
  61.     push di
  62.     mov ax,ds
  63.     mov es,ax
  64.     mov eax,conx
  65.     or  al,1
  66.     mov ebx,shrx
  67. endm
  68.  
  69. RinitProcEnd     macro
  70.     pop di
  71.     pop si
  72.     ExitProcedure
  73.   rinit endp
  74. endm
  75.  
  76. FillProcStart    macro
  77.   fillswb proc near
  78.     mov ax,ds
  79.     mov es,ax
  80.     push si
  81.     push di
  82. endm
  83.  
  84. FillProcEnd      macro
  85.     pop di
  86.     pop si
  87.     ret
  88.   fillswb endp
  89. endm
  90.  
  91. DwordFn macro
  92. endm
  93.  
  94. WordFn  macro
  95. endm
  96.  
  97. ByteFn  macro
  98. endm
  99.  
  100. RealFn  macro
  101. endm
  102.  
  103. DoubleFn macro
  104. endm
  105.  
  106. .DATA
  107.   INCLUDE ULT32DAT.INC
  108.  
  109. .STACK 10h
  110.  
  111. .CODE
  112.   INCLUDE ULT32COD.INC
  113. END