flat assembler
Message board for the users of flat assembler.
Index
> OS Construction > 16 bit real org 10000h lgdt |
Author |
|
Octavio 17 Feb 2006, 09:37
Code: push ds push 1000h ;10000h=1000:0000h pop ds lgdt pword [0] ;pword for 32bits table at 1000:0000h pop ds ;restore ds Last edited by Octavio on 18 Feb 2006, 15:15; edited 1 time in total |
|||
17 Feb 2006, 09:37 |
|
Tomasz Grysztar 17 Feb 2006, 10:17
With fasm LGDT needs PWORD operand.
But I actually forgot that in 16-bit variant it used the 5-byte memory location, not 6-byte. Perhaps I should add another size prefix? FBYTE? |
|||
17 Feb 2006, 10:17 |
|
vid 17 Feb 2006, 12:52
altough i don't like, it seems to be unavoidable. But maybe you should mention it in documentation only in part with "lgdt", not in general operators to prevent confusing reader... most people have probably never heard of instructions taking five-byte arguments.
|
|||
17 Feb 2006, 12:52 |
|
Tomasz Grysztar 17 Feb 2006, 13:32
Well, there is other solution. I could make LGDT in 16-bit mode to make the 5-byte variant when no operand size is specified (just like it works now), and 6-byte variant with PWORD size defined. In 32-bit mode it would always be the 6-byte variant. This solution is not as versatile, but still is much better than the current one and it avoids introducing another strange operator.
|
|||
17 Feb 2006, 13:32 |
|
lazer1 17 Feb 2006, 22:34
Tomasz Grysztar wrote: With fasm LGDT needs PWORD operand. for my example problem are you saying the following? Code: org 10000h .... mov ebx,gdt_pointer lgdt pword [ds:bx] |
|||
17 Feb 2006, 22:34 |
|
Tomasz Grysztar 19 Feb 2006, 11:41
Rather something like:
Code: mov bx,gdt_pointer and 0FFFh mov ax,(gdt_pointer and 0FFFFF000h) shr 4 mov ds,ax lgdt pword [ds:bx] |
|||
19 Feb 2006, 11:41 |
|
< Last Thread | Next Thread > |
Forum Rules:
|
Copyright © 1999-2024, Tomasz Grysztar. Also on GitHub, YouTube.
Website powered by rwasa.