\documentclass{minimal}
\pagestyle{empty}

\usepackage{pstricks}
\usepackage{pst-node}

\begin{document}

\begin{psmatrix}[mnode=oval, colsep=1.91cm, rowsep=1cm]
[mnode=R,name=vars]{\shortstack[l]{bool s=F,first=T;\\int z:=0, c,\\\, strich:=0, punkt:=1;\\opcode
op,opn;}} &
[name=calc]{\shortstack{\textbf{calc}\\z:=z*10\\+(c-'0');}} &
[name=null]{\shortstack{\textbf{null}\\op:=DONE;}} \\
%%
[mnode=R,name=res]{sys\_res} &
[name=sign]{\shortstack{\textbf{sign}\\s:=true;}} &
[name=alu1]{
	\shortstack{
		\textbf{ALU1}\\
		\shortstack[l]{
			if(first)\{\\
				\, alu(ADD,z*s,strich);\\
				\, first:=false;\\
			\} else\{\\
				\, alu(opd,z*s,strich);\\
			\}\\
			do\_calc=1;\\
			opn=op;
		}
	}
} \\
%%
[name=idle]{\shortstack{\textbf{idle}}} &
[name=read]{\shortstack{\textbf{read char}\\z:=0;\\s:=false;}} &
[name=alu2]{
	\shortstack{
		\textbf{ALU2}\\
		\shortstack[l]{
			if(first)\{\\
				\, alu(MUL,z*s,punkt);\\
				\, first:=false;\\
			\} else\{\\
				\, alu(opd,z*s,punkt);\\
			\}\\
			do\_calc=1;\\
			opn=op;
		}
	}
} \\
%%
[mnode=R,name=void]{} &
[name=err]{\shortstack{\textbf{error}}} &
[name=done]{\shortstack{\textbf{done}}} \\
\end{psmatrix}

\psset{arrows=->, shortput=nab}

\ncline[linestyle=dotted]{res}{idle}
\ncline[linestyle=dotted]{void}{err}
\ncarc[arcangle=10]{done}{idle}
\ncarc[arcangle=0]{err}{idle}

\ncarc[arcangle=0]{idle}{read}\ncput*[npos=.50]{do\_it$\uparrow$}

\ncarc[arcangle=0]{read}{sign}\ncput*[npos=.50]{'-'}
\ncarc[arcangle=0]{sign}{calc}
\ncarc[arcangle=35]{read}{calc}\ncput*[npos=.35]{c = '0'\dots{}'9'}
\nccircle[angle=0]{calc}{.8cm}\ncput*{c = '0'\dots{}'9'}

\ncarc[arcangle=15]{calc}{alu1}\ncput*[npos=.50]{op = '+','-'}
\ncarc[arcangle=-5]{calc}{alu2}\ncput*[npos=.30]{op = '*','/'}

\ncarc[arcangle=0]{calc}{null}\ncput*[npos=.50]{'\textbackslash 0'}

\ncarc[arcangle=0]{null}{alu1}\ncput*[npos=.50]{opd in ['+','-']}
\ncarc[arcangle=48]{null}{alu2}\ncput*[npos=.80]{opd in ['*','/']}

\ncarc[arcangle=0]{alu1}{read}\ncput*[npos=.50]{calc\_done$\uparrow$}
\ncarc[arcangle=20]{alu2}{read}\ncput*[npos=.50]{calc\_done$\uparrow$}

\ncarc[arcangle=80]{alu1}{done}\ncput*[npos=.50]{op == DONE}
\ncarc[arcangle=-60]{alu2}{done}\ncput*[npos=.66]{op == DONE}
\end{document}
