From: niklas.holsti@tidorum.invalid   
      
   On 2025-11-08 23:08, John Levine wrote:   
   > According to Michael S :   
   >> I would imagine that in old times return iinstruction was less common   
   >> than indirect addressing itself.   
   >   
   > On several of the machines I used a subroutine call stored the return   
   > address in the first word of the routine and branched to that address+1.   
   > The return was just an indirect jump.   
      
   One such machine was the HP 2100; I used some of those.   
      
   > Stacks? What's a stack? We barely had registers.   
   And indeed the Algol 60 compiler for the HP 2100 did not support   
   recursion. My programs did real-time control, so I wrote a small   
   non-preemptive but priority-driven multi-threading kernel. Thread switch   
   was easy as there were very few registers and no stack. But you had to   
   be careful because no subroutines were re-entrant.   
      
   Speaking of indirect addressing, the HP 2100 had a special feature: it   
   had a 64 KB address space, but with word addressing of 16-bit words, so   
   addresses were only 15 bits, leaving the MSbit in each word free.   
      
   When using indirect addressing there was an "indirect" bit in the   
   instruction which, in the usual way, made the machine use the 16-bit   
   content of the (directly) addressed word as the actual target address,   
   but only if the MSbit of that content was zero. If the MSbit was one, it   
   caused a further level of indirection, using the 15 other bits as the   
   address of another word that again would contain the actual target   
   address, if the MSbit of /that/ content was zero, and so on.   
      
   So an indirect instruction could cause a chain of indirections which   
   ended when an address-word had a zero in its MSbit. And the machine   
   could get stuck in an eternal indirection loop, which IIRC happened to   
   me once :-)   
      
   --   
   Niklas Holsti   
      
   niklas holsti tidorum fi   
    . @ .   
      
   --- SoupGate-Win32 v1.05   
    * Origin: you cannot sedate... all the things you hate (1:229/2)   
|