X-Authentication-Warning: delorie.com: mail set sender to djgpp-bounces using -f From: Rugxulo Newsgroups: comp.os.msdos.djgpp Subject: Re: GAS ".code16" and DJASM quirks ... Date: Wed, 11 Nov 2009 13:03:03 -0800 (PST) Organization: http://groups.google.com Lines: 47 Message-ID: <089759ff-13d5-46d2-832d-b330d3ed3dca@v25g2000yqk.googlegroups.com> References: <0008cd2e-63c9-43cb-82d4-11aece7c209f AT c3g2000yqd DOT googlegroups DOT com> NNTP-Posting-Host: 65.13.115.246 Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable X-Trace: posting.google.com 1257973383 5753 127.0.0.1 (11 Nov 2009 21:03:03 GMT) X-Complaints-To: groups-abuse AT google DOT com NNTP-Posting-Date: Wed, 11 Nov 2009 21:03:03 +0000 (UTC) Complaints-To: groups-abuse AT google DOT com Injection-Info: v25g2000yqk.googlegroups.com; posting-host=65.13.115.246; posting-account=p5rsXQoAAAB8KPnVlgg9E_vlm2dvVhfO User-Agent: G2/1.0 X-HTTP-UserAgent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.1.5) Gecko/20091102 Firefox/3.5.5 (.NET CLR 3.5.30729),gzip(gfe),gzip(gfe) To: djgpp AT delorie DOT com DJ-Gateway: from newsgroup comp.os.msdos.djgpp Reply-To: djgpp AT delorie DOT com Hi, On Nov 11, 2:48=A0am, Martin Str|mberg wrote: > > How do you link? If you use GNU ld you need to mess with linker scripts. > I've written small .com files using gas and ld. I've also recoded > FDXMS using gas and ld. > > I remember it was hard to get rid of the extra zeroes before the real > code. (Bug in ld, perhaps?) I think I just skipped .org 0x100 and > instead used nothing or .org 0 and let ld with the correct script deal > with it. > > If you wait and are lucky I might dig up some of what I've written. No hurry, esp. since I already have FDXMS. (My only complaint is AT&T, ugh.) http://www.ibiblio.org/pub/micro/pc-stuff/freedos/files/dos/fdxms/ Quoting from makefile : LD =3D ld -T link_script --oformat binary -Map $*.map -s link_script : =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D SECTIONS { .text 0 : { *(.text) etext =3D . ; _etext =3D .; } .data : { *(.data) edata =3D . ; _edata =3D .; } .bss SIZEOF(.data) + ADDR(.data) : { *(.bss) *(COMMON) end =3D . ; _end =3D .; } } =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D