<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN"> <html> <head> <title>.:: The Converted Virtual Machine Instruction Set ::.</title> </head> <body BGCOLOR="#DbDbDb" text="#000000" LINK="#0C0C0C" VLINK="#070707" ALINK="#007007"> <h1 align="center"> Exception handling instructions </h1><br><hr><p> <table border="0" align="center" width="80%"> <tr><td> <!--LEFT BLOCK--> <table border="0" bordercolor="#CDCDCD" align="left" cellspacing="3" cellpadding="5" cols="4"> <tr> <td> <a href="#enter_try"><b>enter_try</b></a></td><td> <a href="#jsr"><b>jsr</b></a></td><td> <a href="#ret_jsr"><b>ret_jsr</b></a></td><td> <a href="#throw"><b>throw</b></a></td></tr><tr><td> <a href="#throw_caller"><b>throw_caller</b></a></td><td> </td><td> </td><td> </td></tr></table></td></tr></table><p><hr><p><table cellpadding="5" cellspacing="0" bordercolor="#000000" border=" 1" align="center" width="80%"> <tr bgcolor="#7F7F7F" border="2"><td border="0" width="30%"> <a name="enter_try"> <font color="#FFFFFF" size="+5"> enter_try</font></a></td><td align="right" border="0"> </td></tr><tr border="1"><td border="0"> · <b>Operation</b></td><td border="0">Enter <code>try</code> context for the current method</td></tr><tr border="0"><td border="0"> · <b>Format </b></td><td border="0"><table border="0" bordercolor="#AAAAAA" cellpadding="6" cellspacing="0"><tr><td><table border="1" cellpadding="6" cellspacing="0"><tr><td align="center" width="100"><i>prefix</i></td></tr><tr><td align="center" width="100"><i>enter_try</i></td></tr></table></td></tr></table></td></tr><tr border="0"><td border="0"> · <b>Direct Format </b></td><td border="0"><table border="0" bordercolor="#AAAAAA" cellpadding="6" cellspacing="0"><tr><td><table border="1" cellpadding="6" cellspacing="0"><tr><td align="center" width="100"><i>{enter_try}</i></td></tr></table></td></tr></table></td></tr><tr border="0"><td border="0"> · <b>Forms </b></td><td border="0"><i>enter_try</i> = 255, 27 (0xFF, 0x1B)<br></td></tr><tr border="0"><td border="0" valign="top"> · <b>Description </b></td><td border="0">The exception frame height for the current method is set to the current height of the stack.</td></tr><tr border="0"><td border="0" valign="top"> · <b>Notes </b></td><td border="0">This must be in the prolog of any method that includes <code>try</code> blocks. It sets the "base height" of the stack so that <i>throw</i> instructions know where to unwind the stack to when an exception is thrown.</td></tr></table><br><br><table cellpadding="5" cellspacing="0" bordercolor="#000000" border=" 1" align="center" width="80%"> <tr bgcolor="#7F7F7F" border="2"><td border="0" width="30%"> <a name="jsr"> <font color="#FFFFFF" size="+5"> jsr</font></a></td><td align="right" border="0"> </td></tr><tr border="1"><td border="0"> · <b>Operation</b></td><td border="0">Jump to local subroutine</td></tr><tr border="0"><td border="0"> · <b>Format </b></td><td border="0"><table border="0" bordercolor="#AAAAAA" cellpadding="6" cellspacing="0"><tr><td><table border="1" cellpadding="6" cellspacing="0"><tr><td align="center" width="100"><i>jsr</i></td></tr><tr><td align="center" width="100"><i>offset</i></td></tr><tr><td align="center" width="100"><i>0</i></td></tr><tr><td align="center" width="100"><i>0</i></td></tr><tr><td align="center" width="100"><i>0</i></td></tr><tr><td align="center" width="100"><i>0</i></td></tr></table></td><td><table border="1" cellpadding="6" cellspacing="0"><tr><td align="center" width="100"><i>br_long</i></td></tr><tr><td align="center" width="100"><i>jsr </i></td></tr><tr><td align="center" width="100"><i>offset1</i></td></tr><tr><td align="center" width="100"><i>offset2</i></td></tr><tr><td align="center" width="100"><i>offset3</i></td></tr><tr><td align="center" width="100"><i>offset4</i></td></tr></table></td></tr></table></td></tr><tr border="0"><td border="0"> · <b>Direct Format </b></td><td border="0"><table border="0" bordercolor="#AAAAAA" cellpadding="6" cellspacing="0"><tr><td><table border="1" cellpadding="6" cellspacing="0"><tr><td align="center" width="100"><i>{jsr}</i></td></tr><tr><td align="center" width="100"><i>dest</i></td></tr></table></td></tr></table></td></tr><tr border="0"><td border="0"> · <b>Forms </b></td><td border="0"><i>jsr</i> = 218 (0xDA)<br></td></tr><tr border="0"><td border="0"> · <b>Stack</b></td><td border="0"><i>...</i> => <i>..., address</i></td></tr><tr border="0"><td border="0" valign="top"> · <b>Description </b></td><td border="0">The program counter for the next instruction (<i>pc + 6</i>) is pushed on the stack as type <code>ptr</code>. Then the program branches to <i>pc + offset</i>.</td></tr><tr border="0"><td border="0" valign="top"> · <b>Notes </b></td><td border="0">This instruction is used to implement <code>finally</code> blocks.</td></tr></table><br><br><table cellpadding="5" cellspacing="0" bordercolor="#000000" border=" 1" align="center" width="80%"> <tr bgcolor="#7F7F7F" border="2"><td border="0" width="30%"> <a name="ret_jsr"> <font color="#FFFFFF" size="+5"> ret_jsr</font></a></td><td align="right" border="0"> </td></tr><tr border="1"><td border="0"> · <b>Operation</b></td><td border="0">Return from local subroutine</td></tr><tr border="0"><td border="0"> · <b>Format </b></td><td border="0"><table border="0" bordercolor="#AAAAAA" cellpadding="6" cellspacing="0"><tr><td><table border="1" cellpadding="6" cellspacing="0"><tr><td align="center" width="100"><i>ret_jsr</i></td></tr></table></td></tr></table></td></tr><tr border="0"><td border="0"> · <b>Direct Format </b></td><td border="0"><table border="0" bordercolor="#AAAAAA" cellpadding="6" cellspacing="0"><tr><td><table border="1" cellpadding="6" cellspacing="0"><tr><td align="center" width="100"><i>{ret_jsr}</i></td></tr></table></td></tr></table></td></tr><tr border="0"><td border="0"> · <b>Forms </b></td><td border="0"><i>ret_jsr</i> = 219 (0xDB)<br></td></tr><tr border="0"><td border="0"> · <b>Stack</b></td><td border="0"><i>..., address</i> => <i>...</i></td></tr><tr border="0"><td border="0" valign="top"> · <b>Description </b></td><td border="0">The <i>address</i> is popped from the stack as the type <code>ptr</code> and transferred into <i>pc</i>.</td></tr><tr border="0"><td border="0" valign="top"> · <b>Notes </b></td><td border="0">This instruction is used to implement <code>finally</code> blocks.</td></tr></table><br><br><table cellpadding="5" cellspacing="0" bordercolor="#000000" border=" 1" align="center" width="80%"> <tr bgcolor="#7F7F7F" border="2"><td border="0" width="30%"> <a name="throw"> <font color="#FFFFFF" size="+5"> throw</font></a></td><td align="right" border="0"> </td></tr><tr border="1"><td border="0"> · <b>Operation</b></td><td border="0">Throw an exception</td></tr><tr border="0"><td border="0"> · <b>Format </b></td><td border="0"><table border="0" bordercolor="#AAAAAA" cellpadding="6" cellspacing="0"><tr><td><table border="1" cellpadding="6" cellspacing="0"><tr><td align="center" width="100"><i>prefix</i></td></tr><tr><td align="center" width="100"><i>throw</i></td></tr></table></td></tr></table></td></tr><tr border="0"><td border="0"> · <b>Direct Format </b></td><td border="0"><table border="0" bordercolor="#AAAAAA" cellpadding="6" cellspacing="0"><tr><td><table border="1" cellpadding="6" cellspacing="0"><tr><td align="center" width="100"><i>{throw}</i></td></tr></table></td></tr></table></td></tr><tr border="0"><td border="0"> · <b>Forms </b></td><td border="0"><i>throw</i> = 255, 28 (0xFF, 0x1C)<br></td></tr><tr border="0"><td border="0"> · <b>Stack</b></td><td border="0"><i>..., working1, ..., workingN, object</i> => <i>..., object</i></td></tr><tr border="0"><td border="0" valign="top"> · <b>Description </b></td><td border="0">The <i>object</i> is popped from the stack as type <code>ptr</code>. The stack is then reset to the same as the current method's exception frame height. Then, <i>object</i> is re-pushed onto the stack and control is passed to the current method's exception matching code.</td></tr><tr border="0"><td border="0" valign="top"> · <b>Notes </b></td><td border="0">This is used to throw exceptions within methods that have an <i>enter_try</i> instruction. Use <i>throw_caller</i> if the method does not include <code>try</code> blocks.<p> Setting the stack height to the exception frame height ensures that all working values are removed from the stack prior to entering the exception matching code.</td></tr></table><br><br><table cellpadding="5" cellspacing="0" bordercolor="#000000" border=" 1" align="center" width="80%"> <tr bgcolor="#7F7F7F" border="2"><td border="0" width="30%"> <a name="throw_caller"> <font color="#FFFFFF" size="+5"> throw_caller</font></a></td><td align="right" border="0"> </td></tr><tr border="1"><td border="0"> · <b>Operation</b></td><td border="0">Throw an exception to the caller of this method</td></tr><tr border="0"><td border="0"> · <b>Format </b></td><td border="0"><table border="0" bordercolor="#AAAAAA" cellpadding="6" cellspacing="0"><tr><td><table border="1" cellpadding="6" cellspacing="0"><tr><td align="center" width="100"><i>prefix</i></td></tr><tr><td align="center" width="100"><i>throw_caller</i></td></tr></table></td></tr></table></td></tr><tr border="0"><td border="0"> · <b>Direct Format </b></td><td border="0"><table border="0" bordercolor="#AAAAAA" cellpadding="6" cellspacing="0"><tr><td><table border="1" cellpadding="6" cellspacing="0"><tr><td align="center" width="100"><i>{throw_caller}</i></td></tr></table></td></tr></table></td></tr><tr border="0"><td border="0"> · <b>Forms </b></td><td border="0"><i>throw_caller</i> = 255, 29 (0xFF, 0x1D)<br></td></tr><tr border="0"><td border="0"> · <b>Stack</b></td><td border="0"><i>..., working1, ..., workingN, object</i> => <i>..., object</i></td></tr><tr border="0"><td border="0" valign="top"> · <b>Description </b></td><td border="0">The <i>object</i> is popped from the stack as type <code>ptr</code>. The call frame stack is then unwound until a call frame with a non-zero exception frame height is found. The stack is then reset to the specified exception frame height. Then, <i>object</i> is re-pushed onto the stack and control is passed to the call frame method's exception matching code.</td></tr><tr border="0"><td border="0" valign="top"> · <b>Notes </b></td><td border="0">This is used to throw exceptions from within methods that do not have an <i>enter_try</i> instruction. Use <i>throw</i> if the method does include <code>try</code> blocks.</td></tr></table><br><br><p align="center"> <font size="-2">Copyright © Southern Storm Software Pty Ltd 2002 <br> Licensed under GNU FDL </font></p></body></html>