Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories

Bug in nasm compiler??

During the writing of an assembler application in nasm I found out that if I put some data in the data segment for example 3 constants and I put some variables in the section bss than if i change the value for example of the first variable than the data in one of the constants from the data segment will be overwritten.
So I started debugging the program and figured out that the data segment and the bss segment will be mixed up.
I wrote a code that displays the offset address of the variables and constants stored in the data and bss segment and they're all mixed up and override each other.

If anybody has some idea what the problem could be or is interested ,I can post an example too. Thanks

Comments

  • shaolin007shaolin007 Member Posts: 1,018
    : During the writing of an assembler application in nasm I found out that if I put some data in the data segment for example 3 constants and I put some variables in the section bss than if i change the value for example of the first variable than the data in one of the constants from the data segment will be overwritten.
    : So I started debugging the program and figured out that the data segment and the bss segment will be mixed up.
    : I wrote a code that displays the offset address of the variables and constants stored in the data and bss segment and they're all mixed up and override each other.
    :
    : If anybody has some idea what the problem could be or is interested ,I can post an example too. Thanks
    :

    [green]
    I use NASM and I never use that .bss segment at all. To me it's not really necessary to use it since the data is never static and can be ovenridden. I usually declare my variables in the data segment as follows.
    [/green]

    [code]

    variable1 db 0 ;declare 1 byte

    array times 5 db 0 ; declare 5 byte array. kind of like 5 dup(0)
    [/code]

Sign In or Register to comment.