This is the mail archive of the binutils@sources.redhat.com mailing list for the binutils 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: ret value of bfd_get_sign_extend_vma



  But on other systems, and m68k is one, the cpu duplicates the topmost bit
of the 16-bit field into the upper (missing from the instruction) 16 address
bits.  So on these systems, 16-bit addresses 0x0000 to 0x7fff address 32-bit
range 0x00000000 to 0x00007fff, and 16-bit addresses 0x8000 to 0xffff
address 32-bit range 0xffff8000 to 0xffffffff.

So that means that if I access a 16 bit range from 0x7ff0 to 0x8010 I access two noncontiguous pieces of memory. Funny.


But bfd_get_sign_extend_vma returns 0 on m68k doesn't it?


That is to say, on some systems the reduced addressing mode allows you to access the lowest 64kb block at the bottom of memory; on others it allows you to access both the lowest 32kb and the highest 32kb of the 32-bit range.

  So yes, addresses are basically unsigned; but the behaviour here is the
same as takes place in sign extension, and it's a reasonable analogy if you
think of negative addresses as referring to the top end of the memory map.


cheers, DaveK


--

=== Michael Mueller ==================
Tel. + 49 8171 63600
Fax. + 49 8171 63615
Web: http://www.mm.kay-mueller.de
     http://www.planets.kay-mueller.de
======================================


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