View Single Post
Old 15th April 2009, 19:45   #32  |  Link
david42
Former Technical Janitor
 
Join Date: Jan 2008
Posts: 48
Quote:
Originally Posted by blutach View Post
First search for RND in your DVD. 99.9% of DVDs don't have them.

If you find one that does, then a single trace can only emulate one of the possible outcomes of a RND. e.g. the following statement has 2 possible outcomes (1 and 2).

These will usually be tested in the next statement or somewhere not too far down the line. You obviously can't eliminate entirely any PGCs referred to by a test of a gprm after a RND. You can only eliminate out-of-range values.

So, if you see this in the next 2 statements, then each of PGCs 1 and 2 are visited (you can do a number of traces until all the values of the RND are used, if you like):


But the next 3 statements will always be false and therefore unless PGCs 3-5 are called by other PGCs, they can be eliminated (easiest to just delete statements 4-6 and then do Delete Uncalled PGCs)

I hope you understand this now.

Regards
I found this in an unofficial DVD Spec on the web concerning how RND works. Is this description wrong OR if the seed in your example is 2 how would one know what range the GPRM would end up containing?

Compute a new random value using the contents of a GPRM or a constant value (immediate 16-bit number) as the seed value. The seed value cannot be 0.
SPRM is not allowed as operands in this command.

Example:
1) Rnd GPRM0,GPRM1
(Store a new random value in GPRM0 using the contents of GPRM1 as the seed value. The previous value of GPRM0 is lost after the command executes.)

2) Rnd GPRM0,2
(Store a new random value in GPRM0 using 2 as the seed value)
david42 is offline   Reply With Quote