[Subject Prev][Subject Next][Thread Prev][Thread Next][Subject Index][Thread Index]

linux assembly


BOOTSEG =0x07c0
.globl main
       .type main,@function
    mov %ax,BOOTSEG


In the above code I am just trying to move the BOOTSEG value to ax
If i am right the "as" assembler follows source destination sequence
unlike TASM,  I have even tried the alternative sequence
The above piece of code is giving  a core dump with SIGSEGV
(Segmentation fault)
The above code was compiled using the "as" assembler and the" ld" linker

Commands for creating the object was         as -a --gstabs -o
filename.o filename.s
Commands for creating the executable was   ld -m elf_i386 -static
/usr/lib/crt1.o /usr/lib/crti.o -lc filename.o /usr/lib/crtn.o

Can anyone point whats wrong with this program

Rakesh Agarwal
Systems Engineer
Wipro Tecnologies
72, Electronics City
91-80-8520408 Extn-1158