Eric Seppanen <[EMAIL PROTECTED]> writes:

> On Wed, Feb 06, 2002 at 06:58:47PM +0200, Stefanos Papanicolopulos wrote:
> > Collins Chen wrote:
> > > I encounter a problem about instruction
> > > "jmp" and "call". I expect the "jmp" and
> > > "call" with a 16-bit offset, but every
> > > time the GCC compile them with 32-bit offset.
> > > This cause the vga bios can't run. I don't
> > > know how to fix it, can you help me? Thanks!
> > 
> > It seems your disassembler thinks the code runs
> > in 32bit mode. Don't worry. As you see, GCC get's
> > it right: the bytes are the same! The point is
> > that E8 (call) has a 'word' as an argument. Now,
> > in 16-bit mode, a word is 16bits. In 32-bit a
> > 'word' is 32bits. So in 16bit mode E8 is followed
> > by 2 bytes, in 32bit it is followed by 4.
> 
> I can confirm that objdump does not seem to be able to disassemble
> 16-bit assembly.
> 
> I have also had problems with gcc not correctly generating 16-bit code
> is some cases (in mixed 16/32bit code where symbols need to be resolved
> later by the linker).  I was not able to find a solution; maybe another
> assembler would work better.

Hmm.  In the rare cases with symbol relocation being an issue, I have
been able to do the symbol computation in the linker script, though
that may not be necissary.

Eric

Reply via email to