??? 09/10/07 11:11 Read: times |
#144281 - how much code/data/idata/xdata space can you... Responding to: ???'s previous message |
... afford, plus how fast has it to be?
AFAIK there is no good pRNG for SDCC yet, but you might use a block cipher in CBC-like mode to generate pseudorandom code; it shall result naturally in uniform . If you look into the code library on the left you will find TEA/XTEA and SKIPJACK implementations, as well as arcfour("RC4") (which is a stream cipher but that's maybe even more suitable for the task), and DES. I have rewritten XTEA into SDCC-like function (basically I did nothing except headers stuff), if you want I can try to post it in the evening. Later I can try to stitch up something more "standard" based on LCRNG or a LFSR, but I am afraid it won't be today. JW PS. Whoops, now I see what you are pointing to is arcfour based, too - but I doubt you can use this for SDCC - no double in SDCC... |