RETURN opcode in the EVM takes 2 arguments(ie, consumes two elements from the stack), but what do they represent? I tried to understand the yellow paper describing them, but I don't understand the notation used.
The 2 arguments to the
RETURN opcode are offsets into memory: the starting and ending offset.
The EVM execution is stopped and data consisting of the memory bytes from [start, end-1] are the output of the execution.
If memory is [5, 6, 7, 8, 9, 10], a return with offsets 1, 4 would produce a result (output) of 3 bytes (6, 7, 8).