1
0
mirror of https://github.com/cc65/cc65.git synced 2024-11-19 06:31:31 +00:00

Document computed gotos

This commit is contained in:
Lauri Kasanen 2019-04-15 19:27:23 +03:00 committed by greg-king5
parent f328481a48
commit 55ce618bf2

View File

@ -776,6 +776,25 @@ This cc65 version has some extensions to the ISO C standard.
size zero, even if it is initialized.
<p>
<item> Computed gotos, a GCC extension, has limited support. With it you can
use fast jump tables from C. You can take the address of a label with
a double ampersand, putting them in a static const array of type void *.
Then you can jump to one of these labels as follows:
<tscreen><verb>
static const void * const jumptable[] = {
&amp;&amp;add,
&amp;&amp;sub
};
goto *jumptable[somevar];
add:
...code...
</verb></tscreen>
In the jump table, no expressions are supported. The array index
used in the goto must be a simple variable or a constant.
</itemize>
<p>