From: frief Date: Mon, 18 Dec 2006 14:31:22 +0000 (+0000) Subject: * doc/sdccman.lyx: added the long missed iCode table "", added... X-Git-Url: https://git.gag.com/?a=commitdiff_plain;h=3bce6c12ae03e393ba6bdf475faab170a68572f3;p=fw%2Fsdcc * doc/sdccman.lyx: added the long missed iCode table "", added links to wiki git-svn-id: https://sdcc.svn.sourceforge.net/svnroot/sdcc/trunk/sdcc@4517 4a8a32a2-be11-0410-ad9d-d568d2c75423 --- diff --git a/ChangeLog b/ChangeLog index 5030b36b..33d5321e 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2006-12-18 Frieder Ferlemann + + * doc/sdccman.lyx: added the long missed iCode table + "", added links to wiki + 2006-12-17 Borut Razem * doc/sdccman.lyx, src/pic16/main.c, src/pic/main.c, src/port.h, diff --git a/doc/sdccman.lyx b/doc/sdccman.lyx index c4ce3eba..6aa3baa8 100644 --- a/doc/sdccman.lyx +++ b/doc/sdccman.lyx @@ -16068,21 +16068,22 @@ As of SDCC 2.6.2 you no longer need to call an initialization routine before \end_inset space of 1024 bytes is provided for malloc to allocate memory from. - -\family default -If you need a different heap size you need to recompile _heap.c with the - required size defined in HEAP_SIZE. It is recommended to make a copy of this - file into your project directory and compile it there with: + If you need a different heap size you need to recompile _heap.c with the + required size defined in HEAP_SIZE. + It is recommended to make a copy of this file into your project directory + and compile it there with: \layout Verse \family typewriter sdcc -c _heap.c -D HEAD_SIZE=2048 \newline + \family default And then link it with: \layout Verse + \family typewriter sdcc main.rel _heap.rel \newline @@ -25939,6 +25940,22 @@ Historically there often were long delays between official releases and \end_inset . + A release wiki +\begin_inset LatexCommand \index{wiki} + +\end_inset + + +\begin_inset LatexCommand \index{Release wiki} + +\end_inset + + at +\begin_inset LatexCommand \url{http://sdcc.sf.net/release_wiki/} + +\end_inset + + also holds some information about past and future releases. \layout Section Examples @@ -29581,6 +29598,24 @@ The Code generation phase is (unhappily), entirely MCU dependent and very As mentioned in the optimization section the peep-hole optimizer is rule based system, which can reprogrammed for other MCUs. +\layout Standard + +More information is available in a wiki +\begin_inset LatexCommand \index{wiki} + +\end_inset + + (preliminary link +\begin_inset LatexCommand \url{http://sdcc.sourceforge.net/release_wiki/index.php?page=SDCC+internals+and+porting} + +\end_inset + +) and in the thread +\begin_inset LatexCommand \url{http://sf.net/mailarchive/message.php?msg_id=13954144} + +\end_inset + + . \layout Chapter Compiler internals @@ -29734,7 +29769,12 @@ There are other MCU specific considerations in this phase. Code generation \layout Standard -Figure II gives a table of iCode operations supported by the compiler. +Figure II gives a table of iCode +\begin_inset LatexCommand \index{iCode} + +\end_inset + + operations supported by the compiler. The code generation involves translating these operations into corresponding assembly code for the processor. This sounds overly simple but that is the essence of code generation. @@ -29745,10 +29785,1685 @@ Figure II gives a table of iCode operations supported by the compiler. \newline +\layout Standard + + +\size footnotesize +Figure II +\begin_inset Tabular + + + + + + + + +\begin_inset Text + +\layout Standard + + \series bold -\shape italic -\color red - +iCode +\series default + +\begin_inset LatexCommand \index{iCode} + +\end_inset + + +\end_inset + + +\begin_inset Text + +\layout Standard + + +\series bold +Operands +\end_inset + + +\begin_inset Text + +\layout Standard + + +\series bold +Description +\end_inset + + +\begin_inset Text + +\layout Standard + + +\series bold +C Equivalent +\end_inset + + + + +\begin_inset Text + +\layout Standard + + +\size footnotesize +'!' +\end_inset + + +\begin_inset Text + +\layout Standard + + +\size footnotesize +IC_LEFT() IC_RESULT() +\end_inset + + +\begin_inset Text + +\layout Standard + + +\size footnotesize +NOT operation +\end_inset + + +\begin_inset Text + +\layout Standard + + +\size footnotesize +IC_RESULT = ! IC_LEFT; +\end_inset + + + + +\begin_inset Text + +\layout Standard + + +\size footnotesize +'~' +\end_inset + + +\begin_inset Text + +\layout Standard + + +\size footnotesize +IC_LEFT() IC_RESULT() +\end_inset + + +\begin_inset Text + +\layout Standard + + +\size footnotesize +Bitwise complement of +\end_inset + + +\begin_inset Text + +\layout Standard + + +\size footnotesize +IC_RESULT = ~IC_LEFT; +\end_inset + + + + +\begin_inset Text + +\layout Standard + + +\size footnotesize +RRC +\end_inset + + +\begin_inset Text + +\layout Standard + + +\size footnotesize +IC_LEFT() IC_RESULT() +\end_inset + + +\begin_inset Text + +\layout Standard + + +\size footnotesize +Rotate right with carry +\end_inset + + +\begin_inset Text + +\layout Standard + + +\size footnotesize +IC_RESULT = (IC_LEFT << 1) | (IC_LEFT >> (sizeof(IC_LEFT)*8-1)); +\end_inset + + + + +\begin_inset Text + +\layout Standard + + +\size footnotesize +RLC +\end_inset + + +\begin_inset Text + +\layout Standard + + +\size footnotesize +IC_LEFT() IC_RESULT() +\end_inset + + +\begin_inset Text + +\layout Standard + + +\size footnotesize +Rotate left with carry +\end_inset + + +\begin_inset Text + +\layout Standard + + +\size footnotesize +IC_RESULT = (IC_LEFT << (sizeof(LC_LEFT)*8-1) ) | (IC_LEFT >> 1); +\end_inset + + + + +\begin_inset Text + +\layout Standard + + +\size footnotesize +GETHBIT +\end_inset + + +\begin_inset Text + +\layout Standard + + +\size footnotesize +IC_LEFT() IC_RESULT() +\end_inset + + +\begin_inset Text + +\layout Standard + + +\size footnotesize +Get the highest order bit of IC_LEFT +\end_inset + + +\begin_inset Text + +\layout Standard + + +\size footnotesize +IC_RESULT = (IC_LEFT >> (sizeof(IC_LEFT)*8 -1)); +\end_inset + + + + +\begin_inset Text + +\layout Standard + + +\size footnotesize +UNARYMINUS +\end_inset + + +\begin_inset Text + +\layout Standard + + +\size footnotesize +IC_LEFT() IC_RESULT() +\end_inset + + +\begin_inset Text + +\layout Standard + + +\size footnotesize +Unary minus +\end_inset + + +\begin_inset Text + +\layout Standard + + +\size footnotesize +IC_RESULT = - IC_LEFT; +\end_inset + + + + +\begin_inset Text + +\layout Standard + + +\size footnotesize +IPUSH +\end_inset + + +\begin_inset Text + +\layout Standard + + +\size footnotesize +IC_LEFT() +\end_inset + + +\begin_inset Text + +\layout Standard + + +\size footnotesize +Push the operand into stack +\end_inset + + +\begin_inset Text + +\layout Standard + + +\size footnotesize +NONE +\end_inset + + + + +\begin_inset Text + +\layout Standard + + +\size footnotesize +IPOP +\end_inset + + +\begin_inset Text + +\layout Standard + + +\size footnotesize +IC_LEFT() +\end_inset + + +\begin_inset Text + +\layout Standard + + +\size footnotesize +Pop the operand from the stack +\end_inset + + +\begin_inset Text + +\layout Standard + + +\size footnotesize +NONE +\end_inset + + + + +\begin_inset Text + +\layout Standard + + +\size footnotesize +CALL +\end_inset + + +\begin_inset Text + +\layout Standard + + +\size footnotesize +IC_LEFT() IC_RESULT() +\end_inset + + +\begin_inset Text + +\layout Standard + + +\size footnotesize +Call the function represented by IC_LEFT +\end_inset + + +\begin_inset Text + +\layout Standard + + +\size footnotesize +IC_RESULT = IC_LEFT(); +\end_inset + + + + +\begin_inset Text + +\layout Standard + + +\size footnotesize +PCALL +\end_inset + + +\begin_inset Text + +\layout Standard + + +\size footnotesize +IC_LEFT() IC_RESULT() +\end_inset + + +\begin_inset Text + +\layout Standard + + +\size footnotesize +Call via function pointer +\end_inset + + +\begin_inset Text + +\layout Standard + + +\size footnotesize +IC_RESULT = (*IC_LEFT)(); +\end_inset + + + + +\begin_inset Text + +\layout Standard + + +\size footnotesize +RETURN +\end_inset + + +\begin_inset Text + +\layout Standard + + +\size footnotesize +IC_LEFT() +\end_inset + + +\begin_inset Text + +\layout Standard + + +\size footnotesize +Return the value in operand IC_LEFT +\end_inset + + +\begin_inset Text + +\layout Standard + + +\size footnotesize +return IC_LEFT; +\end_inset + + + + +\begin_inset Text + +\layout Standard + + +\size footnotesize +LABEL +\end_inset + + +\begin_inset Text + +\layout Standard + + +\size footnotesize +IC_LABEL() +\end_inset + + +\begin_inset Text + +\layout Standard + + +\size footnotesize +Label +\end_inset + + +\begin_inset Text + +\layout Standard + + +\size footnotesize +IC_LABEL: +\end_inset + + + + +\begin_inset Text + +\layout Standard + + +\size footnotesize +GOTO +\end_inset + + +\begin_inset Text + +\layout Standard + + +\size footnotesize +IC_LABEL() +\end_inset + + +\begin_inset Text + +\layout Standard + + +\size footnotesize +Goto label +\end_inset + + +\begin_inset Text + +\layout Standard + + +\size footnotesize +goto IC_LABEL(); +\end_inset + + + + +\begin_inset Text + +\layout Standard + + +\size footnotesize +'+' +\end_inset + + +\begin_inset Text + +\layout Standard + + +\size footnotesize +IC_LEFT() IC_RIGHT() IC_RESULT() +\end_inset + + +\begin_inset Text + +\layout Standard + + +\size footnotesize +Addition +\end_inset + + +\begin_inset Text + +\layout Standard + + +\size footnotesize +IC_RESULT = IC_LEFT + IC_RIGHT +\end_inset + + + + +\begin_inset Text + +\layout Standard + + +\size footnotesize +'-' +\end_inset + + +\begin_inset Text + +\layout Standard + + +\size footnotesize +IC_LEFT() IC_RIGHT() IC_RESULT() +\end_inset + + +\begin_inset Text + +\layout Standard + + +\size footnotesize +Subtraction +\end_inset + + +\begin_inset Text + +\layout Standard + + +\size footnotesize +IC_RESULT = IC_LEFT - IC_RIGHT +\end_inset + + + + +\begin_inset Text + +\layout Standard + + +\size footnotesize +'*' +\end_inset + + +\begin_inset Text + +\layout Standard + + +\size footnotesize +IC_LEFT() IC_RIGHT() IC_RESULT() +\end_inset + + +\begin_inset Text + +\layout Standard + + +\size footnotesize +Multiplication +\end_inset + + +\begin_inset Text + +\layout Standard + + +\size footnotesize +IC_RESULT = IC_LEFT * IC_RIGHT; +\end_inset + + + + +\begin_inset Text + +\layout Standard + + +\size footnotesize +'/' +\end_inset + + +\begin_inset Text + +\layout Standard + + +\size footnotesize +IC_LEFT() IC_RIGHT() IC_RESULT() +\end_inset + + +\begin_inset Text + +\layout Standard + + +\size footnotesize +Division +\end_inset + + +\begin_inset Text + +\layout Standard + + +\size footnotesize +IC_RESULT = IC_LEFT / IC_RIGHT; +\end_inset + + + + +\begin_inset Text + +\layout Standard + + +\size footnotesize +'%' +\end_inset + + +\begin_inset Text + +\layout Standard + + +\size footnotesize +IC_LEFT() IC_RIGHT() IC_RESULT() +\end_inset + + +\begin_inset Text + +\layout Standard + + +\size footnotesize +Modulus +\end_inset + + +\begin_inset Text + +\layout Standard + + +\size footnotesize +IC_RESULT = IC_LEFT % IC_RIGHT; +\end_inset + + + + +\begin_inset Text + +\layout Standard + + +\size footnotesize +'<' +\end_inset + + +\begin_inset Text + +\layout Standard + + +\size footnotesize +IC_LEFT() IC_RIGHT() IC_RESULT() +\end_inset + + +\begin_inset Text + +\layout Standard + + +\size footnotesize +Less than +\end_inset + + +\begin_inset Text + +\layout Standard + + +\size footnotesize +IC_RESULT = IC_LEFT < IC_RIGHT; +\end_inset + + + + +\begin_inset Text + +\layout Standard + + +\size footnotesize +'>' +\end_inset + + +\begin_inset Text + +\layout Standard + + +\size footnotesize +IC_LEFT() IC_RIGHT() IC_RESULT() +\end_inset + + +\begin_inset Text + +\layout Standard + + +\size footnotesize +Greater than +\end_inset + + +\begin_inset Text + +\layout Standard + + +\size footnotesize +IC_RESULT = IC_LEFT > IC_RIGHT; +\end_inset + + + + +\begin_inset Text + +\layout Standard + + +\size footnotesize +EQ_OP +\end_inset + + +\begin_inset Text + +\layout Standard + + +\size footnotesize +IC_LEFT() IC_RIGHT() IC_RESULT() +\end_inset + + +\begin_inset Text + +\layout Standard + + +\size footnotesize +Equal to +\end_inset + + +\begin_inset Text + +\layout Standard + + +\size footnotesize +IC_RESULT = IC_LEFT == IC_RIGHT; +\end_inset + + + + +\begin_inset Text + +\layout Standard + + +\size footnotesize +AND_OP +\end_inset + + +\begin_inset Text + +\layout Standard + + +\size footnotesize +IC_LEFT() IC_RIGHT() IC_RESULT() +\end_inset + + +\begin_inset Text + +\layout Standard + + +\size footnotesize +Logical and operation +\end_inset + + +\begin_inset Text + +\layout Standard + + +\size footnotesize +IC_RESULT = IC_LEFT && IC_RIGHT; +\end_inset + + + + +\begin_inset Text + +\layout Standard + + +\size footnotesize +OR_OP +\end_inset + + +\begin_inset Text + +\layout Standard + + +\size footnotesize +IC_LEFT() IC_RIGHT() IC_RESULT() +\end_inset + + +\begin_inset Text + +\layout Standard + + +\size footnotesize +Logical or operation +\end_inset + + +\begin_inset Text + +\layout Standard + + +\size footnotesize +IC_RESULT = IC_LEFT || IC_RIGHT; +\end_inset + + + + +\begin_inset Text + +\layout Standard + + +\size footnotesize +'^' +\end_inset + + +\begin_inset Text + +\layout Standard + + +\size footnotesize +IC_LEFT() IC_RIGHT() IC_RESULT() +\end_inset + + +\begin_inset Text + +\layout Standard + + +\size footnotesize +Exclusive OR +\end_inset + + +\begin_inset Text + +\layout Standard + + +\size footnotesize +IC_RESULT = IC_LEFT ^ IC_RIGHT; +\end_inset + + + + +\begin_inset Text + +\layout Standard + + +\size footnotesize +'|' +\end_inset + + +\begin_inset Text + +\layout Standard + + +\size footnotesize +IC_LEFT() IC_RIGHT() IC_RESULT() +\end_inset + + +\begin_inset Text + +\layout Standard + + +\size footnotesize +Bitwise OR +\end_inset + + +\begin_inset Text + +\layout Standard + + +\size footnotesize +IC_RESULT = IC_LEFT | IC_RIGHT; +\end_inset + + + + +\begin_inset Text + +\layout Standard + + +\size footnotesize +BITWISEAND +\end_inset + + +\begin_inset Text + +\layout Standard + + +\size footnotesize +IC_LEFT() IC_RIGHT() IC_RESULT() +\end_inset + + +\begin_inset Text + +\layout Standard + + +\size footnotesize +Bitwise AND +\end_inset + + +\begin_inset Text + +\layout Standard + + +\size footnotesize +IC_RESULT = IC_LEFT & IC_RIGHT; +\end_inset + + + + +\begin_inset Text + +\layout Standard + + +\size footnotesize +LEFT_OP +\end_inset + + +\begin_inset Text + +\layout Standard + + +\size footnotesize +IC_LEFT() IC_RIGHT() IC_RESULT() +\end_inset + + +\begin_inset Text + +\layout Standard + + +\size footnotesize +Left shift +\end_inset + + +\begin_inset Text + +\layout Standard + + +\size footnotesize +IC_RESULT = IC_LEFT << IC_RIGHT +\end_inset + + + + +\begin_inset Text + +\layout Standard + + +\size footnotesize +RIGHT_OP +\end_inset + + +\begin_inset Text + +\layout Standard + + +\size footnotesize +IC_LEFT() IC_RIGHT() IC_RESULT() +\end_inset + + +\begin_inset Text + +\layout Standard + + +\size footnotesize +Right shift +\end_inset + + +\begin_inset Text + +\layout Standard + + +\size footnotesize +IC_RESULT = IC_LEFT >> IC_RIGHT +\end_inset + + + + +\begin_inset Text + +\layout Standard + + +\size footnotesize +GET_VALUE_ +\newline +AT_ ADDRESS +\end_inset + + +\begin_inset Text + +\layout Standard + + +\size footnotesize +IC_LEFT() IC_RESULT() +\end_inset + + +\begin_inset Text + +\layout Standard + + +\size footnotesize +Indirect fetch +\end_inset + + +\begin_inset Text + +\layout Standard + + +\size footnotesize +IC_RESULT = (*IC_LEFT); +\end_inset + + + + +\begin_inset Text + +\layout Standard + + +\size footnotesize +POINTER_SET +\end_inset + + +\begin_inset Text + +\layout Standard + + +\size footnotesize +IC_RIGHT() IC_RESULT() +\end_inset + + +\begin_inset Text + +\layout Standard + + +\size footnotesize +Indirect set +\end_inset + + +\begin_inset Text + +\layout Standard + + +\size footnotesize +(*IC_RESULT) = IC_RIGHT; +\end_inset + + + + +\begin_inset Text + +\layout Standard + + +\size footnotesize +'=' +\end_inset + + +\begin_inset Text + +\layout Standard + + +\size footnotesize +IC_RIGHT() IC_RESULT() +\end_inset + + +\begin_inset Text + +\layout Standard + + +\size footnotesize +Assignment +\end_inset + + +\begin_inset Text + +\layout Standard + + +\size footnotesize +IC_RESULT = IC_RIGHT; +\end_inset + + + + +\begin_inset Text + +\layout Standard + + +\size footnotesize +IFX +\end_inset + + +\begin_inset Text + +\layout Standard + + +\size footnotesize +IC_COND IC_TRUE IC_LABEL +\end_inset + + +\begin_inset Text + +\layout Standard + + +\size footnotesize +Conditional jump. + If true label is present then jump to true label if condition is true else + jump to false label if condition is false +\end_inset + + +\begin_inset Text + +\layout Standard + + +\size footnotesize +if (IC_COND) goto IC_TRUE; +\newline +\SpecialChar ~ +\SpecialChar ~ +Or +\newline +If (!IC_COND) goto IC_FALSE; +\end_inset + + + + +\begin_inset Text + +\layout Standard + + +\size footnotesize +ADDRESS_OF +\end_inset + + +\begin_inset Text + +\layout Standard + + +\size footnotesize +IC_LEFT() IC_RESULT() +\end_inset + + +\begin_inset Text + +\layout Standard + + +\size footnotesize +Address of +\end_inset + + +\begin_inset Text + +\layout Standard + + +\size footnotesize +IC_RESULT = &IC_LEFT(); +\end_inset + + + + +\begin_inset Text + +\layout Standard + + +\size footnotesize +JUMPTABLE +\end_inset + + +\begin_inset Text + +\layout Standard + + +\size footnotesize +IC_JTCOND IC_JTLABELS +\end_inset + + +\begin_inset Text + +\layout Standard + + +\size footnotesize +Jump to list of labels depending on the value of JTCOND +\end_inset + + +\begin_inset Text + +\layout Standard + + +\size footnotesize +Switch statement +\end_inset + + + + +\begin_inset Text + +\layout Standard + + +\size footnotesize +CAST +\end_inset + + +\begin_inset Text + +\layout Standard + + +\size footnotesize +IC_RIGHT() IC_LEFT() IC_RESULT() +\end_inset + + +\begin_inset Text + +\layout Standard + + +\size footnotesize +Cast types +\end_inset + + +\begin_inset Text + +\layout Standard + + +\size footnotesize +IC_RESULT = (typeof IC_LEFT) IC_RIGHT; +\end_inset + + + + +\begin_inset Text + +\layout Standard + + +\size footnotesize +SEND +\end_inset + + +\begin_inset Text + +\layout Standard + + +\size footnotesize +IC_LEFT() +\end_inset + + +\begin_inset Text + +\layout Standard + + +\size footnotesize +This is used for passing parameters in registers; +\newline +move IC_LEFT to the next available parameter register. +\end_inset + + +\begin_inset Text + +\layout Standard + + +\size footnotesize +None +\end_inset + + + + +\begin_inset Text + +\layout Standard + + +\size footnotesize +RECV +\end_inset + + +\begin_inset Text + +\layout Standard + + +\size footnotesize +IC_RESULT() +\end_inset + + +\begin_inset Text + +\layout Standard + + +\size footnotesize +This is used for receiving parameters passed in registers; +\newline +Move the values in the next parameter register to IC_RESULT +\end_inset + + +\begin_inset Text + +\layout Standard + + +\size footnotesize +None +\end_inset + + + + +\begin_inset Text + +\layout Standard + + +\shape slanted +\size footnotesize +(some more have been added) +\end_inset + + +\begin_inset Text + +\layout Standard + +\end_inset + + +\begin_inset Text + +\layout Standard + +\end_inset + + +\begin_inset Text + +\layout Standard + + +\shape slanted +\size footnotesize +see f.e. + +\family typewriter +gen51Code() +\family default + in +\family typewriter +src/mcs51/gen.c +\end_inset + + + + +\end_inset + + \layout Comment In the original article Figure II was announced to be downloadable on @@ -29756,8 +31471,7 @@ In the original article Figure II was announced to be downloadable on Circuit Cellar \shape default 's web site. - Unfortunately it never seemed to have shown up there, so: where is Figure - II? + ftp://ftp.circuitcellar.com/pub/Circuit_Cellar/2000/121/dutta.ZIP \layout Paragraph* ICode Example