[OpenBIOS] Writing 16bit code using the GNU assembler!

Johan Rydberg johan.rydberg at netinsight.se
Sat Jul 3 17:00:09 CEST 1999


"Maciej W. Rozycki" wrote:
> 
> On Sat, 3 Jul 1999, Johan Rydberg wrote:
> 
> > I'm writing a BIOS for the STPC Consumer (from STMicroelectronics)
> > using the GNU assembler. Does anyone else uses the GNU assembler
> > for writing 16bit code?
> 
>  I do.
> 
> --
> +  Maciej W. Rozycki, Technical University of Gdansk, Poland   +
> +--------------------------------------------------------------+
> +        e-mail: macro at ds2.pg.gda.pl, PGP key available        +
> 
> -
> To Unsubscribe: send mail to majordomo at freiburg.linux.de
> with "unsubscribe openbios" in the body of the message

How do you relocate a 16bit pointer ?  Do you use the ``addr32´´
macro ?

Example:

		addr32
		movw	$0f, %si
	0:

ELF doesn't support 16-bit relocations, how do you solve this?
And I have run into another problem with the GNU assembler. If
you for example do the following:

		lodsw	%cs:(%si), %ax

It generates the following code:

		lodsw	%ds:(%si), %ax

You have to make the %cs prefix of your own in the code, by
adding a ``.byte 0x2e´´ infront of the instruction. Have you
also run into this problem 


-- 
Johan Rydberg
Net Insight AB          johan.rydberg at netinsight.se
Ingenjörsvägen 3        http://www.netinsight.se
SE-117 43 STOCKHOLM     phone:+46-8-685 04 16
Sweden                  fax:  +46-8-449 22 40
			mob: +46-704-53 57 21
-
To Unsubscribe: send mail to majordomo at freiburg.linux.de
with "unsubscribe openbios" in the body of the message



More information about the openbios mailing list