Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Section .bss of Assembly code

Tags:

assembly

nasm

I am studying the book: Assembly Language Step By Step - Jeff Duntemann

Here is an example from this book:

Section .bss
    BUFFLEN equ 1024
    Buff: resb BUFFLEN

In the book .bss is explained as the uninitialised data portion of the code. However variable BUFFLEN is indeed initialised, isn't it? What is it that I am missing?

What is the meaning of initialised data in the context of Assembly?

like image 238
Koray Tugay Avatar asked Oct 12 '25 02:10

Koray Tugay


1 Answers

BUFFLEN will be a compile-time symbol with the said value of 1024. It will only temporarily be stored by NASM in its internal tables while compiling. It will nowhere be stored in the executable.

The section .BSS will not be stored in the executable as oppossed to the section .DATA
So initialised data in the context of Assembly is data that is present in the executable. It does not depend on the actual value of such data.

like image 152
Sep Roland Avatar answered Oct 15 '25 01:10

Sep Roland



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!