Random-number generation
Posted: Mon Feb 07, 2005 8:44 am
Since Bruce's article on random-number generation just got posted, I thought I should point out that if you are able to use a free-running T1 timer in a 6522 (or similar), the fact that you normally have no idea what its value will be when it gets read means that it can be used for a truly random factor in coming up with the seed. If you're using it for generating timed interrupts too though, you need to remember that the interrupt gets cleared when you read the VIA's T1CL; so if a roll-over sets the interrupt at the beginning of an instruction to read T1CL, IRQ\ could be pulled down, but the interrupt condition will disappear before your ISR can identify the cause and do what it's supposed to do.
I should have put this in my "Tip of the Day" column four years ago in what now is the Delphi forum archives at http://www.6502.org/forum/viewtopic.php?t=342
I should have put this in my "Tip of the Day" column four years ago in what now is the Delphi forum archives at http://www.6502.org/forum/viewtopic.php?t=342