Browse Source

PC instructions

cl-refactor
Paweł Bylica 10 years ago
parent
commit
c002d9b843
  1. 7
      evmcc/Compiler.cpp
  2. 2
      evmcc/bytecode/ext_test.evm
  3. 2
      evmcc/lll/ext_test.lll

7
evmcc/Compiler.cpp

@ -495,6 +495,13 @@ std::unique_ptr<llvm::Module> Compiler::compile(const dev::bytes& bytecode)
break;
}
case Instruction::PC:
{
auto value = builder.getIntN(256, currentPC);
stack.push(value);
break;
}
case Instruction::ADDRESS:
{
auto value = ext.address();

2
evmcc/bytecode/ext_test.evm

@ -1 +1 @@
3031333234363a40414243444536600035602635601335380060016002f2
5a3031333234363a4041424344455a36600035602635601335380060016002f2

2
evmcc/lll/ext_test.lll

@ -1,5 +1,6 @@
(asm
PC
ADDRESS
BALANCE
CALLER
@ -13,6 +14,7 @@ TIMESTAMP
NUMBER
DIFFICULTY
GASLIMIT
PC
CALLDATASIZE
0
CALLDATALOAD

Loading…
Cancel
Save