This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: New back end ia16: 16-bit Intel x86


Rask Ingemann Lambertsen wrote:
> 
>>>> It is also much harder to eliminate the frame pointer in
>>>> 16-bit mode, since there is no %sp-based addressing at all.
>>>    With disp(%esp) being valid on i386, you don't have that problem either.
>> If your environment isn't clean w.r.t. the top half of %esp, you can't
>> *ever* use this mode.  The stack pointer especially...
> 
>    It doesn't seem to be a likely problem to me. Code operating on %sp can't
> clobber the top half[1]. Code operating on %esp will need to restore it or run
> into trouble. It would be very unusual to not restore the stack pointer. If
> this was to be a problem, you wouldn't be able to just use ".code16gcc".
> 

It would be a bug, to be sure, and as I said, I haven't actually seen it
"in the wild" which is a good thing.  Given the kind of crap I've seen
BIOS vendors do, though, I can't rule it out.

> [1] Strictly speaking, only bits 16-19 are of any concern.

Uh, no.  Any bits [31:16] set will cause a segment violation.

	-hpa


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]