Re: varibles define

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Definition in .text will stay in .text at the same position you defined it.
Of course when the code is executed the cpu doesn't know at all that
he is reading a string for example or an executable code

You can do this:

...execution flow started...
jmp lb1:                                    // jump to avoid the cpu
to interpret the variable definition as code
mystrind db "hello world!", 0h      // definition of a variable here
lb1:
....execution flow continues here

else the best is to store you data after the exit of the program

Never do something like this below:

some instruction
some instruction
mystring db "Hello world!", 0h  // definition here
some instruction

In the example above the hexa version of "hello world!",0h will be
read and executed by the cpu and it is not what we want

regards,

Sofiane Akermoun
sofiane.akermoun@xxxxxxxxxxxxxxxxxxx
akersof@xxxxxxxxx

2013/2/13 horseriver <horserivers@xxxxxxxxx>:
> hi:)
>
>    If define a byte in .text. then ,does this byte located into .data section in object file?
>
> thanks!
> --
> To unsubscribe from this list: send the line "unsubscribe linux-assembly" in
> the body of a message to majordomo@xxxxxxxxxxxxxxx
> More majordomo info at  http://vger.kernel.org/majordomo-info.html



-- 
Sofiane AKERMOUN
akersof@xxxxxxxxx
--
To unsubscribe from this list: send the line "unsubscribe linux-assembly" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Kernel Newbies]     [Security]     [Linux C Programming]     [Linux for Hams]     [DCCP]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux Admin]     [Samba]     [Video 4 Linux]

  Powered by Linux