answersLogoWhite

0


Best Answer

A code segment, also known as the text segment holds all the executable instructions of the process. The text segment usually starts from the lowest address space of the process memory (leaving behind a small unmapped memory ..not mapped to a physical memory)

--Vivek Purushotham

(vivek.purushotham@gmail.com)

User Avatar

Wiki User

βˆ™ 16y ago
This answer is:
User Avatar

Add your answer:

Earn +20 pts
Q: What is Code segment in C program?
Write your answer...
Submit
Still have questions?
magnify glass
imp
Continue Learning about Engineering

What type of a program is used in order to enter c source code?

What type of a program is used in order to enter C source code


What is the meaning of near and far declaration in microprocessor programming using C?

Programs that are loaded into memory typically have several segments associated with them: the Code Segment (CS), the Stack Segment (SS), the Data Segment (DS), sometimes an Extended Segment (ES), and almost always a Block Started by Symbol (BSS) segment. This question requires that we focus only on the Code Segment (CS). The CS is a segment of memory that contains some of the instructions that are required for the program to execute. If this segment is not large enough to contain the whole program then the program can be loaded into different segments. Such a segment may be 64Kb in size (although the size may differ). Instructions located in these segments are referred to by their offset from the start of the segment, and not by their absolute location in memory. Thus, in order to locate a certain instruction, we need the segment's starting address, and the offset of the instruction in that segment. Whenever a branch (jump, goto) takes place which refers to an instruction that is located in another segment, it is known as a far jump, conversely whenever a jump refers to an instruction that is located in the same segment, it is known as a near jump. The difference referring to the modication of the CS register which contains the address of the current Code Segment for the current running program.


What is data segment memory and code segment memory?

Code Segment, in which all the application code is stored Data Segment, that holds the global data


C program to print its own code?

You are referring to a quine


Is a left brace in a c program always followed by a right brace later in the program?

Yes. Braces are used to group similar pieces of code in a C program

Related questions

What is code segments in assembly program?

brief note about code segment


C code for magic square?

the way of learning c program


What translator is needed for C programming language?

To translate the C source code program, you need a program called a "C compiler".


What type of a program is used in order to enter c source code?

What type of a program is used in order to enter C source code


What is the meaning of near and far declaration in microprocessor programming using C?

Programs that are loaded into memory typically have several segments associated with them: the Code Segment (CS), the Stack Segment (SS), the Data Segment (DS), sometimes an Extended Segment (ES), and almost always a Block Started by Symbol (BSS) segment. This question requires that we focus only on the Code Segment (CS). The CS is a segment of memory that contains some of the instructions that are required for the program to execute. If this segment is not large enough to contain the whole program then the program can be loaded into different segments. Such a segment may be 64Kb in size (although the size may differ). Instructions located in these segments are referred to by their offset from the start of the segment, and not by their absolute location in memory. Thus, in order to locate a certain instruction, we need the segment's starting address, and the offset of the instruction in that segment. Whenever a branch (jump, goto) takes place which refers to an instruction that is located in another segment, it is known as a far jump, conversely whenever a jump refers to an instruction that is located in the same segment, it is known as a near jump. The difference referring to the modication of the CS register which contains the address of the current Code Segment for the current running program.


What is the compiler that is used in C?

A program that translates source program into object code.


What is the difference between program and data memory?

When the program is compiled and linked different parts of the program is organised in separate segments. That is our code will be in one segment code means the instructions to be executed this is called as code segment or program memory this is usually readonly. Then there are data which on which the code operates,these data get stored in a segment called data segment. Stack memory is a part of programs memory which will be used as stack in case of function calls to store the IP and parameters variables of the current function. The three types of memory specified above are owned by the corresponding process or program the linker will give info abt where to store which data to the loader, based on these infos loader will load the corresponding image i.e executable in the memory.


What is data segment memory and code segment memory?

Code Segment, in which all the application code is stored Data Segment, that holds the global data


C program to print its own code?

You are referring to a quine


Is a left brace in a c program always followed by a right brace later in the program?

Yes. Braces are used to group similar pieces of code in a C program


Why c program runs faster then java program?

The main reason for this is that C code compiles down to native machine code. Java bytecode needs to be run in the JVM, which may or may not compile it down to native code.


What are the different types of segment register?

The code segment (CS) register is used for access to program code. The data segment (DS) register is used for access to data. The extra segment (ES) register is used for access to data during certain string primitive operations. The stack segment (SS) register is used for access to stack data.Any of these implied uses can be overridden with a segment override prefix opcode.