home *** CD-ROM | disk | FTP | other *** search
/ ProfitPress Mega CDROM2 …eeware (MSDOS)(1992)(Eng) / ProfitPress-MegaCDROM2.B6I / MISC / MATH / ULTRA101.ZIP / ULT32_TP.ASM < prev    next >
Encoding:
Assembly Source File  |  1992-03-26  |  2.6 KB  |  106 lines

  1. ; Program:      ULTRA.ASM (80386 Turbo Pascal version)
  2. ;
  3. ; Description:  The greatest random number generator that ever was
  4. ;               or ever will be.  Way beyond Super-Duper.
  5. ;               (Just kidding, but we think its a good one.)
  6. ; Authors:      Arif Zaman (arif@stat.fsu.edu) and
  7. ;               George Marsaglia (geo@stat.fsu.edu).
  8. ; Date:         26 March 1992
  9. ; Version:      1.01
  10. ; Copyright:    To obtain permission to incorporate this program into
  11. ;               any commercial product, please contact the authors at
  12. ;               the e-mail address given above or at
  13. ;
  14. ;               Department of Statistics and
  15. ;               Supercomputer Computations Research Institute
  16. ;               Florida State University
  17. ;               Tallahassee, FL 32306.
  18. ;
  19. ; See Also:     The file ULTRA.DOC contains detailed comments.
  20. ;
  21.     DOSSEG
  22.    .MODEL TPASCAL
  23.  
  24. ;===== B: GLOBAL FUNCTIONS, SUBROUTINES and VARIABLES =================
  25. ;
  26.     public  i31bit, i15bit, i7bit,  i1bit,  uni,    duni,
  27.     public  i32bit, i16bit, i8bit,  rinit,  vni,    dvni
  28.     public  swbfill
  29.  
  30. ;===== D. MACRO DEFINITIONS ===========================================
  31. ;
  32. ; RinitProcStart should take two 32-bit arguments conx and shrx
  33. ;   and place them in eax and ebx.
  34. ;   es and ds should both point to the data segment.
  35. ;   conx must be odd (so we or with 1 just to make sure).
  36. ; FillProc
  37. ;   DS is already the data segment. ES should also be made the same.
  38.  
  39. EnterProcedure   macro
  40. endm
  41.  
  42. ExitProcedure    macro
  43.     ret
  44. endm
  45.  
  46. RinitProcStart   macro
  47.   rinit   proc conx:dword, shrx:dword
  48.   EnterProcedure
  49.     mov ax,ds
  50.     mov es,ax
  51.     mov eax,conx
  52.     or  al,1
  53.     mov ebx,shrx
  54. endm
  55.  
  56. RinitProcEnd     macro
  57.   ExitProcedure
  58.   rinit endp
  59. endm
  60.  
  61. FillProcStart    macro
  62.   fillswb proc near
  63.     mov ax,ds
  64.     mov es,ax
  65. endm
  66.  
  67. FillProcEnd      macro
  68.     ret
  69.   fillswb endp
  70. endm
  71.  
  72. DwordFn macro
  73. endm
  74.  
  75. WordFn  macro
  76. endm
  77.  
  78. ByteFn  macro
  79. endm
  80.  
  81. RealFn  macro
  82. endm
  83.  
  84. DoubleFn macro
  85. endm
  86.  
  87. N equ 37                ; The number of 32 bit words in the table
  88.  
  89.   extrn swbx : dword    ; In Turbo-Pascal, the DATA segment can't
  90.   extrn x : dword       ; have any initial values, so we put all
  91.   extrn swbn : word     ; the constants in the Turbo-Pascal unit
  92.   extrn bits : byte     ; and only refer to them here.
  93.   extrn nbits : byte
  94.   extrn flags : byte
  95.   extrn congx : dword
  96.   extrn seven  : word
  97.   extrn scale31 : word
  98.   extrn scale63 : word
  99.  
  100.   swbneg equ  word ptr swbx+N*4
  101.   conglo equ  word ptr congx
  102.   conghi equ  word ptr congx+2
  103.  
  104. .CODE
  105.   INCLUDE ULT32COD.INC
  106. END