View Single Post
Old 07-24-2009, 07:58 PM   #13
cocomonk22
Rookie
 
Join Date: Sep 2005
Posts: 72
Those bad jumps occur because jumps are based on hex addresses. When you split the lines to multiple prints and waits, this corrupts some of the jumps.

Here's an example:
1. jump to this plus 1 (line 2)
2. jump to this plus 2 (line 4)
3. print
4. local[0]+=1
5. jump to this plus 2 (line 7)
6. jump to this minus 5 (line 1)
6. end

After line split (O is correct, X is incorrect):
1. jump to this plus 1 (line 2) O
2. jump to this plus 2 (line 4) X
3. print
4. wait
5. print
6. wait
7. local[0]+=1
8. jump to this plus 2(line 10) O
9. jump to this minus 5 (line 4) X
10. end

That's just a simple example. The actual change is even more since a jump might go to the wrong hex value than the start of an opcode. So to fix this you need to change all jump values based on the additional bytes added between the jumps.

Last edited by cocomonk22; 04-04-2010 at 12:10 AM.
cocomonk22 is offline   you may: quote & reply,