Mail Archives: djgpp/1997/04/02/17:58:20
Jeff Standish wrote:
> I'm assuming that most intelligent compilers would try to use an jump
> table, but I don't know for certain, and I'm not in the mood to compile,
> disassemble, and try to read the machine code. Besides, just because
> this might happen for a trivial test program doesn't mean it will also
> work for 40+ cases spread out over several hundred lines of code (which
> is the minimum of what I expect to write).
in the case of djgpp, you can specify a command line option that will
give you the assembly source files ( i think it was -S but i am at
school and cannot check now) however, just go to the info docs and look
at the section on invoking gcc.
>
> And I'm asking this in a more general sense, since in addition to DJGPP > I also use Visual C++
> Does anyone know enough about the internals of compilers these days to
> answer this one?
in the case of djgpp, you can compile your actual code and take a look
at the assembly source rather than pure hex. i really do not know much
about the internals of the compilers but i saw it mentioned somewhere
that larger switch statements are more likely to be implemented using
jump tables.
-- sinan
- Raw text -