labels, and values for mov instructions is gas

Ian Lance Taylor iant@google.com
Fri Nov 9 16:40:00 GMT 2007


Brian Beardall <brian@rapsure.net> writes:

> .arch i8086
> .code16
> 
> .text
> foo:
>   mov $exit,%ax
>   mov $10,%cx
>   loop foo
> exit:
>   int $0x80
> dumb:
>    .int 5,5,3,2,1,2,4,2,3,4,3,2,1,5
> again:
>   .word 1,2,3,4,5,6,7
> .equ help, 5
> 
> 
> With this code I need the address that is at the label exit moved into
> the ax register. Right now all I get is 0x0000 moving into the ax
> register. How might I go about getting the correct address into ax
> without doing a as -a -o test.o test.asm , and looking at the symbol
> table, and manually entering the value?

You need to run the linker on the output of the assembler.

Ian



More information about the Binutils mailing list