3 ms·
Oh, I thought SAL only existed as a mnemonic, I was rather surprised to find out SAL actually has x86 instruction encoding different from SHL!
by vardump 11y ago
Oh, I thought SAL only existed as a mnemonic, I was rather surprised to find out SAL actually has x86 instruction encoding different from SHL!
- userbinator 11y agoIt's an undocumented one, that just happens to fill the encoding space of: - shift right and insert 0 ("logical right") - shift right and insert sign bit ("arithmetic right") - shift left and insert 0 ("logical left") - shift left and insert... 0 ("arithmetic left") ** My guess is that it causes the hardware to attempt to sign-extend and shift left, but the latter means the former doesn't have any effect. The Z80 has a similar gap in the encoding but rather more unusual undocumented behaviour here, where it would shift left and insert a 1 in the lowest bit.