The EVM instructions are in the yellow paper, or they are summed up in this answer. But their gas costs are not there. Where can I find a list of all instructions with their associated gas costs?
The Yellow Paper is actively maintained and should always be current, and it's not as easy as a table, but the gas costs are there in Appendix G. Fee Schedule and read it with Appendix H.
A spreadsheet of opcodes and their gas costs that Ethereum launched with are here.
It has some analysis per How were gas costs chosen for the Ethereum Virtual Machine instructions?
The spreadsheet is titled 1.0 gas costs, so it might not be updated.
edit 2017-12-11: here is the EIP-150 revision of the spreadsheet
Here is a small snippet from it:
ADD .... 3 MUL .... 5 SUB .... 3 DIV .... 5 SDIV ... 5 MOD .... 5 SMOD ... 5 ADDMOD . 8 MULMOD . 8
If you're looking for such a table for the purpose of golfing down contract gas cost, I'd recommend you bookmark
It is good for two reasons:
- It is the source of truth. The gas costs specified in that file are what a full node really meters.
- It lists the important numbers you really need. For example, the usual gas table doesn't show how storage cost works and they don't tell you much about pre-compiled contracts.