[fpc-pascal] CASE

Eduardo nec556 at retena.com
Tue Nov 8 18:00:15 CET 2005

>>>May be having case statement problem.
>>>App has case statement with 146 sequential labels.
>>>They are in order, from a defined type.
>>>The assembler output is scanning each label, where it seems a jump 
>>>would be more efficient.
>This :)
>>case L3o3.FormType of
>>1 : begin <somecode1>
>>      end
>>2 : begin <somecode2>
>>      end
>>and so on.....
>>For the second case the assemmbler code seems ok to me, also L1051 
>>L1052 L1053 looks like are different destinations. For the first, 
>>well, it can be optimized "a bit" by hand, but note that it's 
>>difficult to do in "automatic mode" by a compiler.
>Was under the impression that doing a jump, offset by label number, 
>would be faster.  Specially for such long case statements.

Jump by offset label number? I don't understand it. 

More information about the fpc-pascal mailing list