[Subject Prev][Subject Next][Thread Prev][Thread Next][Subject Index][Thread Index]
Re: linux assembly
> .text
>
> BOOTSEG =0x07c0
> .globl main
> .type main,@function
> main:
> mov %ax,BOOTSEG
>
> ////////////////////////////////////////////////
>
> In the above code I am just trying to move the BOOTSEG value to ax
> register
> 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 "as" assembler uses the AT&T syntax instead of the intel
syntax. The major difference between the two is that in at&t, the first
argument to mov is source and the second is the destination - opposite to
intel convention.
I guess the reason why this coredumps is that it tries to write
contents of ax to BOOTSEG in ds, which causes coredump.
Regards,
Kedar.
----------------------------------------------------------------
Kedar N. Patankar.
Senior Software Engineer.
ishoni Networks
...Broadband for everyone
http://www.ishoni.com
email - kedar@xxxxxxxxxx
Phone: +91-80-2292125 (Work)
Fax: +91-80-2995545 (Work)
----------------------------------------------------------------
Don't worry over what other people are thinking about you.
They're too busy worrying over what you are thinking about them.