[Tex/LaTex] TeX capacity exceeded, sorry [save size=50000]

errorsmemorytex-core

I am on Mac OS X Lion latest, and get the error trying to compile my large multi-page project. This happens after adding one more code listing (shown below). The full error is:

 TeX capacity exceeded, sorry [save size=50000]. ^^Imoreemph={}] (followed by: )    implementation.tex  /report_root    line 1642   Texlipse Build Error

the code listing I am using is the following (nothing fundamentally wrong about it …) just trying to explain how the auto-vectorized code looks like:

    {\assemblycode
\begin{lstlisting}[
    caption={Generated assembly auto-vectorized code},
    label={lst:givens4autovectass},
    moreemph={}]
L..LN52641:
        jbe       L_B221.22     # Prob 10%                      #419.29
L..LN52642:
L_B221.19:                      # Preds L_B221.18
        movl      %r13d, (%rsp)                                 #
        movsd     %xmm4, 696(%rsp)                              #
        movsd     %xmm1, 688(%rsp)                              #
        movsd     %xmm6, 680(%rsp)                              #
        movsd     %xmm7, 672(%rsp)                              #
        movsd     %xmm8, 616(%rsp)                              #
        movq      152(%rsp), %r11                               #
        movq      168(%rsp), %r13                               #
        movq      160(%rsp), %r14                               #
L..LN52643:
                                # LOE rax rdx rcx rbx rsi rdi r8 r9 r10 r11 r12 r13 r14 r15 xmm3 xmm9 xmm10
L_B221.20:                      # Preds L_B221.19 L_B221.20
L..LN52644:
        movsd     (%r8,%r11,8), %xmm7                           #420.11
L..LN52645:
        movaps    %xmm9, %xmm11                                 #427.14
L..LN52646:
        movsd     -32(%r14,%r11,8), %xmm8                       #421.11
L..LN52647:
        movaps    %xmm10, %xmm13                                #427.23
L..LN52648:
        mulsd     %xmm8, %xmm11                                 #427.14
L..LN52649:
        mulsd     %xmm7, %xmm13                                 #427.23
L..LN52650:
        mulsd     %xmm10, %xmm8                                 #426.23
L..LN52651:
        mulsd     %xmm9, %xmm7                                  #426.14
L..LN52652:
        subsd     %xmm13, %xmm11                                #427.23
L..LN52653:
        addsd     %xmm7, %xmm8                                  #426.23
L..LN52654:
        movsd     616(%rsp), %xmm1                              #431.14
L..LN52655:
        movsd     672(%rsp), %xmm4                              #431.23
L..LN52656:
        movaps    %xmm1, %xmm2                                  #431.14
L..LN52657:
        movsd     -64(%rcx,%r11,8), %xmm12                      #422.11
\end{lstlisting}}
\

Here I found the configuration file but what exactly do I have to do to increase such limit?

/$ find . -name "texmf.cnf"
find: ./dev/fd/3: Not a directory
find: ./dev/fd/4: Not a directory
./opt/local/etc/texmf/texmf.cnf
./opt/local/share/texmf/doc/generic/pgf/text-en/texmf.cnf
./opt/local/share/texmf/web2c/texmf.cnf
./usr/local/texlive/2011/texmf/web2c/texmf.cnf
./usr/local/texlive/2011/texmf-dist/doc/generic/pgf/text-en/texmf.cnf
./usr/local/texlive/2011/texmf-dist/doc/latex/pgfplots/texmf.cnf
./usr/local/texlive/2011/texmf.cnf

UPDATE: the assemblycode script:

\lstdefinelanguage{myAssembly}{
keywords={movl,movsd,movsd,movsd,movq,movaps,mulsd,subsd,addsd},
    emph={xmm1,xmm2,xmm3,xmm4,xmm5,xmm6,xmm7,xmm8,xmm9,xmm10,xmm11,xmm12,xmm13,xmm14,xmm15,xmm16},
sensitive=true,
morecomment=[l]{\#},
morecomment=[s]{}{},
morestring=[b]",
}

\newcommand{\assemblyemph}{\lstset{
    language=myAssembly,
    keywordstyle=\color[HTML]{333399}\textbf,
    identifierstyle=,
    stringstyle=\color[HTML]{008888},
    commentstyle=\color[HTML]{880000},
    emphstyle=\color[HTML]{3333FF},
    mathescape=false
}}

  % This is the command to use when including assembly Code 
  \newcommand{\assemblycode}{\bigcodecommon\assemblyemph}

Best Answer

The error is due to morecomment=[s]{}{} because characters are required in the arguments.

I wouldn't use this kind of input style, though. Perhaps something like the following is better.

\documentclass{article}
\usepackage{listings,xcolor}

\lstdefinelanguage{myAssembly}{
keywords={movl,movsd,movsd,movsd,movq,movaps,mulsd,subsd,addsd},
    emph={xmm1,xmm2,xmm3,xmm4,xmm5,xmm6,xmm7,xmm8,xmm9,xmm10,xmm11,xmm12,xmm13,xmm14,xmm15,xmm16},
sensitive=true,
morecomment=[l]{\#},
morestring=[b]",
}

\definecolor{assemblykeyword}{HTML}{333399}
\definecolor{assemblystring}{HTML}{008888}
\definecolor{assemblycomment}{HTML}{880000}
\definecolor{assemblyemph}{HTML}{3333FF}

\lstnewenvironment{assembly}[1][]
  {\lstset{
    language=myAssembly,
    keywordstyle=\color{assemblykeyword}\bfseries,
    identifierstyle=,
    stringstyle=\color{assemblystring},
    commentstyle=\color{assemblycomment},
    emphstyle=\color{assemblyemph},
    mathescape=false,
    #1,
  }}
  {}

\begin{document}
\begin{assembly}[%
  caption={Generated assembly auto-vectorized code},%
  label={lst:givens4autovectass}]
L..LN52641:
        jbe       L_B221.22     # Prob 10%                      #419.29
L..LN52642:
L_B221.19:                      # Preds L_B221.18
        movl      %r13d, (%rsp)                                 #
        movsd     %xmm4, 696(%rsp)                              #
        movsd     %xmm1, 688(%rsp)                              #
        movsd     %xmm6, 680(%rsp)                              #
        movsd     %xmm7, 672(%rsp)                              #
        movsd     %xmm8, 616(%rsp)                              #
        movq      152(%rsp), %r11                               #
        movq      168(%rsp), %r13                               #
        movq      160(%rsp), %r14                               #
L..LN52643:
                                # LOE rax rdx rcx rbx rsi rdi r8 r9 r10 r11 r12 r13 r14 r15 xmm3 xmm9 xmm10
L_B221.20:                      # Preds L_B221.19 L_B221.20
L..LN52644:
        movsd     (%r8,%r11,8), %xmm7                           #420.11
L..LN52645:
        movaps    %xmm9, %xmm11                                 #427.14
L..LN52646:
        movsd     -32(%r14,%r11,8), %xmm8                       #421.11
L..LN52647:
        movaps    %xmm10, %xmm13                                #427.23
L..LN52648:
        mulsd     %xmm8, %xmm11                                 #427.14
L..LN52649:
        mulsd     %xmm7, %xmm13                                 #427.23
L..LN52650:
        mulsd     %xmm10, %xmm8                                 #426.23
L..LN52651:
        mulsd     %xmm9, %xmm7                                  #426.14
L..LN52652:
        subsd     %xmm13, %xmm11                                #427.23
L..LN52653:
        addsd     %xmm7, %xmm8                                  #426.23
L..LN52654:
        movsd     616(%rsp), %xmm1                              #431.14
L..LN52655:
        movsd     672(%rsp), %xmm4                              #431.23
L..LN52656:
        movaps    %xmm1, %xmm2                                  #431.14
L..LN52657:
        movsd     -64(%rcx,%r11,8), %xmm12                      #422.11
\end{assembly}

\end{document}

Note, however, that end of lines must be masked off in the optional argument to assembly.