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

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