On 02/17/2012 11:34 AM, Peter Bigot wrote:
> A couple lines are commented out because the current assembler won't
> process them, something I consider to be a bug.  I would be interested in
> knowing if other tools accept $ as denoting the program location counter in
> contexts other than jump instructions, and if so whether it means the
> beginning of the instruction or the address of the offset encoded internal
> to the instruction.

I usually use . for the current location.

 jmp .
 jmp .+0
 jmp .+2
 jmp .+0x100

produces:

  44:   ff 3f           jmp     $+0             ;abs 0x44
  46:   ff 3f           jmp     $+0             ;abs 0x46
  48:   00 3c           jmp     $+2             ;abs 0x4a
  4a:   7f 3c           jmp     $+256           ;abs 0x14a


Looking at the documentation (info gas) in machine dependencies it says:

   The character `$' in jump instructions indicates current location and
implemented only for TI syntax compatibility.


So I would say that using $ in the mov instructions shouldn't be
expected to work but that the implementation for using $ in jumps is
messed up.

Digging into the source (not the appropriate version but what I recently
grabbed while playing with things ARM Cortex-M4, aka 2.22.51) it looks
like this is in tc-msp430.c. At least I find the error message
"instruction requires label sans '$'" there.

But I have never dug down into the internals of gas so things get murky
after this. I do see a fixup of the offset that specifically excludes zero.

              if ((*l1 == '$' && x > 0) || x < 0)
                x -= 2;



-- 
David W. Schultz
http://home.earthlink.net/~david.schultz
"Who? What? Where? When? Aahhhg!" - Duck Dodgers

------------------------------------------------------------------------------
Virtualization & Cloud Management Using Capacity Planning
Cloud computing makes use of virtualization - but cloud computing 
also focuses on allowing computing to be delivered as a service.
http://www.accelacomm.com/jaw/sfnl/114/51521223/
_______________________________________________
Mspgcc-users mailing list
Mspgcc-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mspgcc-users

Reply via email to