20 December 2004, 20:34 | #1 |
Moderator
Join Date: Nov 2004
Location: Eksjö / Sweden
Posts: 5,652
|
A nice quick small random numbers routine?
Hi!
Wrote a routine to generate random numbers (0-65535). I start with a weird number for seed, I eor that with another weird number that changes for each time. Then I save the new seed, take it, divide by a weird number and take the modulo. I thought that would confuse it enough to make nice random numbers, but when I plot them a pattern shows up (the same number comes up several times in the number table). Anybody have a nice little Really Random Number Generator (in 68000 Assembler of course)? In that case, please share thy knowledge! |
20 December 2004, 21:07 | #2 |
2 contact me: email only!
Join Date: May 2001
Location: Auckland / New Zealand
Posts: 3,187
|
Worth a try
Dunno how random this code is but I've seen it (or variants of it) in quite a few Amiga programs. Give it a try anyway:
Code:
_RandomWord bsr _RandomByte rol.w #8,d0 _RandomByte move.b $dff007,d0 move.b $bfd800,d1 eor.b d1,d0 rts Last edited by Codetapper; 20 December 2004 at 21:14. |
20 December 2004, 21:56 | #3 |
Mehh :D
Join Date: Nov 2004
Location: Bristol, SW UK
Age: 61
Posts: 242
|
May be able to supply something in Z80.... Is it easy to convert Z80 assembler to 68K? Never tried 68K so wouldn't know.
|
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
Thread Tools | |
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Help needed!!Random octal numbers generator(asm) | sheryn88 | Coders. General | 6 | 01 August 2010 07:19 |
Need help coding small routine | kipper2k | Coders. General | 5 | 19 May 2009 16:02 |
small but nice platform games | s2325 | Retrogaming General Discussion | 6 | 30 August 2007 07:04 |
Keyboard routine | BippyM | Coders. General | 2 | 15 July 2007 12:15 |
Looking for some routine code | Amiga1992 | Coders. General | 4 | 17 December 2003 23:51 |
|
|