From mboxrd@z Thu Jan 1 00:00:00 1970 To: 9fans@cse.psu.edu Subject: Re: [9fans] calculating the gdt pointer in 32 bit (protected) mode From: "Russ Cox" MIME-Version: 1.0 Content-Type: text/plain; charset="US-ASCII" Content-Transfer-Encoding: 7bit Message-Id: <20020123235113.0F69B19A1C@mail.cse.psu.edu> Date: Wed, 23 Jan 2002 18:51:09 -0500 Topicbox-Message-UUID: 42bbd82e-eaca-11e9-9e20-41e7f4b1d025 It's pretty much what it says. $tgdtptr(SB) is a constant evaluated for us by the loader as though it were a function. The byte sequence here: BYTE $0x0f BYTE $0x01 BYTE $0x16 WORD $tgdtptr(SB) assembles to "LGDT $tgdtptr". It's a word-sized instruction, though. If you're already in 32-bit mode, you need to use BYTE $0x0f BYTE $0x01 BYTE $0x16 LONG $tgdtptr(SB) so that the immediate data is the right size. Russ