void TrackEditor::connectDevice() {
	//        QDialog *devdlg = new QDialog(this);
	//        Ui::DeviceDialog dlg;
	//        dlg.setupUi(devdlg);

	CDeviceDialog *devdlg = new CDeviceDialog(this);
	devdlg->setModal(true);
	int retval = devdlg->exec();

	if(retval == QDialog::Accepted) {
		qDebug("OK pressed.");
		CSerialPortSettings settings = devdlg->getPortSettings();
		m_serial_port = new QextSerialPort(settings.getName(), settings);
		bool res = m_serial_port->open( QIODevice::ReadWrite );
		connect(m_serial_port, SIGNAL(readyRead()), this, SLOT(readDevice()));

		// openTTY("/dev/rfcomm0", 115200);
		m_device_io = new CWintec("WBT201");
		connect(this, SIGNAL(emitData(QByteArray)), m_device_io, SLOT(addData(QByteArray)));
		connect(m_device_io, SIGNAL(sendData(QByteArray)), this, SLOT(sendData(QByteArray)));
		connect(m_device_io, SIGNAL(nemaString(QString)), ui.nemaText, SLOT(appendPlainText(QString)));

		connect(m_device_io, SIGNAL(progress(int)), this, SLOT(progress(int)));

		connect(m_device_io, SIGNAL(readLogFinished()), this, SLOT(readLogFinished()));

		connect(m_device_io, SIGNAL(newTrack(Track*)), this, SLOT(newTrack(Track*)));
		connect(m_device_io, SIGNAL(newWayPoint(TrackPoint*)), this, SLOT(newWayPoint(TrackPoint*)));
		connect(m_device_io, SIGNAL(newLogPoint(TrackPoint*)), this, SLOT(newLogPoint(TrackPoint*)));

		// readDevice();

		ui.action_Read_Log->setDisabled(false);
	}
예제 #2
0
 bool list_display( void )
 {
   bool breturn = true;
   editLink = listTemplate.getParagraph("hotcolumn");
   editLink = editLink.replace("$prog$","store_ui.cgi");
   hotCol=2;    
   
   emitFilter( "store_ui.cgi",  // program name
               "Store" );       // Label
   
   emitHeadings("Id|<a style='color:blue;' href='store_ui.cgi?sort=MarketerName'>Marketer</a>|"
                 "<a style='color:blue;' href='store_ui.cgi?sort=StoreName'>Store</a>|"
                 "<a style='color:blue;' href='store_ui.cgi?sort=Featured'>Featured</a>|"
                 "<a style='color:blue;' href='store_ui.cgi?sort=Enabled'>Enabled</a>"); 
           
   getFilteredData( "StoreID, MarketerName, StoreName,"
                    "case Featured when 1 then 'Yes' else 'No' end as Featured,"
                    "case Enabled when 1 then 'Yes' else 'No' end as Enabled", 
                    "Store s inner join Marketer m on s.MarketerID = m.MarketerID", 
                    "StoreName like '$filter$%'", "StoreName" );
   emitData();    
   emitNavigation("store_ui.cgi");    
   emitEnd();
   return breturn;
 }
예제 #3
0
 bool list_display( void )
 {
   bool breturn = true;
   editLink = listTemplate.getParagraph("hotcolumn");
   editLink = editLink.replace("$prog$","users_ui.cgi");
   hotCol=1;    
   
   emitFilter( "users_ui.cgi",  // program name
               "&nbsp;&nbsp;&nbsp;&nbsp;<B>FILTER</B>" ); // Label
   
   emitHeadings("Id|User Name");
   if( !oLogin.SiteAdmin() )
   {  
      addedCriteria = " group_id = ";
      addedCriteria += oLogin.GroupId();
   } 
   getFilteredData( "id, concat( first, ' ', last) as name", 
                    "users", 
                    "last like '$filter$%'", 
                    "last, first" );     
   emitData();
   
   emitNavigation("users_ui.cgi");
   
   emitEnd();
   return breturn;
 }
예제 #4
0
static void parse_finish_branch (git_uint32* pc, Label op, LoadReg reg, int mode)
{
    git_sint32 val;
    if (parseLoad (pc, reg, mode, size32, &val))
    {
        // The branch offset is a constant, so we can
        // check for the special values 0 and 1 right here.
        
        if (val == 0)
        {
            emitCode (op - label_jeq_var + label_jeq_return0);
        }
        else if (val == 1)
        {
            emitCode (op - label_jeq_var + label_jeq_return1);
        }
        else
        {
            // Calculate the destination address and
            // emit a constant branch opcode.
            emitConstBranch (op - label_jeq_var + label_jeq_const, *pc + val - 2);
        }
    }
    else
    {
        // The branch offset isn't a constant, so just
        // emit the normal opcode plus the current PC.
        
        emitCode (op);
        emitData(*pc);
    }
}
예제 #5
0
  bool list_display( void )
  {
    bool breturn = true;
    hotCol=-1; // no heat
    string sql;
    
    Composite_Query_Obj qry;
    
    qry.key(atoll(Query_Id.c_str()));
    if( qry.get_data() )
    {
      
      sql = qry.asSQL(false);

      if( sql.find("limit") == string::npos )
        sql += " limit 2 ";       
      getData( sql ); 
      emitHeadings();      
      emitData();   
    }
    else
    {
      webIO << "No data in Query - Key: " << Query_Id << endl;
    }    

     
    emitEnd();
    return breturn;
  } 
예제 #6
0
KHTMLPageCacheDelivery *
KHTMLPageCacheEntry::fetchData(QObject *recvObj, const char *recvSlot)
{
    // Duplicate fd so that entry can be safely deleted while delivering the data.
    KCompressionDevice *dev = new KCompressionDevice(m_fileName, KCompressionDevice::GZip);
    dev->open(QIODevice::ReadOnly);
    KHTMLPageCacheDelivery *delivery = new KHTMLPageCacheDelivery(dev); // takes ownership of dev

    recvObj->connect(delivery, SIGNAL(emitData(QByteArray)), recvSlot);
    delivery->recvObj = recvObj;
    return delivery;
}
예제 #7
0
KHTMLPageCacheDelivery *
KHTMLPageCacheEntry::fetchData(QObject *recvObj, const char *recvSlot)
{
  // Duplicate fd so that entry can be safely deleted while delivering the data.
  KHTMLPageCacheDelivery *delivery=new KHTMLPageCacheDelivery(
                                                              KFilterDev::deviceForFile (m_fileName, "application/x-gzip")
                                                             );
  delivery->file->open(QIODevice::ReadOnly);

  recvObj->connect(delivery, SIGNAL(emitData(QByteArray)), recvSlot);
  delivery->recvObj = recvObj;
  return delivery;
}
예제 #8
0
  bool list_display( void )
  {
    bool breturn = true;

    editLink = listTemplate.getParagraph("hotcolumn");
    editLink = editLink.replace("$prog$","category_form.cgi").replace("_self","editPane");
    hotCol=1;     
    emitHeadings("ID|CATEGORY &nbsp; <a target='editPane' href='category_form.cgi'>New</a>");
    getData( "select Id, Name from Category  order by Cat_Order" );
    emitData();
    emitEnd();
    return breturn;
  }
예제 #9
0
void CGModule::emitModule(){
	
	CGSymFinder vis(this);
	
	size_t k;
	for( k=0;k<frames.size();++k ){
		CGFrame *f=frames[k];
		CGSym *sym=f->fun->sym;
		if( sym->linkage==CG_EXPORT ) exportSyms.insert( sym->value );
		CGAsm *as;
		for( as=f->assem.begin;as!=f->assem.end;as=as->succ ){
			CGStm *t=as->stm;
			if( !t ) continue;
			t->visit( vis );
		}
	}
	
	set<string>::iterator sym_it;
	
	//header
	emitHeader();
	
	//imports
	for( sym_it=importSyms.begin();sym_it!=importSyms.end();++sym_it ){
		emitImport( *sym_it );
	}
	
	//exports
	for( sym_it=exportSyms.begin();sym_it!=exportSyms.end();++sym_it ){
		emitExport( *sym_it );
	}
	
	//frames
	for( k=0;k<frames.size();++k ){
		emitFrame( frames[k] );
	}
	
	//datas
	for( k=0;k<datas.size();++k ){
		emitData( datas[k] );
	}
	
	//footer
	emitFooter();
	
	out.flush();
}
예제 #10
0
  bool list_display( string key )
  {
    bool breturn = true;
    string sql = "select Id, Name from Sub_Category where Category_Id = ";
    sql += key;
    sql += " order by Sub_Order";
    editLink = listTemplate.getParagraph("hotcolumn");
    editLink = editLink.replace("$prog$","sub_category_form.cgi").replace("_self","editPane");
    hotCol=1;    

    string heading = "ID|SUB-CATEGORY &nbsp; "
                     "<a target='editPane' href='sub_category_form.cgi?Category_Id=";
    heading+=key;
    heading+="'>New</a>";
    emitHeadings(heading);
    getData( sql );
    emitData();
    emitEnd();
    return breturn;
  }      
예제 #11
0
void emu_settings::SaveSettings()
{
	fs::file config;
	YAML::Emitter out;
	emitData(out, m_currentSettings);

	if (!m_title_id.empty())
	{
		config = fs::file(Emu.GetCustomConfigPath(m_title_id), fs::read + fs::write + fs::create);
	}
	else
	{
		config = fs::file(fs::get_config_dir() + "/config.yml", fs::read + fs::write + fs::create);
	}

	// Save config
	config.seek(0);
	config.trunc(0);
	config.write(out.c_str(), out.size());
	config.close();
}
예제 #12
0
  bool list_display( void )
  {
    bool breturn = true;
    editLink = listTemplate.getParagraph("hotcolumn");
    editLink = editLink.replace("$prog$","category_ui.cgi");
    hotCol=1;    

    
    emitFilter( "category_ui.cgi",  // program name
                "Category" );       // Label
    
    emitHeadings("Id|Category Name"); 
            
    getFilteredData( "CategoryID, CategoryName", "Category", 
                     "CategoryName like '$filter$%'", "CategoryName" );     
    emitData();
    
    emitNavigation("category_ui.cgi");
    
    emitEnd();
    return breturn;
  }
예제 #13
0
 bool list_display( void )
 {
   bool breturn = true;
   editLink = listTemplate.getParagraph("hotcolumn");
   editLink = editLink.replace("$prog$","roles_ui.cgi");
   hotCol=1;    
   
   emitFilter( "roles_ui.cgi",  // program name
               "&nbsp;&nbsp;&nbsp;&nbsp;<B>FILTER</B>" ); // Label
   
   emitHeadings("Id|Role Name"); 
           
   getFilteredData( "id, name", 
                    "roles", 
                    "name like '$filter$%'", 
                    "name" );     
   emitData();
   
   emitNavigation("roles_ui.cgi");
   
   emitEnd();
   return breturn;
 }
예제 #14
0
  bool list_display( void )
  {
    bool breturn = true;
    editLink = listTemplate.getParagraph("hotcolumn");
    editLink = editLink.replace("$prog$","group_sites_ui.cgi");
    hotCol=1;    
   
    emitFilter( "group_sites_ui.cgi",  // program name
                "&nbsp;&nbsp;&nbsp;&nbsp;<B>FILTER</B>" );  // Label

    emitHeadings("Id|Group|Site"); 
            
    getFilteredData( "gs.id, g.name, s.name", 
                     "group_sites gs inner join groups g on gs.group_id=g.id "
                     "inner join metasite.sites s on gs.site_id = s.id ",
                     "g.name like '$filter$%'", 
                     "g.name,s.name" );     
    emitData();
    
    emitNavigation("group_sites_ui.cgi");
    
    emitEnd();
    return breturn;
  }
예제 #15
0
파일: operands.c 프로젝트: DavidKinder/Git
void parseCatchStub (git_uint32 * pc, int * modes)
{
    git_uint32 tokenVal;
    git_sint32 branchVal;
    git_uint32 branchConst = 0;
    Block stubCode;

    switch (modes[0])
    {
        case 0x0: // Discard
            goto store_discard;
        case 0x5: // Contents of address 00 to FF. (One byte)
            tokenVal = memRead8(*pc);
            *pc += 1;
            goto store_addr;
        case 0x6: // Contents of address 0000 to FFFF. (Two bytes)
            tokenVal = memRead16(*pc);
            *pc += 2;
            goto store_addr;
        case 0x7: // Contents of any address. (Four bytes)
            tokenVal = memRead32(*pc);
            *pc += 4;
            goto store_addr;
        case 0x8: // Value popped off stack. (Zero bytes)
            goto store_stack;
        case 0x9: // Call frame local at store_address 00 to FF. (One byte)
            tokenVal = memRead8(*pc);
            *pc += 1;
            goto store_local;
        case 0xA: // Call frame local at store_address 0000 to FFFF. (Two bytes)
            tokenVal = memRead16(*pc);
            *pc += 2;
            goto store_local;
        case 0xB: // Call frame local at any store_address. (Four bytes)
            tokenVal = memRead32(*pc);
            *pc += 4;
            goto store_local;
        case 0xD: // Contents of RAM address 00 to FF. (One byte)
            tokenVal = memRead8(*pc) + gRamStart;
            *pc += 1;
            goto store_addr;
        case 0xE: // Contents of RAM address 0000 to FFFF. (Two bytes)
            tokenVal = memRead16(*pc) + gRamStart;
            *pc += 2;
            goto store_addr;
        case 0xF: // Contents of RAM, any address. (Four bytes)
            tokenVal = memRead32(*pc) + gRamStart;
            *pc += 4;
            goto store_addr;
        // ------------------------------------------------------
        store_discard:
            branchConst = parseLoad (pc, reg_L1, modes[1], size32, &branchVal);
            emitCode (label_catch_stub_discard);
            break;
        store_stack:
            branchConst = parseLoad (pc, reg_L1, modes[1], size32, &branchVal);
            emitCode (label_catch_stub_stack);
            break;
        store_addr:
            branchConst = parseLoad (pc, reg_L1, modes[1], size32, &branchVal);
            emitCode (label_catch_stub_addr);
            emitData (tokenVal);
            break;
        store_local:
            branchConst = parseLoad (pc, reg_L1, modes[1], size32, &branchVal);
            emitCode (label_catch_stub_local);
            emitData (tokenVal);
            break;
    }
    
    // The catch stub ends with the address to go to on throw,
    // which is after the branch, so we don't know what it is yet.
    emitData (0);
    stubCode = peekAtEmittedStuff (1);

    // Emit the branch taken after storing the catch token.
    if (branchConst)
    {
        if (branchVal == 0)
            emitCode (label_jump_return0);
        else if (branchVal == 1)
            emitCode (label_jump_return1);
        else
            emitConstBranch (label_jump_const, *pc + branchVal - 2);
    }
    else
    {
        emitCode (label_jump_var);
        emitData (*pc);
    }

    // Fix up the throw return address
    *stubCode = *pc;
    nextInstructionIsReferenced ();
}
예제 #16
0
파일: operands.c 프로젝트: DavidKinder/Git
void parseStore (git_uint32 * pc, StoreReg reg, int mode, TransferSize size)
{
    git_uint32 value;

    switch (mode)
    {
        case 0x0: // Discard
            break;

        case 0x5: // Contents of address 00 to FF. (One byte)
            value = memRead8(*pc);
            *pc += 1;
            goto store_addr;

        case 0x6: // Contents of address 0000 to FFFF. (Two bytes)
            value = memRead16(*pc);
            *pc += 2;
            goto store_addr;

        case 0x7: // Contents of any address. (Four bytes)
            value = memRead32(*pc);
            *pc += 4;
            goto store_addr;

        case 0x8: // Value popped off stack. (Zero bytes)
            goto store_stack;

        case 0x9: // Call frame local at store_address 00 to FF. (One byte)
            value = memRead8(*pc);
            *pc += 1;
            goto store_local;

        case 0xA: // Call frame local at store_address 0000 to FFFF. (Two bytes)
            value = memRead16(*pc);
            *pc += 2;
            goto store_local;

        case 0xB: // Call frame local at any store_address. (Four bytes)
            value = memRead32(*pc);
            *pc += 4;
            goto store_local;

        case 0xD: // Contents of RAM address 00 to FF. (One byte)
            value = memRead8(*pc) + gRamStart;
            *pc += 1;
            goto store_addr;

        case 0xE: // Contents of RAM address 0000 to FFFF. (Two bytes)
            value = memRead16(*pc) + gRamStart;
            *pc += 2;
            goto store_addr;

        case 0xF: // Contents of RAM, any address. (Four bytes)
            value = memRead32(*pc) + gRamStart;
            *pc += 4;
            goto store_addr;

        // ------------------------------------------------------

        store_stack:
            emitCode (reg == reg_S1 ? label_S1_stack : label_S2_stack);
            break;

        store_addr:
            if (size == size32)
			{
                emitCode (reg == reg_S1 ? label_S1_addr : label_S2_addr);
            }
			else
			{
				assert (reg == reg_S1);
				emitCode (size == size16 ? label_S1_addr16 : label_S1_addr8);
			}
            emitData (value);
            break;

        store_local:
            emitCode (reg == reg_S1 ? label_S1_local : label_S2_local);
            emitData (value / 4); // Convert byte offset to word offset.
            break;
    }
}
예제 #17
0
파일: operands.c 프로젝트: DavidKinder/Git
static void parseStub (git_uint32 * pc, int mode, Label discardOp)
{
    git_uint32 value;
    switch (mode)
    {
        case 0x0: // Discard
            goto store_discard;
        case 0x5: // Contents of address 00 to FF. (One byte)
            value = memRead8(*pc);
            *pc += 1;
            goto store_addr;
        case 0x6: // Contents of address 0000 to FFFF. (Two bytes)
            value = memRead16(*pc);
            *pc += 2;
            goto store_addr;
        case 0x7: // Contents of any address. (Four bytes)
            value = memRead32(*pc);
            *pc += 4;
            goto store_addr;
        case 0x8: // Value popped off stack. (Zero bytes)
            goto store_stack;
        case 0x9: // Call frame local at store_address 00 to FF. (One byte)
            value = memRead8(*pc);
            *pc += 1;
            goto store_local;
        case 0xA: // Call frame local at store_address 0000 to FFFF. (Two bytes)
            value = memRead16(*pc);
            *pc += 2;
            goto store_local;
        case 0xB: // Call frame local at any store_address. (Four bytes)
            value = memRead32(*pc);
            *pc += 4;
            goto store_local;
        case 0xD: // Contents of RAM address 00 to FF. (One byte)
            value = memRead8(*pc) + gRamStart;
            *pc += 1;
            goto store_addr;
        case 0xE: // Contents of RAM address 0000 to FFFF. (Two bytes)
            value = memRead16(*pc) + gRamStart;
            *pc += 2;
            goto store_addr;
        case 0xF: // Contents of RAM, any address. (Four bytes)
            value = memRead32(*pc) + gRamStart;
            *pc += 4;
            goto store_addr;
        // ------------------------------------------------------
        store_discard:
            emitCode (discardOp);
            break;
        store_stack:
            emitCode (discardOp + (label_call_stub_stack - label_call_stub_discard));
            break;
        store_addr:
            emitCode (discardOp + (label_call_stub_addr - label_call_stub_discard));
            emitData (value);
            break;
        store_local:
            emitCode (discardOp + (label_call_stub_local - label_call_stub_discard));
            emitData (value);
            break;
    }
    
    // Every call stub ends with the glulx return address.
    emitData (*pc);

    // ...which means that every call stub references the next instruction.
    nextInstructionIsReferenced ();
}
예제 #18
0
파일: operands.c 프로젝트: DavidKinder/Git
git_uint32 parseLoad (git_uint32 * pc, LoadReg reg, int mode, TransferSize size, git_sint32 * constVal)
{
    git_uint32 value;

    switch (mode)
    {
        case 0x0: // Constant zero. (Zero bytes)
            value = 0;
            goto load_const;

        case 0x1: // Constant, -80 to 7F. (One byte)
            value = (git_sint32) ((git_sint8) memRead8(*pc));
            *pc += 1;
            goto load_const;

        case 0x2: // Constant, -8000 to 7FFF. (Two bytes)
            value = (git_sint32) ((git_sint16) memRead16(*pc));
            *pc += 2;
            goto load_const;

        case 0x3: // Constant, any value. (Four bytes)
            value = memRead32(*pc);
            *pc += 4;
            goto load_const;

        case 0x5: // Contents of address 00 to FF. (One byte)
            value = memRead8(*pc);
            *pc += 1;
            goto load_addr;

        case 0x6: // Contents of address 0000 to FFFF. (Two bytes)
            value = memRead16(*pc);
            *pc += 2;
            goto load_addr;

        case 0x7: // Contents of any address. (Four bytes)
            value = memRead32(*pc);
            *pc += 4;
            goto load_addr;

        case 0x8: // Value popped off stack. (Zero bytes)
            goto load_stack;

        case 0x9: // Call frame local at address 00 to FF. (One byte)
            value = memRead8(*pc);
            *pc += 1;
            goto load_local;

        case 0xA: // Call frame local at address 0000 to FFFF. (Two bytes)
            value = memRead16(*pc);
            *pc += 2;
            goto load_local;

        case 0xB: // Call frame local at any address. (Four bytes)
            value = memRead32(*pc);
            *pc += 4;
            goto load_local;

        case 0xD: // Contents of RAM address 00 to FF. (One byte)
            value = memRead8(*pc) + gRamStart;
            *pc += 1;
            goto load_addr;

        case 0xE: // Contents of RAM address 0000 to FFFF. (Two bytes)
            value = memRead16(*pc) + gRamStart;
            *pc += 2;
            goto load_addr;

        case 0xF: // Contents of RAM, any address. (Four bytes)
            value = memRead32(*pc) + gRamStart;
            *pc += 4;
            goto load_addr;

        default: // Illegal addressing mode
            abortCompilation();
            break;

        // ------------------------------------------------------

        load_const:
            if (constVal)
            {
                *constVal = value;
                return 1;
            }
            else
            {
                emitCode (label_L1_const + reg);
                emitData (value);
            }
            break;

        load_stack:
			emitCode (label_L1_stack + reg);
			break;

        load_addr:
            if (value < gRamStart)
            {
                if (size == size32)
                    value = memRead32(value);
                else if (size == size16)
                    value = memRead16(value);
                else
                    value = memRead8(value);
				goto load_const;
            }
			switch (size)
			{
				case size8:
					assert (reg == reg_L1);
					emitCode (label_L1_addr8);
					break;

				case size16:
					assert (reg == reg_L1);
					emitCode (label_L1_addr16);
					break;

				case size32:
					emitCode (label_L1_addr + reg);
					break;
			}
			emitData (value);
			break;

        load_local:
            emitCode (label_L1_local + reg);
            emitData (value / 4); // Convert byte offset to word offset.
            break;
    }

    return 0;
}
예제 #19
0
void parseInstruction (git_uint32* pc, int * done)
{
    git_uint32 pcStart = *pc;
    int modes [8];
    git_uint32 opcode;
    
    static int ops = 0;
    ++ops;
    
    // Fetch the opcode.
    opcode = memRead8((*pc)++);

    // Check for multi-byte opcode.
    if (opcode & 0x80)
    {
        if (opcode & 0x40)
        {
            // Four-byte opcode.
            opcode &= 0x3F;
            opcode = (opcode << 8) | memRead8((*pc)++);
            opcode = (opcode << 8) | memRead8((*pc)++);
            opcode = (opcode << 8) | memRead8((*pc)++);
        }
        else
        {
            // Two-byte opcode.
            opcode &= 0x7F;
            opcode = (opcode << 8) | memRead8((*pc)++);
        }
    }

    if (gDebug)
    {
        emitCode (label_debug_step);
        emitData (pcStart);
        emitData (opcode);
    }
    
    // printf (" opcode=0x%x", opcode);
    
    // Now we have an opcode number,
    // parse the operands and emit code.
    
    switch (opcode)
    {
        case op_nop: emitCode (label_nop); break;

        // Arithmetic and logic

        case op_add: parseLLS (pc, label_add_discard); break;
        case op_sub: parseLLS (pc, label_sub_discard); break;        
        case op_mul: parseLLS (pc, label_mul_discard); break;
        case op_div: parseLLS (pc, label_div_discard); break;
        case op_mod: parseLLS (pc, label_mod_discard); break;
        
        case op_bitand: parseLLS (pc, label_bitand_discard); break;
        case op_bitor:  parseLLS (pc, label_bitor_discard);  break;
        case op_bitxor: parseLLS (pc, label_bitxor_discard); break;

        case op_neg:    parseLS (pc, label_neg_discard);    break;
        case op_bitnot: parseLS (pc, label_bitnot_discard); break;

        case op_shiftl:  parseLLS (pc, label_shiftl_discard);  break;
        case op_ushiftr: parseLLS (pc, label_ushiftr_discard); break;
        case op_sshiftr: parseLLS (pc, label_sshiftr_discard); break;

        // Branches

        case op_jump: parseL_branch (pc, label_jump_var); *done = 1; break;
        case op_jz:   parseLL_branch (pc, label_jz_var);  break;
        case op_jnz:  parseLL_branch (pc, label_jnz_var); break;
        case op_jeq:  parseLLL_branch (pc, label_jeq_var);  break;
        case op_jne:  parseLLL_branch (pc, label_jne_var);  break;
        case op_jlt:  parseLLL_branch (pc, label_jlt_var);  break;
        case op_jgt:  parseLLL_branch (pc, label_jgt_var);  break;
        case op_jle:  parseLLL_branch (pc, label_jle_var);  break;
        case op_jge:  parseLLL_branch (pc, label_jge_var);  break;
        case op_jltu: parseLLL_branch (pc, label_jltu_var); break;
        case op_jgtu: parseLLL_branch (pc, label_jgtu_var); break;
        case op_jleu: parseLLL_branch (pc, label_jleu_var); break;
        case op_jgeu: parseLLL_branch (pc, label_jgeu_var); break;
        
        case op_jumpabs: parseL (pc, label_jumpabs); *done = 1; break;

        // Moving data

        case op_copy:
            parseModeNibbles (pc, 2, modes);
            parseLoad (pc, reg_L1, modes [0], size32, NULL);
            parseStore (pc, reg_S1, modes [1], size32);
            break;

        case op_copys:
            parseModeNibbles (pc, 2, modes);
            parseLoad (pc, reg_L1, modes [0], size16, NULL);
            emitCode (label_copys_discard);
            parseStore (pc, reg_S1, modes [1], size16);
            break;
        
        case op_copyb:
            parseModeNibbles (pc, 2, modes);
            parseLoad (pc, reg_L1, modes [0], size8, NULL);
            emitCode (label_copyb_discard);
            parseStore (pc, reg_S1, modes [1], size8);
            break;

        case op_sexs: parseLS (pc, label_sexs_discard); break;
        case op_sexb: parseLS (pc, label_sexb_discard); break;

        // Array data

        case op_aload:    parseLLS (pc, label_aload_discard);    break;
        case op_aloads:   parseLLS (pc, label_aloads_discard);   break;
        case op_aloadb:   parseLLS (pc, label_aloadb_discard);   break;
        case op_aloadbit: parseLLS (pc, label_aloadbit_discard); break;
        
        case op_astore:    parseLLL (pc, label_astore);    break;
        case op_astores:   parseLLL (pc, label_astores);   break;
        case op_astoreb:   parseLLL (pc, label_astoreb);   break;
        case op_astorebit: parseLLL (pc, label_astorebit); break;

        // The stack

        case op_stkcount: parseS (pc, label_stkcount);  break;
        case op_stkpeek:  parseLS (pc, label_stkpeek);  break;
        case op_stkswap:  emitCode (label_stkswap); break;
        case op_stkcopy:  parseL (pc, label_stkcopy);   break;
        case op_stkroll:  parseLL (pc, label_stkroll);  break;

        // Functions

        case op_call:
            parseModeNibbles (pc, 3, modes);        
            parseLoad (pc, reg_L1, modes [0], size32, NULL);
            parseLoad (pc, reg_L2, modes [1], size32, NULL);
            emitCode (label_args_stack);
            parseCallStub (pc, modes [2]);
            break;

        case op_callf:
            parseModeNibbles (pc, 2, modes);
            parseLoad (pc, reg_L1, modes [0], size32, NULL);
            emitCode (label_args_0);
            parseCallStub (pc, modes [1]);
            break;

        case op_callfi:
            parseModeNibbles (pc, 3, modes);
            parseLoad (pc, reg_L1, modes [0], size32, NULL);
            parseLoad (pc, reg_L2, modes [1], size32, NULL);
            emitCode (label_args_1);
            parseCallStub (pc, modes [2]);
            break;

        case op_callfii:
            parseModeNibbles (pc, 4, modes);
            parseLoad (pc, reg_L1, modes [0], size32, NULL);
            parseLoad (pc, reg_L2, modes [1], size32, NULL);
            parseLoad (pc, reg_L3, modes [2], size32, NULL);
            emitCode (label_args_2);
            parseCallStub (pc, modes [3]);
            break;

        case op_callfiii:
            parseModeNibbles (pc, 5, modes);
            parseLoad (pc, reg_L1, modes [0], size32, NULL);
            parseLoad (pc, reg_L2, modes [1], size32, NULL);
            parseLoad (pc, reg_L3, modes [2], size32, NULL);
            parseLoad (pc, reg_L4, modes [3], size32, NULL);
            emitCode (label_args_3);
            parseCallStub (pc, modes [4]);
            break;

        case op_return:
            parseL (pc, label_return);
            *done = 1;
            break;

        case op_tailcall:
            parseModeNibbles (pc, 2, modes);        
            parseLoad (pc, reg_L1, modes [0], size32, NULL);
            parseLoad (pc, reg_L2, modes [1], size32, NULL);
            emitCode (label_args_stack);
            emitCode (label_tailcall);
            *done = 1;
            break;

        // Continuations

        case op_catch: parseCatch (pc); break;
        case op_throw:
            parseLL (pc, label_throw);
            *done = 1;
            break;

        case op_random:  parseLS (pc, label_random); break;
        case op_setrandom:  parseL (pc, label_setrandom); break;

        case op_getmemsize: parseS (pc, label_getmemsize); break;
        case op_setmemsize: parseLS (pc, label_setmemsize); break;
        
        case op_quit:
            emitCode (label_quit);
            *done = 1;
            break;
        
        case op_restart:
            emitCode (label_restart);
            *done = 1;
            break;
        
        case op_restore: parseLS (pc, label_restore); break;
        case op_restoreundo: parseS (pc, label_restoreundo); break;
        case op_protect: parseLL (pc, label_protect); break;
        case op_verify: parseS (pc, label_verify); break;

        case op_save:
            parseModeNibbles (pc, 2, modes);
            parseLoad (pc, reg_L1, modes [0], size32, NULL);
            parseSaveStub (pc, modes [1]);
            break;

        case op_saveundo:
            parseModeNibbles (pc, 1, modes);
            parseUndoStub (pc, modes [0]);
            break;

        case op_getiosys: parseSS (pc, label_getiosys);  break;
        case op_setiosys: parseLL (pc, label_setiosys);  break;

        case op_getstringtbl: parseS (pc, label_getstringtbl);  break;
        case op_setstringtbl: parseL (pc, label_setstringtbl);  break;

        case op_streamchar:    parseL (pc, label_streamchar);    emitData(*pc); break;
        case op_streamnum:     parseL (pc, label_streamnum);     emitData(*pc); break;
        case op_streamstr:     parseL (pc, label_streamstr);     emitData(*pc); break;
        case op_streamunichar: parseL (pc, label_streamunichar); emitData(*pc); break;
 
        case op_glk: parseLLS (pc, label_glk); break;
        case op_gestalt: parseLLS (pc, label_gestalt); break;

        case op_binarysearch:
        case op_linearsearch:
            parseModeNibbles (pc, 8, modes);
            parseLoad (pc, reg_L1, modes [0], size32, NULL);
            parseLoad (pc, reg_L2, modes [1], size32, NULL);
            parseLoad (pc, reg_L3, modes [2], size32, NULL);
            parseLoad (pc, reg_L4, modes [3], size32, NULL);
            parseLoad (pc, reg_L5, modes [4], size32, NULL);
            parseLoad (pc, reg_L6, modes [5], size32, NULL);
            parseLoad (pc, reg_L7, modes [6], size32, NULL);
            emitCode (opcode == op_linearsearch ? label_linearsearch : label_binarysearch);
            parseStore (pc, reg_S1, modes [7], size32);
            break;

        case op_linkedsearch:
            parseModeNibbles (pc, 7, modes);
            parseLoad (pc, reg_L1, modes [0], size32, NULL);
            parseLoad (pc, reg_L2, modes [1], size32, NULL);
            parseLoad (pc, reg_L3, modes [2], size32, NULL);
            parseLoad (pc, reg_L4, modes [3], size32, NULL);
            parseLoad (pc, reg_L5, modes [4], size32, NULL);
            parseLoad (pc, reg_L6, modes [5], size32, NULL);
            emitCode (label_linkedsearch);
            parseStore (pc, reg_S1, modes [6], size32);
            break;
        
        case op_debugtrap:
            parseL (pc, label_debugtrap);
            break;
        
        // Memory management
            
        case op_mzero: parseLL (pc, label_mzero); break;
        case op_mcopy: parseLLL (pc, label_mcopy); break;
        
        case op_malloc: parseLS (pc, label_malloc); break;
        case op_mfree: parseL (pc, label_mfree); break;
        
        // Function acceleration
            
        case op_accelfunc: parseLL (pc, label_accelfunc); break;
        case op_accelparam: parseLL (pc, label_accelparam); break;

        // Floating point

        case op_numtof: parseLS (pc, label_numtof); break;
        case op_ftonumz: parseLS (pc, label_ftonumz); break;
        case op_ftonumn: parseLS (pc, label_ftonumn); break;
        case op_ceil: parseLS (pc, label_ceil); break;
        case op_floor: parseLS (pc, label_floor); break;
        case op_sqrt: parseLS (pc, label_sqrt); break;
        case op_exp: parseLS (pc, label_exp); break;
        case op_log: parseLS (pc, label_log); break;

        case op_fadd: parseLLS (pc, label_fadd_discard); break;
        case op_fsub: parseLLS (pc, label_fsub_discard); break;
        case op_fmul: parseLLS (pc, label_fmul_discard); break;
        case op_fdiv: parseLLS (pc, label_fdiv_discard); break;
        case op_pow: parseLLS (pc, label_pow); break;
        case op_atan2: parseLLS (pc, label_atan2); break;

        case op_fmod: parseLLSS (pc, label_fmod); break;

        case op_sin: parseLS (pc, label_sin); break;
        case op_cos: parseLS (pc, label_cos); break;
        case op_tan: parseLS (pc, label_tan); break;
        case op_asin: parseLS (pc, label_asin); break;
        case op_acos: parseLS (pc, label_acos); break;
        case op_atan: parseLS (pc, label_atan); break;

        case op_jfeq: parseLLLL_branch (pc, label_jfeq_var); break;
        case op_jfne: parseLLLL_branch (pc, label_jfne_var); break;

        case op_jflt: parseLLL_branch (pc, label_jflt_var); break;
        case op_jfle: parseLLL_branch (pc, label_jfle_var); break;
        case op_jfgt: parseLLL_branch (pc, label_jfgt_var); break;
        case op_jfge: parseLLL_branch (pc, label_jfge_var); break;

        case op_jisnan: parseLL_branch (pc, label_jisnan_var); break;
        case op_jisinf: parseLL_branch (pc, label_jisinf_var); break;

        // Special Git opcodes
        
        case op_git_setcacheram: parseL (pc, label_git_setcacheram); break;
        case op_git_prunecache: parseLL (pc, label_git_prunecache); break;
        
        default:
            // Unknown opcode.
            abortCompilation();
            break;
    }
}