Hi,
This is being posted in the porting conference, although it is basically
a bug report.
This is because people doing ports should also be aware of the issue.
It appears that the “as” program that is part of binutils has a bug.
Whether it is an original bug in the 2.9.1 version, or introduced by
porting it to QNX6 is something I do not know.
(Note that a very small number of people are likely to hit this bug, due
to the limited likelihood of using .code16 directives in assembler code)
The description of the bug is as follows:
When code is in a section headed by a “.code16” section, some of the
register naming rules are not working correctly.
From what I can see… If a 16 bit register is referenced as an indirect
address, then you get an error message saying that a 32-bit register name
is required. If you use the 32-bit register name, then the assembly
works ( - not sure - have not checked emitted code yet ) as you would
expect had you supplied the 16 bit register name.
example:
movw son(%bx),%bx
gives the aforementioned error
changing it to:
movw son(%ebx),%bx
now appears to assemble as expected.
Note, however that as this is in a .code16 section, what really happens
is that the bx register is used, and not the ebx register.
(i.e. just the lower 16 bits)
This is basically a cosmetic thing, but a royal pain when trying to
assemble existing code. Have to keep changing %bx, %si, %di, %dx, etc.,
to the 32-bit equivalent register name!
\
Stephen Munnings
Software Developer
Corman Technologies Inc.
Sounds like you need the 2.10.1 assembler. Get binutils2101-qnx.tgz
from http://staff.qnx.com/~cburgess/gnu and run build-ntox86.$host
Stephen Munnings <steve@cormantech.com> wrote:
Hi,
This is being posted in the porting conference, although it is basically
a bug report.
This is because people doing ports should also be aware of the issue.
It appears that the “as” program that is part of binutils has a bug.
Whether it is an original bug in the 2.9.1 version, or introduced by
porting it to QNX6 is something I do not know.
(Note that a very small number of people are likely to hit this bug, due
to the limited likelihood of using .code16 directives in assembler code)
The description of the bug is as follows:
When code is in a section headed by a “.code16” section, some of the
register naming rules are not working correctly.
From what I can see… If a 16 bit register is referenced as an indirect
address, then you get an error message saying that a 32-bit register name
is required. If you use the 32-bit register name, then the assembly
works ( - not sure - have not checked emitted code yet ) as you would
expect had you supplied the 16 bit register name.
example:
movw son(%bx),%bx
gives the aforementioned error
changing it to:
movw son(%ebx),%bx
now appears to assemble as expected.
Note, however that as this is in a .code16 section, what really happens
is that the bx register is used, and not the ebx register.
(i.e. just the lower 16 bits)
This is basically a cosmetic thing, but a royal pain when trying to
assemble existing code. Have to keep changing %bx, %si, %di, %dx, etc.,
to the 32-bit equivalent register name!
Stephen Munnings
Software Developer
Corman Technologies Inc.
–
cburgess@qnx.com
In article <9cugps$h10$1@nntp.qnx.com>, cburgess@qnx.com says…
Sounds like you need the 2.10.1 assembler. Get binutils2101-qnx.tgz
from > http://staff.qnx.com/~cburgess/gnu > and run build-ntox86.$host
Thanks, that did the trick nicely!
–
Stephen Munnings
Software Developer
Corman Technologies Inc.