From: anton@mips.complang.tuwien.ac.at   
      
   EricP writes:   
   >What architecture cannot do an indirect branch, which I assume   
   >means a branch/jump to a variable location in a register?   
      
   Or, in case of the 6502, in memory.   
      
   I don't know of any architecture (except maybe some one-instruction   
   proof-of-concepts) that does not have indirect branches in one form or   
   another, but I am not that familiar with architectures from the 1950s   
   or some of the extremely deprived embedded-control processors.   
      
   Maybe the thing about self-modifying code was thrown in to taint the   
   assigned goto through guilt-by-association.   
      
   >Even if an ISA did not have a JMP reg instruction one can create it   
   >using CALL to copy the IP to the stack where you modify it and   
   >RET to pop the new IP value.   
      
   In most cases that is possible (even if the return address is stored   
   in a register and not on the stack), but the return addresses might   
   live on a separate stack (IIRC the Intel 8008 or the 8080 has such a   
   stack), and the call might be the only thing that pushes on that   
   stack. But yes, in most cases, it's a good argument that even very   
   deprived processors usually have some form of indirect branching.   
      
   - anton   
   --   
   'Anyone trying for "industrial quality" ISA should avoid undefined behavior.'   
    Mitch Alsup,    
      
   --- SoupGate-Win32 v1.05   
    * Origin: you cannot sedate... all the things you hate (1:229/2)   
|