diff options
author | stefan <stefan@s00.xyz> | 2023-05-24 22:29:46 -0400 |
---|---|---|
committer | stefan <stefan@s00.xyz> | 2023-05-24 22:29:46 -0400 |
commit | 20621e073562ee5d423b636fae8b6aa8e38275fa (patch) | |
tree | 4a81bde039e58602e44a213cfb8d91a65f1dadd9 /vm/opcodes.go | |
parent | ba2b9c8a1bb1876b6eb4c9783fde798b19de4418 (diff) | |
download | evm-20621e073562ee5d423b636fae8b6aa8e38275fa.tar.gz |
readme and cleanup
Diffstat (limited to 'vm/opcodes.go')
-rw-r--r-- | vm/opcodes.go | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/vm/opcodes.go b/vm/opcodes.go index b3d4229..d1f6905 100644 --- a/vm/opcodes.go +++ b/vm/opcodes.go @@ -49,9 +49,18 @@ const ( PUSH30 = 0x7d PUSH31 = 0x7e PUSH32 = 0x7f + RETURN = 0xF3 //... ) func (op *Opcode) String() string { return Instructions[*op].name } + +func (o *Opcode) IsPush() byte { + d := *o - PUSH1 + if d >= 0 && d < 31 { + return byte(d) + 1 + } + return 0 +} |