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

  1. ; Program:      ULTRA.ASM (80386 Lahey F77L 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 HUGE
  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,swbx,   swbn
  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.   arg  arg1:dword
  41.     push bp
  42.     mov  bp,sp
  43.     mov  dx,seg x
  44.     mov  ds,dx
  45. endm
  46.  
  47. ExitProcedure    macro
  48.     pop  bp
  49.     ret
  50. endm
  51.  
  52. RinitProcStart   macro
  53.   rinit   proc conx:dword, shrx:dword
  54.     EnterProcedure
  55.     mov  dx,ds
  56.     lds  si,ConX            ; load conx in eax
  57.     mov  eax,[si]
  58.     or   al,1               ;   (congx must be odd)
  59.     lds  si,ShrX            ; and shrx in ebx
  60.     mov  ebx,[si]
  61.     mov  ds,dx
  62.     mov  es,dx
  63. endm
  64.  
  65. RinitProcEnd     macro
  66.     ExitProcedure
  67.   rinit endp
  68. endm
  69.  
  70. FillProcStart    macro
  71.   fillswb proc near
  72.     mov ax,ds
  73.     mov es,ax
  74. endm
  75.  
  76. FillProcEnd      macro
  77.     ret
  78.   fillswb endp
  79. endm
  80.  
  81. DwordFn macro
  82.     les di,arg1
  83.     stosw
  84.     mov ax,dx
  85.     stosw
  86. endm
  87.  
  88. WordFn  macro
  89.     les di,arg1
  90.     stosw
  91. endm
  92.  
  93. ByteFn  macro
  94.     les di,arg1
  95.     cbw            ; convert bytes to integer*2
  96.     stosw
  97. endm
  98.  
  99. RealFn  macro
  100.     lds  bx,arg1
  101.     fstp dword ptr [bx]
  102. endm
  103.  
  104. DoubleFn macro
  105.     lds  bx,arg1
  106.     fstp qword ptr [bx]
  107. endm
  108.  
  109. DGROUP GROUP DATA
  110. DATA SEGMENT WORD PUBLIC 'DATA'
  111. ASSUME DS:DGROUP
  112.   INCLUDE ULT32DAT.INC
  113. DATA ENDS
  114.  
  115. .STACK 10h
  116.  
  117. .CODE
  118.   INCLUDE ULT32COD.INC
  119. END
  120.