> >i fixed that. but ther's only a jump_i, no jump_ic...
> >
> >"jump Ix" now jumps to the absolute address held in a register Ix. 
> >Absolute means
> >start of the bytecode + Ix.
> 
> It can't mean that. This:
> 
>    set I0, 0
>    jump I0
> 
> should coredump.
> 

i think parrot is a virtual cpu so the word absolute should be seen in context 
of the vm, not the real cpu we are running on. 
within the vm address 0 should be address 0 of the bytecode, not the
real cpu. but it would be nice to have a null pointer....so what about the first 
instruction in bytecode is at vm address 1? so a 
  set I0, 1 
  jump I0 
would be a program restart and 0 is the null pointer for which we can check
with a conditional branch...and a jump to address 0 results in a crash
(it does so on my windoze). 

but the best solution in my opinion would be:
first instruction in bytecode is a 'end' (at address 0), then the program itself
starts at address 1. a jump to address 1 is a program restart, we can check
for null pointer with conditional branch and a jump to address 0 would be an 
immediate program end (it doesn't look nice if an interpreter core dumps). or
better than an 'end' is an opcode that throws some error messages, ends the
program but does not core dump.....


-daniel 

> >the following code will result in a simple program restart,
> >no core dump:
> >     set I1, 0
> >     jump I1
> >
> >the fixed jump breaks the tests: basic5, call.pasm, jump.pasm
> >but i wonder why nobody realized that jump's broken, the doc says it jumps 
> >_to_
> >the address, not forward or backward........
> 
> That was brought up a while ago, but I don't think anyone's had time to put 
> a patch in. I'm working on stack and jsr support, so I'll fix it then.
> 
> Dan
> 
> --------------------------------------"it's like this"-------------------
> Dan Sugalski                          even samurai
> [EMAIL PROTECTED]                         have teddy bears and even
>                                       teddy bears get drunk
> 

Reply via email to