Email: Password: Remember Me | Create Account (Free)

Back to Subject List

Old thread has been locked -- no new posts accepted in this thread
???
08/24/08 17:31
Read: times


 
#157706 - HLL was just for example - easy to read
Responding to: ???'s previous message
I presented it in a high-level language just to make the concept with computed assignments clear. Please, no fight about C being high- or low-level now :)

But of course the concept works in assembler too. Too long since I last worked with C51 assembler so I better stay away from presenting a full implementation since I haven't a C51 emulator available right now to verify before I post.

Define 6 bytes with the values 1,2,3,4,5,0 in the code.

You may let DPTR point to the start of this table, and let A be any value in [0..5]. Then do MOVC A,@A + DPTR to get the next value into A. Repeat this instruction until time to end the loop.

After you break out of the loop, use the value in A to perform 0 to 5 left-shifts of the value 1. Or use a second 6-element loop table to convert from the continuous sequence to your shifted single-bit values.

List of 28 messages in thread
TopicAuthorDate
8051 random numbers revisted - tested            01/01/70 00:00      
   Just Out Of Curiosity            01/01/70 00:00      
      yes casino            01/01/70 00:00      
   No fancy simulator required            01/01/70 00:00      
      Russ, great info here is MY code            01/01/70 00:00      
         Language-independent method            01/01/70 00:00      
            Oops            01/01/70 00:00      
               Head under arm            01/01/70 00:00      
                  HLL not an option            01/01/70 00:00      
                     HLL was just for example - easy to read            01/01/70 00:00      
         As always: The generation of random numbers ...            01/01/70 00:00      
          what is the need to CLR C            01/01/70 00:00      
            no need            01/01/70 00:00      
      does this solution make sense            01/01/70 00:00      
         Per's idea makes more sense            01/01/70 00:00      
         Don\'t use conditional jumps            01/01/70 00:00      
            Clever!            01/01/70 00:00      
      Converting Assembly to C            01/01/70 00:00      
   what about using the timer?            01/01/70 00:00      
      256 / 6 is a failure            01/01/70 00:00      
   One Suggestion for generating 1 to 6            01/01/70 00:00      
   try to use timer            01/01/70 00:00      
      yes a nice solution            01/01/70 00:00      
         How secure does this have to be ?            01/01/70 00:00      
            not much            01/01/70 00:00      
               Not "how safe?", but "how secure?".            01/01/70 00:00      
                  it passed!            01/01/70 00:00      
                     ALL THE BEST!!!            01/01/70 00:00      

Back to Subject List