Fabcoin Core  0.16.2
P2P Digital Currency
Classes | Namespaces | Enumerations | Functions | Variables
Instruction.h File Reference
#include <functional>
#include <libdevcore/Common.h>
#include <libdevcore/Assertions.h>
#include "Exceptions.h"
Include dependency graph for Instruction.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  dev::eth::InstructionInfo
 Information structure for a particular instruction. More...
 

Namespaces

 dev
 Adapted from code found on http://stackoverflow.com/questions/180947/base64-decode-snippet-in-c Originally by RenĂ© Nyffenegger.
 
 dev::eth
 

Enumerations

enum  dev::eth::Instruction : uint8_t {
  dev::eth::Instruction::STOP = 0x00, dev::eth::Instruction::ADD, dev::eth::Instruction::MUL, dev::eth::Instruction::SUB,
  dev::eth::Instruction::DIV, dev::eth::Instruction::SDIV, dev::eth::Instruction::MOD, dev::eth::Instruction::SMOD,
  dev::eth::Instruction::ADDMOD, dev::eth::Instruction::MULMOD, dev::eth::Instruction::EXP, dev::eth::Instruction::SIGNEXTEND,
  dev::eth::Instruction::LT = 0x10, dev::eth::Instruction::GT, dev::eth::Instruction::SLT, dev::eth::Instruction::SGT,
  dev::eth::Instruction::EQ, dev::eth::Instruction::ISZERO, dev::eth::Instruction::AND, dev::eth::Instruction::OR,
  dev::eth::Instruction::XOR, dev::eth::Instruction::NOT, dev::eth::Instruction::BYTE, dev::eth::Instruction::SHA3 = 0x20,
  dev::eth::Instruction::ADDRESS = 0x30, dev::eth::Instruction::BALANCE, dev::eth::Instruction::ORIGIN, dev::eth::Instruction::CALLER,
  dev::eth::Instruction::CALLVALUE, dev::eth::Instruction::CALLDATALOAD, dev::eth::Instruction::CALLDATASIZE, dev::eth::Instruction::CALLDATACOPY,
  dev::eth::Instruction::CODESIZE, dev::eth::Instruction::CODECOPY, dev::eth::Instruction::GASPRICE, dev::eth::Instruction::EXTCODESIZE,
  dev::eth::Instruction::EXTCODECOPY, dev::eth::Instruction::BLOCKHASH = 0x40, dev::eth::Instruction::COINBASE, dev::eth::Instruction::TIMESTAMP,
  dev::eth::Instruction::NUMBER, dev::eth::Instruction::DIFFICULTY, dev::eth::Instruction::GASLIMIT, dev::eth::Instruction::JUMPTO = 0x4a,
  dev::eth::Instruction::JUMPIF, dev::eth::Instruction::JUMPV, dev::eth::Instruction::JUMPSUB, dev::eth::Instruction::JUMPSUBV,
  dev::eth::Instruction::RETURNSUB, dev::eth::Instruction::POP = 0x50, dev::eth::Instruction::MLOAD, dev::eth::Instruction::MSTORE,
  dev::eth::Instruction::MSTORE8, dev::eth::Instruction::SLOAD, dev::eth::Instruction::SSTORE, dev::eth::Instruction::JUMP,
  dev::eth::Instruction::JUMPI, dev::eth::Instruction::PC, dev::eth::Instruction::MSIZE, dev::eth::Instruction::GAS,
  dev::eth::Instruction::JUMPDEST, dev::eth::Instruction::BEGINSUB, dev::eth::Instruction::BEGINDATA, dev::eth::Instruction::PUSH1 = 0x60,
  dev::eth::Instruction::PUSH2, dev::eth::Instruction::PUSH3, dev::eth::Instruction::PUSH4, dev::eth::Instruction::PUSH5,
  dev::eth::Instruction::PUSH6, dev::eth::Instruction::PUSH7, dev::eth::Instruction::PUSH8, dev::eth::Instruction::PUSH9,
  dev::eth::Instruction::PUSH10, dev::eth::Instruction::PUSH11, dev::eth::Instruction::PUSH12, dev::eth::Instruction::PUSH13,
  dev::eth::Instruction::PUSH14, dev::eth::Instruction::PUSH15, dev::eth::Instruction::PUSH16, dev::eth::Instruction::PUSH17,
  dev::eth::Instruction::PUSH18, dev::eth::Instruction::PUSH19, dev::eth::Instruction::PUSH20, dev::eth::Instruction::PUSH21,
  dev::eth::Instruction::PUSH22, dev::eth::Instruction::PUSH23, dev::eth::Instruction::PUSH24, dev::eth::Instruction::PUSH25,
  dev::eth::Instruction::PUSH26, dev::eth::Instruction::PUSH27, dev::eth::Instruction::PUSH28, dev::eth::Instruction::PUSH29,
  dev::eth::Instruction::PUSH30, dev::eth::Instruction::PUSH31, dev::eth::Instruction::PUSH32, dev::eth::Instruction::DUP1 = 0x80,
  dev::eth::Instruction::DUP2, dev::eth::Instruction::DUP3, dev::eth::Instruction::DUP4, dev::eth::Instruction::DUP5,
  dev::eth::Instruction::DUP6, dev::eth::Instruction::DUP7, dev::eth::Instruction::DUP8, dev::eth::Instruction::DUP9,
  dev::eth::Instruction::DUP10, dev::eth::Instruction::DUP11, dev::eth::Instruction::DUP12, dev::eth::Instruction::DUP13,
  dev::eth::Instruction::DUP14, dev::eth::Instruction::DUP15, dev::eth::Instruction::DUP16, dev::eth::Instruction::SWAP1 = 0x90,
  dev::eth::Instruction::SWAP2, dev::eth::Instruction::SWAP3, dev::eth::Instruction::SWAP4, dev::eth::Instruction::SWAP5,
  dev::eth::Instruction::SWAP6, dev::eth::Instruction::SWAP7, dev::eth::Instruction::SWAP8, dev::eth::Instruction::SWAP9,
  dev::eth::Instruction::SWAP10, dev::eth::Instruction::SWAP11, dev::eth::Instruction::SWAP12, dev::eth::Instruction::SWAP13,
  dev::eth::Instruction::SWAP14, dev::eth::Instruction::SWAP15, dev::eth::Instruction::SWAP16, dev::eth::Instruction::LOG0 = 0xa0,
  dev::eth::Instruction::LOG1, dev::eth::Instruction::LOG2, dev::eth::Instruction::LOG3, dev::eth::Instruction::LOG4,
  dev::eth::Instruction::PUSHC = 0xac, dev::eth::Instruction::JUMPC, dev::eth::Instruction::JUMPCI, dev::eth::Instruction::BAD,
  dev::eth::Instruction::CREATE = 0xf0, dev::eth::Instruction::CALL, dev::eth::Instruction::CALLCODE, dev::eth::Instruction::RETURN,
  dev::eth::Instruction::DELEGATECALL, dev::eth::Instruction::SUICIDE = 0xff
}
 Virtual machine bytecode instruction. More...
 
enum  dev::eth::Tier : unsigned {
  dev::eth::Tier::Zero = 0, dev::eth::Tier::Base, dev::eth::Tier::VeryLow, dev::eth::Tier::Low,
  dev::eth::Tier::Mid, dev::eth::Tier::High, dev::eth::Tier::Ext, dev::eth::Tier::Special,
  dev::eth::Tier::Invalid
}
 

Functions

unsigned dev::eth::getPushNumber (Instruction _inst)
 
unsigned dev::eth::getDupNumber (Instruction _inst)
 
unsigned dev::eth::getSwapNumber (Instruction _inst)
 
Instruction dev::eth::pushInstruction (unsigned _number)
 
Instruction dev::eth::dupInstruction (unsigned _number)
 
Instruction dev::eth::swapInstruction (unsigned _number)
 
Instruction dev::eth::logInstruction (unsigned _number)
 
InstructionInfo dev::eth::instructionInfo (Instruction _inst)
 Information on all the instructions. More...
 
bool dev::eth::isValidInstruction (Instruction _inst)
 check whether instructions exists More...
 
void dev::eth::eachInstruction (bytes const &_mem, std::function< void(Instruction, u256 const &)> const &_onInstruction)
 Iterate through EVM code and call a function on each instruction. More...
 
std::string dev::eth::disassemble (bytes const &_mem)
 Convert from EVM code to simple EVM assembly language. More...
 

Variables

const std::map< std::string, Instructiondev::eth::c_instructions
 Convert from string mnemonic to Instruction type. More...