% Remember to use the lgrind style

\File{bubble.s},{19:24},{Sep 23 1993}
\L{\LB{\Proc{bubble}\K{program}_\V{bubble}_\K{is}}}
\L{\LB{___\K{const}}}
\L{\LB{______\V{maxSize}_:_\V{int}_=_1000;}}
\L{\LB{___\K{varray}}}
\L{\LB{______\V{num}_:_\K{array}_[20]_\K{of}_\V{int}_:=_[32,65,53,7,3,0,87,76,4,8,3,8,3,0,0,234,87,1,3,6];}}
\L{\LB{___\K{var}}}
\L{\LB{______\V{numElements}_:_\V{int}_:=_20;}}
\L{\LB{___\K{var}}}
\L{\LB{______\V{i}_:_\V{int}_:=_0;}}
\L{\LB{___\K{proc}}}
\L{\LB{______\V{sortNumsInArray}_(\V{numElts}_:_\V{int})_=}}
\L{\LB{_________\K{local}}}
\L{\LB{____________\K{var}}}
\L{\LB{_______________\V{current}_:_\V{int}_:=_0;_}}
\L{\LB{____________\K{var}}}
\L{\LB{_______________\V{last}_:_\V{int}_:=_\V{numElts};_}}
\L{\LB{____________\K{var}}}
\L{\LB{_______________\V{temp}_:_\V{int}_:=_0}}
\L{\LB{_________\K{in}}}
\L{\LB{____________\K{while}_(0_\<_\V{last})}}
\L{\LB{_______________\K{do}}}
\L{\LB{__________________\V{current}_:=_1;}}
\L{\LB{__________________\K{while}_(\V{current}_\<_\V{last})}}
\L{\LB{_____________________\K{do}}}
\L{\LB{________________________\K{if}_(\V{num}_[\V{current}]_\>_\V{num}_[\V{current}_+_1])}}
\L{\LB{___________________________\K{then}}}
\L{\LB{______________________________\V{temp}_:=_\V{num}[\V{current}];}}
\L{\LB{______________________________\V{num}[\V{current}]_:=_\V{num}[\V{current}_+_1];}}
\L{\LB{______________________________\V{num}[\V{current}_+_1]_:=_\V{temp}}}
\L{\LB{________________________\K{end};}}
\L{\LB{________________________\V{current}_:=_\V{current}_+_1}}
\L{\LB{_____________________\K{end};}}
\L{\LB{__________________\V{last}_:=_\V{last}_\-_1}}
\L{\LB{_______________\K{end}}}
\L{\LB{_________\K{end}}}
\L{\LB{\K{in}}}
\L{\LB{___\K{call}_\V{sortNumsInArray}_(\V{numElements})}}
\L{\LB{\K{end}}}
