| ??? 11/13/02 14:03 Read: times |
#32392 - RE: generating random words 8051 |
When the game is initialised i want the 8051 to be able to genarate a word at random
Dead easy, require the user to press a key to indicate "start of game". While waiting for that key to be pressed run a loop such as WaitForStart: inc dptr jb KeyPressed,EndOfWait sjmp WaitForStart EndOfWait: mov dph,HighRandomNumber mov dpl,LowRandomNumberThis will even give you a truly random number since the loop will rin in abt 200ms and the keypress wait will be more than that. Erik |
| Topic | Author | Date |
| generating random words 8051 | 01/01/70 00:00 | |
| RE: generating random words 8051 | 01/01/70 00:00 | |
| mahmood | 01/01/70 00:00 | |
| RE: generating random words 8051 | 01/01/70 00:00 | |
| RE: generating random words 8051 | 01/01/70 00:00 | |
| RE: generating random words 8051 | 01/01/70 00:00 | |
| RE: generating random words 8051 | 01/01/70 00:00 | |
| RE: generating random words 8051, Kunal | 01/01/70 00:00 | |
| Deja vu | 01/01/70 00:00 | |
RE: Deja vu | 01/01/70 00:00 |



