From: stephen@vfxforth.com   
      
   On 6 Mar 2024 at 00:42:41 CET, "dxf" wrote:   
      
   > On 5/03/2024 10:18 pm, Stephen Pelc wrote:   
   >> On 4 Mar 2024 at 18:24:09 CET, "Anton Ertl" wrote:   
   >>>   
   >>> My question is: Which Forth systems have a DO/?DO that pushes the   
   >>> address that LOOP/+LOOP then jumps to?   
   >>>   
   >>> - anton   
   >>   
   >> VFX since the beginning.   
   >   
   > AFAICS the loop jump addr is hard-coded (JNO) as that was generally   
   > seen as most efficient:   
   >   
   > : test 10 0 do loop ; ok   
   > see test   
   > TEST   
   > ( 005945D0 488D6DF0 ) LEA RBP, [RBP+-10]   
   > ( 005945D4 48C745000A000000 ) MOV QWord [RBP], # 0000000A   
   > ( 005945DC 48895D08 ) MOV [RBP+08], RBX   
   > ( 005945E0 BB00000000 ) MOV EBX, # 00000000   
   > ( 005945E5 E86615E9FFFF45590000000 CALL 00425B50 (DO) 00000000005945FF   
   > ( 005945F2 49FFC6 ) INC R14   
   > ( 005945F5 49FFC7 ) INC R15   
   > ( 005945F8 71F8 ) JNO 005945F2   
   > ( 005945FA 415E ) POP R14   
   > ( 005945FC 415F ) POP R15   
   > ( 005945FE 58 ) POP RAX   
   > ( 005945FF C3 ) RET/NEXT   
   > ( 48 bytes, 12 instructions )   
      
   The three items pushed are   
    loop exit address   
    limit data of previous loop   
    index data of previous loop   
      
   The slightly odd list of items allows us to keep the index/limit data in   
   registers.   
      
   Stephen   
   --   
   Stephen Pelc, stephen@vfxforth.com   
   MicroProcessor Engineering, Ltd. - More Real, Less Time   
   133 Hill Lane, Southampton SO15 5AF, England   
   tel: +44 (0)78 0390 3612, +34 649 662 974   
   http://www.mpeforth.com - free VFX Forth downloads   
      
   --- SoupGate-Win32 v1.05   
    * Origin: you cannot sedate... all the things you hate (1:229/2)   
|