using System;
using System.Collections.Generic;
using System.Text;
namespace libLSL
{
class lslByteCode
{
byte[] bytecode;
public void executeStep()
{
byte ins = nextInstruction();
lslOpcodes code = (lslOpcodes)ins;
Object arg1;
Object arg2;
switch (code)
{
case lslOpcodes.OP_NOOP:
break;
case lslOpcodes.OP_POP:
popBytes(4);
break;
case lslOpcodes.OP_POPS:
case lslOpcodes.OP_POPL:
// Do Stuff
break;
case lslOpcodes.OP_POPV:
popBytes(12);
break;
case lslOpcodes.OP_POPQ:
popBytes(16);
break;
case lslOpcodes.OP_POPARG:
popBytes((Int32)arg1);
break;
case lslOpcodes.OP_POPIP:
// Do Stuff
break;
case lslOpcodes.OP_POPBP:
// Do Stuff
break;
case lslOpcodes.OP_POPSP:
// Do Stuff
break;
case lslOpcodes.OP_POPSLR:
// Do Stuff
break;
case lslOpcodes.OP_DUP:
pushBytes(getBytes(4));
break;
case lslOpcodes.OP_DUPS:
case lslOpcodes.OP_DUPL:
// Do Stuff
break;
case lslOpcodes.OP_DUPV:
pushBytes(getBytes(12));
break;
case lslOpcodes.OP_DUPQ:
pushBytes(getBytes(16));
break;
case lslOpcodes.OP_STORE:
// Somefin.
break;
default:
break;
}
}
///
/// Advance the instruction pointer, pull the current instruction
///
///
byte nextInstruction()
{
return 0;
}
///
/// Removes bytes from the stack
///
/// Number of bytes
void popBytes(int num)
{
}
///
/// Pushes Bytes to the stack
///
/// Ze bytes!
void pushBytes(byte[] bytes)
{
}
///
/// Get Bytes from the stack
///
/// Number of bytes
/// Ze bytes!
byte[] getBytes(int num)
{
}
///
/// Saves bytes to the local frame
///
/// Ze bytes!
/// Index in local frame
void storeBytes(byte[] bytes, int index)
{
}
}
}