0

I'm trying to write the LSL instruction manually, and I come to one problem. Let us have.

LSL eax , sel

So I should get the limit of descriptor that is determined by SEL and place it in EAX.

What if the granularity is 1, do i have to take the limit then shift it right 12 bits and only then place it in EAX?

John
  • 1
  • 1
  • 2
    Doesn't Intel's manual explain this? _"If the descriptor has a page granular segment limit (the granularity flag is set to 1), the LSL instruction will translate the page granular limit (page limit) into a byte limit before loading it into the destination operand. The translation is performed by shifting the 20-bit “raw” limit left 12 bits and filling the low-order 12 bits with 1s."_ – Michael Jun 05 '16 at 08:28
  • Here i don't understand the "filling the low 12 bits with 1s" – John Jun 05 '16 at 08:34
  • :) well, I don't understand WHY do we have to fill with 1s, isn't it enough to just shift left 12 bits – John Jun 05 '16 at 08:38
  • 2
    Because the limit should be at the end of the page you specify? This is probably explained somewhere else in Intel's manual. – Michael Jun 05 '16 at 08:50

0 Answers0