home bbs files messages ]

Forums before death by AOL, social media and spammers... "We can't have nice things"

   comp.lang.pascal.borland      Borland Pascal was actually pretty neat      2,978 messages   

[   << oldest   |   < older   |   list   |   newer >   |   newest >>   ]

   Message 1,830 of 2,978   
   N. Foldager to All   
   Re: For-to variable goes backwards   
   13 Jul 05 10:09:31   
   
   From: nfoldager-takethisaway@yahoo.com   
      
    Marco van de Voort:   
      
      
   > Actually I'd expect it to count from 9 to 0.   
      
   I think you are right. In the example that I give, Sum starts at 11.   
      
      
   > > But why is this more optimal in the generated code?   
      
   > Assembler gotcha's.   
      
   Hm.  Someone told me, that it's because its faster to test whether the   
   counter has  reached zero.   
      
   I think that it may be more complicated to keep track of what it   
   really is (from the programmers point of view) at a certain loop.  I   
   mean, when it goes into formulas in the code, the system needs to know   
   what the counter should be at that loop. The counter may be used   
   underway in formulas, for comparisons, or maybe a Break.   
      
   > > Is there a way to switch this optimization off as long as I am   
   > > debugging my program?   
      
   > No. Only all optimization.   
      
   It would be OK to disable all optimization during development and   
   debugging.  However, even I  switch off optimization in   
   Project > Options > Compiler, the counter still goes the wrong way.   
      
   Best regards,   
      
   Niels Foldager   
      
   --- SoupGate-Win32 v1.05   
    * Origin: you cannot sedate... all the things you hate (1:229/2)   

[   << oldest   |   < older   |   list   |   newer >   |   newest >>   ]


(c) 1994,  bbs@darkrealms.ca