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

  1. ; Program:      ULTRA.ASM (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 the data segment in congx and shrgx.
  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 ax,word ptr conx
  52.     or  al,1
  53.     mov conglo,ax
  54.     mov ax,word ptr conx+2
  55.     mov conghi,ax
  56.     mov ax,word ptr shrx
  57.     mov shrglo,ax
  58.     mov ax,word ptr shrx+2
  59.     mov shrghi,ax
  60. endm
  61.  
  62. RinitProcEnd     macro
  63.   ExitProcedure
  64.   rinit endp
  65. endm
  66.  
  67. FillProcStart    macro
  68.   fillswb proc near
  69.     mov ax,ds
  70.     mov es,ax
  71. endm
  72.  
  73. FillProcEnd      macro
  74.     ret
  75.   fillswb endp
  76. endm
  77.  
  78. DwordFn macro
  79. endm
  80.  
  81. WordFn  macro
  82. endm
  83.  
  84. ByteFn  macro
  85. endm
  86.  
  87. RealFn  macro
  88. endm
  89.  
  90. DoubleFn macro
  91. endm
  92.  
  93. ;===== DATA ========================================================
  94.  
  95.   N equ 37              ; The number of 32 bit words in the table.
  96.  
  97.   extrn swbx : dword    ; In Turbo-Pascal, the DATA segment can't
  98.   extrn x : dword       ; have any initial values, so we put all
  99.   extrn swbn : word     ; the constants in the Turbo-Pascal unit
  100.   extrn bits : byte     ; and only refer to them here.
  101.   extrn nbits : byte
  102.   extrn flags : byte
  103.   extrn congx : dword
  104.   extrn shrgx : dword
  105.   extrn seven  : word
  106.   extrn scale31 : word
  107.   extrn scale63 : word
  108.  
  109.   swbneg equ  word ptr swbx+N*4
  110.   conglo equ  word ptr congx
  111.   conghi equ  word ptr congx+2
  112.   shrglo equ  word ptr shrgx
  113.   shrghi equ  word ptr shrgx+2
  114.  
  115. .CODE
  116.   INCLUDE ULTRACOD.INC
  117. END