This is the mail archive of the binutils@sourceware.org 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: labels, and values for mov instructions is gas


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


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