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

  1. ; Program:      ULTRA.ASM (IBM Fortran/2 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,FORTRAN
  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.     mov  dx,seg x
  41.     push ds
  42.     mov  ds,dx
  43. endm
  44.  
  45. ExitProcedure    macro
  46.     pop ds
  47.     ret
  48. endm
  49.  
  50. RinitProcStart   macro          ; fortran has call by reference.
  51.   rinit   proc conx:dword, shrx:dword
  52.     EnterProcedure
  53.     mov  dx,ds
  54.     mov  es,dx
  55.     mov  di,offset conglo
  56.     lds  si,ConX            ; Store the parameters in
  57.     lodsw                   ; the data segment in
  58.     or   al,1               ;  ( congx must be odd )
  59.     stosw                   ; conglo:conghi and
  60.     lodsw                   ; shrglo:shrghi.
  61.     stosw
  62.     lds  si,ShrX
  63.     lodsw
  64.     stosw
  65.     lodsw
  66.     stosw
  67.     mov  ds,dx              ; setup the segment regs.
  68. endm
  69.  
  70. RinitProcEnd     macro
  71.   ExitProcedure
  72.   rinit endp
  73. endm
  74.  
  75. FillProcStart    macro
  76.   fillswb proc near
  77.     mov ax,ds
  78.     mov es,ax
  79. endm
  80.  
  81. FillProcEnd      macro
  82.     ret
  83.   fillswb endp
  84. endm
  85.  
  86. DwordFn macro
  87. endm
  88.  
  89. WordFn  macro
  90. endm
  91.  
  92. ByteFn  macro
  93.     cbw                 ; fortran doesn't have bytes so return integer*2
  94. endm
  95.  
  96. RealFn  macro
  97. endm
  98.  
  99. DoubleFn macro
  100. endm
  101.  
  102. DATA SEGMENT WORD PUBLIC 'F@DATA'
  103.   INCLUDE ULTRADAT.INC
  104. DATA ENDS
  105.  
  106. F@ICODE SEGMENT WORD PUBLIC 'CODE'
  107. ASSUME CS:F@ICODE, DS:DATA
  108.   INCLUDE ULTRACOD.INC
  109. F@ICODE ENDS
  110. END