#include "byte_code.h"

class IO {
public:
   static void print() {
      char * str = (char*)the_stack.top();
      the_stack.pop();
      cout << str << flush;
   }

   static void println() {
      char * str = (char*)the_stack.top();
      the_stack.pop();
      cout << str << endl;
   }

   static void printInt() {
      int i = (int)the_stack.top();
      the_stack.pop();
      cout << i << endl;
   }
};

int
main()
{
   int value;
   int arg1;
   int arg2;
   const char * ptr;
   IPUSH(0)
   ISTORE(value)
L1:
   LDC("VALUE = ")
   INVOKESTATIC(IO::print)
   ILOAD(value)
   INVOKESTATIC(IO::printInt)
   IPUSH(1)
   ILOAD(value)
   IADD()
   ISTORE(value)
   IPUSH(10)
   ILOAD(value)
   IF_ICMPNE(L1)
   RETURN(0)
}

