<div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">2014-09-25 21:17 GMT+02:00 Samuel Barney <span dir="ltr"><<a href="mailto:samjbarney@gmail.com" target="_blank">samjbarney@gmail.com</a>></span>: <blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><div dir="ltr"><div>3. It shouldn't hang the VM any since, if I understand correctly, the thread can yield after any instruction is called.</div></div></blockquote><div><br></div><div style>no</div><div style><br></div><div style>Try this: file t.S</div><div style><br></div><div style><div><font face="courier new, monospace">{module, t}.  %% version = 0</font></div><div><font face="courier new, monospace"><br></font></div><div><font face="courier new, monospace">{exports, [{go,0},{module_info,0},{module_info,1}]}.</font></div><div><font face="courier new, monospace"><br></font></div><div><font face="courier new, monospace">{attributes, []}.</font></div><div><font face="courier new, monospace"><br></font></div><div><font face="courier new, monospace">{labels, 3}.</font></div><div><br></div><div><font face="courier new, monospace">{function, go, 0, 2}.</font></div><div><font face="courier new, monospace">  {label,1}.</font></div><div><font face="courier new, monospace">    {line,[{location,"t.erl",14}]}.</font></div><div><font face="courier new, monospace">    {func_info,{atom,t},{atom,go},0}.</font></div><div><font face="courier new, monospace">  {label,2}.</font></div><div><font face="courier new, monospace">    {jump,{f,2}}.</font></div><div><br></div></div><div style>Compile with erlc +no_postopt t.S</div><div style><br></div><div style>And spawn some processes in the shell like this:</div><div style>spawn(fun() -> t:go() end).</div><div style><br></div><div style>Let me know how far you get.</div><div><br></div><div style>It's not necessarily a bad idea to target beam-assembler but the assembler is highly tuned for the Erlang language .. or rather the Core language.</div></div></div></div>