home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.sys.atari.st
- Path: sparky!uunet!email!nino
- From: nino@vmars.tuwien.ac.at (Marinos Yannikos)
- Subject: Re: Assembler routine that generates random numbers?
- Message-ID: <1993Jan28.131923.16697@email.tuwien.ac.at>
- Sender: news@email.tuwien.ac.at
- Nntp-Posting-Host: gipsy.vmars.tuwien.ac.at
- Organization: TU Wien, Vienna, Austria
- References: <1993Jan28.120214.19307@cs.hw.ac.uk>
- Date: Thu, 28 Jan 1993 13:19:23 GMT
- Lines: 25
-
- sbrown@cee.hw.ac.uk (Stuart Brown) writes:
- : [...]
- : random:
- : move.w seed,d0
- : mulu #109,d0
-
- : add.l #853,d0
- -> add.w #853,d0
-
- : divu #4096,d0
- : swap d0
- Why not remove these two and use
-
- and.w #4095,d0
-
- instead? This will almost halve the time needed to calculate
- the random number...
-
- : move.w d0,seed
- : rts
- : seed
- : dc.w 0
-
- -MY
-
-