Concepts

Different abi functions

Assembly

When creating a variable in memory (in the stack, inside a function like uint a;), it stores a value;

When creating a variable inside assembly, it stores a pointer to the memory address.

Arrays, bytes and string are stored differently : the first 32 bytes slot is the size, and the next slots are the different values. 1 element == 1 slot (so 6 elements of 1 bytes, takes 6*32 bytes).

To load a brand new memory slot : mload(0x40)