Questions tagged [data-segment]

54 questions
0
votes
1 answer

Can the stack and data segments on the x86 ever overlap?

I know that generally speaking data segments in x86 can overlap but can the stack and data segments overlap I am asking this cause generally they are quiet far from each other in illustration of data segments
0
votes
1 answer

Two data segments and 386 code in assembly

Well i'm writing a program, that have to print two strings from different data segments in screen. And i have to use 32-bit addresing mode for my program. .386 assume cs:codeSegment, ds:dataSeg1, es:dataSeg2, ss:stackSeg ; STACK SEGMENT…
davitp
  • 127
  • 2
  • 4
  • 14
0
votes
1 answer

Data Segment in Compiler Construction

i am developing a compiler for my own defined language , i have generated 3 address code and now i am going to develop a virtual machine which can run that 3 address code. but for that i need Data Segment (where i can store all of my variables…
Haider Ali
  • 800
  • 2
  • 9
  • 22
0
votes
1 answer

How to change data segment? What am I doing wrong?

I am developing a 32 bit OS and have developed a working ELF loader that works just fine. Now I do not have paging enabled (I plan to later, but right now I am just trying to load kernel modules) and I am trying to execute modules at boot. Basically…
user1454902
  • 750
  • 9
  • 24
-1
votes
1 answer

Where the nested function's body kept?

Please check the following code, #include #include void* make_adder_function(int a) { char str[64] ={}; sprintf(str,"this function adds %d with input",a); void adder(int b) { int x = a; char…
-1
votes
1 answer

Assembly Language Memory Operand

I'm using emu8086 to learn Assembly language. I have a question that says: Convert the following to code snippet to Assembly Language code: a = 0 Do i initialize the variable a as the decimal ascii code 48(which has a character value of 0)? a db…
Reeyona
  • 49
  • 1
  • 1
  • 8
-3
votes
1 answer

What is the output of this code, array and pointers

I have a few questions regarding the code below. If I have a pointer of some type, what does it mean to use array indexing with it? in this example, what does ptr[3] stand for (ptr is a pointer of some type)? The output of the program is supposed…
user574362
  • 67
  • 1
  • 7
-5
votes
3 answers

Printing character array in C

I know I am supposed to put '/o' at end of character array but When I want to print "printf ("%s\n", kk);" , it gives "abcdepqrst". Why is this happening? This is the program I am executing. #include int main() { char…
Aditya Varma
  • 330
  • 6
  • 16
-7
votes
6 answers

Can I free pointer address without malloc?

Let's suppose this code: int i,j=0; char* block = (char*) (0x9000); char table[4]= {0x01,0x02,0x03,0x04}; for (i=0; i< 45567; i++) { *(block +i)= table[j]; j++; if (j==4) j=0; } I would like to ask: Is the memory for block…
Zero_One
  • 31
  • 2
  • 3
1 2 3
4