A D wrote:
Hi! I have couple of questions regarding gnu assembly. I've heard the wordsegment override. Where segment register can be manually overriden. so how can ioverride say ds register? can segment register be overriden to my preferred memory address location? mov $0xf800, %ax mov %ax, %es mov %ds, %bx But I get segmentation fault error. How can i do it without error?
Use a valid selector. You appear to have "heard about" some 16=bit real mode stuff that is not true in protected mode. Take a look here:
http://my.execpc.com/~geezer/johnfine/segments.htmIn "Linux assembly", there is no reason you'd *want* to use a segment override, or alter a segment register.
Also I was looking at the function of lldt instruction. The manual says that:"The source operand (a general-purpose register or a memory location) contains a segment selector that points to a local descriptor table (LDT)." How can one make segment selector point to ldt?
"lldt ax" or "lldt [mem]" (16-bits)... I guess. But why? The limit is 0xffffffff and the base is 0. (Windows uses fs in a way that might be "interesting"..._
If you're developing your own OS (using Linux), starting from a bootsector - or GRUB - these instructions might be useful, but for "Linux assembly", forget that segment registers exist! (and be glad! :)
Best, Frank - To unsubscribe from this list: send the line "unsubscribe linux-assembly" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html
- Follow-Ups:
- Re: Segment override and lldt instruction
- From: Hendrik Visage
- Re: Segment override and lldt instruction
- From: A D
- Re: Segment override and lldt instruction
- References:
- Segment override and lldt instruction
- From: A D
- Segment override and lldt instruction
- Prev by Date: Segment override and lldt instruction
- Next by Date: Re: Segment override and lldt instruction
- Previous by thread: Segment override and lldt instruction
- Next by thread: Re: Segment override and lldt instruction
- Index(es):