Questions tagged [data-segment]
54 questions
0
votes
1 answer
what's the utility of bss segment?
I know that bss segment contains uninitialized variables which will be given 0 as initial value,but why we don't just use the data segment to store them?
I read that it speed up execution because the os loader initialize all these variables at once…

Amine Hajyoussef
- 4,381
- 3
- 22
- 26
0
votes
0 answers
Create clusters of data points having similar relationships in two columns
The link given has a dataset with attributes village_code and delta_progress. delta_progress are nothing but slopes after plotting graphs. I want to create clusters of village_code based on these delta_progress and total_progress columns; by using…

andy_H
- 13
- 3
0
votes
1 answer
CRC16 generation function - Error C195 illegal indirection
I am trying to implement CRC16 function into my code. When I try to compile it gives me an error:C195 "illegal indirection" on Keil. Any guidance on the matter would be greatly appreciated!
unsigned char *puchMsg ; /* message to calculate…

ruggeinstein
- 23
- 8
0
votes
0 answers
Assembly Calculating location of variables
MYDATA SEGMENT
ARRAY DD 30 DUP(?)
MESSAGE DB 'Hello World$'
BA DD MESSAGETWO
MYDATA ENDS
DATASECOND SEGMENT
HELLO DB 20 DUP(?)
MESSAGETWO 'I AM ASSEMBLY$'
DATASECOND ENDS
The Physical address of MYDATA is 19AC0h
What is the offset of…

CodeCop
- 1
- 2
- 15
- 37
0
votes
2 answers
Is there a C function to get the size of a file's data segment?
I'm wondering if there's a C function that can be used to get another executable file's data segment size? For example, something that works like the size utility in Linux? The output of size includes the information I'm after, the data segment…

justin
- 161
- 6
0
votes
1 answer
Impact of sticky service in an application with huge monolith code base in Android?
As we all know,Java memory model consists of data (or code), stack and heap segments. I presume that the same is the case with Android. I have a single monolith application (let's consider the code base of this application to be too huge). When I…

Tom Taylor
- 3,344
- 2
- 38
- 63
0
votes
1 answer
Memory allocation for Data segment not happening properly for each static and global(uninitialized/ initialized variable)
I am trying to understand how memory allocation works for any C code which is executed or compiled.
I have written following 5 separate small codes which will help me understand the memory allocation process.
segment_size1.c
int main(){
…

pratik
- 1
- 2
0
votes
2 answers
Identifying data segment in Win32/Win64
I am a DLL loaded in the memory space of some process. I am part of a number of DLLs that are present in this process, some loaded dynamically and some statically.
There is a "data gem" left for me to discover somewhere in this process's space and…

user40966
- 115
- 1
- 2
- 5
0
votes
1 answer
Allocate Static Shared Memory using MapViewOfFile
How can I allocated shared memory to a static buffer like the following but using CreateFileMapping and MapViewOfFile.
#pragma data_seg(".ABC")
__declspec (dllexport) char buffer[10000] = {0};
#pragma data_seg()
#pragma comment(linker,…

user3716892
- 101
- 7
0
votes
1 answer
Can an allocator use the uninitialized data segment to satisfy heap requests if needed?
I'm new to C, and I am confused about what allocator can do in C.
Just as the title asked, Can an allocator use the uninitialized data segment to satisfy heap requests if needed?

YINGYING
- 47
- 5
0
votes
2 answers
Setting a constant in rodata
I am trying to understand how to set the value of a string in the rodata segment as loading it using an environment variable gives me issues.
I want to externally set a constant string in the rodata section. This function should be independent of…

LockStock
- 199
- 12
0
votes
1 answer
Data segment during execution of program
Doubt:
If we execute a program, the following is the type of memory allocated to that program.
__________________
| |
…

mohangraj
- 9,842
- 19
- 59
- 94
0
votes
2 answers
intel to ATT assembley conversion for reading data segment of BIOS
What will be the equivalent ATT code for the following intel code:
BIOS segment byte at 40h
org 13h
memory dw ?
BIOS ends

Alex
- 11
- 2
0
votes
1 answer
C data segment identification
If I declare
static int a ;// globally and
static int a ; // locally in one function
So now there are two instances of a ..
I know all static variables goes into data segment but how they are differentiated in data segment which one is local…

user3706789
- 87
- 1
- 7
0
votes
1 answer
Using data segment
I'm currently writing a program that writes 20 first fibonacci numbers. What I'm currently asking is if this thing can be possibly done:
MOV DS, 3000H
MOV SI, 4000H
MOV DL, 123
MOV CL, 5
MOV DS:[SI+CL], DL
(This is just a general code that has…

HelloWorld
- 1,128
- 1
- 7
- 14