I have seen Bit masks being used in connection with inline assembly. I've seen it done in the 0x protocol repo and also in this repo. I was not able to find the answer on the web why this is done.
I know what a bit mask is and that the and operation renders any byte outside of the corresponding range to zero. My question is why this is needed, i.e. in which case would an address written into a memory slot have the remaining 96 bytes not all being zero?
Appreciate your help as I am trying to implement something very similar to 0x protocol for my project (DIVA Protocol) and want to make sure I fully understand it.
Hi,
I have seen Bit masks being used in connection with inline assembly. I've seen it done in the 0x protocol repo and also in this repo. I was not able to find the answer on the web why this is done.
I know what a bit mask is and that the
and
operation renders any byte outside of the corresponding range to zero. My question is why this is needed, i.e. in which case would an address written into a memory slot have the remaining 96 bytes not all being zero?Appreciate your help as I am trying to implement something very similar to 0x protocol for my project (DIVA Protocol) and want to make sure I fully understand it.