answersLogoWhite

0

What is stack segment?

Updated: 12/24/2022
User Avatar

Wiki User

14y ago

Best Answer

I will start with a small explanation. An object code genearated by a compiler or assembler by processing a source code file, is structured as blocks of data called segments, each contain a certain type of data. The types supported are the following. BSS or Block started by symbol, Text/code , data, heap and stack.

Data Segment - global and static data which are initialized to non-zero

BSS - global and static data which are initialized to zero

Heap - dynamically allocated variables

The above three are often referred together as data-segment

Text/Code - contains machine instructions / executable computer instructions

Stack - contains local/auto variables,which will be pushed in and popped out during the call to the function.

ang tinda ni cha bating na okuy ay masiramon..bakal na kamo!! tapos si chu ruben ay pasmado na kakakayo...nag niriwang na! tenk you..eyo man lang tabi.

User Avatar

Wiki User

14y ago
This answer is:
User Avatar

Add your answer:

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

What is the SP pointing register's default memory segment?

The default segment for SP (Stack Pointer) relative memory accesses in the 8086/8088 is SS (Stack Segment).


Write an algorithm to remove an item from the top of the stack?

It is not possible to write a code to POP from the stack when there is no your stack implementation information.Because of that I am going to talk more about Stack in computer architecture and there will be additional link to specific examples(-e).In x86 architecture there is three registers (BP, SP and SS) which are connected with stack and only SP and SS is needed.SS - Stack Segment (base register);SP - Stack Pointer (offset);This is how the POP instruction works:# operand = [SS:SP] (top of the stack) # SP = SP + 2; (change SP to point to new top element)


What is segment address?

A segment address is the contents of a segment register, CS, DS, ES, or SS. It is used after effective address generation to provide an offset in physical memory, by multiplying the segment register by 16 and then adding it to the effective address, giving a 20 bit address. This gives you addressability to 65536 segments of 65536 bytes, each separated by 16 bytes. The register used is usually implicit based on use; CS for code, DS for data, ES for certain string operations, and SS for stack. A segment override prefix can be used to select a different segment register.


What is the difference between register stacks and memory stacks?

Registers are normally memory spaces internal to the processor or very close to it. They are generally faster than main memory and will be small in size and will hold very frequently used data.Register stacks are a set of such register memory locations.Memory refers to computers main memory outside CPU. It is used to keep data and programs. Memory stack is a series of memory locations.The difference between register stack and memory stack is...


What is implicit stack?

A stack created by the user or a programmer is an implicit stack

Related questions

What is the SP pointing register's default memory segment?

The default segment for SP (Stack Pointer) relative memory accesses in the 8086/8088 is SS (Stack Segment).


Which segment is used to store interrupt and subroutine return address registers?

stack segment


Define the extra segment and stack segment?

The extra segment in the 8086/8088 is a 64kb region of memory that is indexed by the displacement address of the destination of certain string operations, relative to DI. Contrast that with the data segment, which is a 64kb region of memory that is indexed by the displacment address of the displacement of most operand addresses. The stack segment is similar, but it is used for stack oriented data, relative to SP or BP.


What is the example of segment register?

There are four segment registers on the 8086 and 8088. These are CS (code for code), DS (data segment), ES (extra data segment), and SS (stack segment).


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.


Which register can be changed directly using pop instruction in 8086?

stack segment register


How segment register are used?

The segment register in the 80806/8088 microprocessor contains the base address (divided by 16) of a region of memory. Since the register is 16 bits in size, there are 65,536 possible segment base addresses, ranging from 00000H to FFFF0H, in increments of 00010H.After address translation at the instruction level, the generated 16 bit offset is added to the selected segment register times 16 to generate a physical address between 00000H and FFFFFH. (If the offset and base go past FFFFFH, they wrap around back to 00000H.) Since the offset is also 16 bits in size, and since the overlap is only 4 bits (times 16), then each 64 kb segment overlaps by 16 bytes.There are four segment registers; CS, DS, ES, and SS, standing for Code Segment, Data Segment, Extra Segment, and Stack Segment.CS is used for opcode fetches. DS is used for normal data. ES is used for certain string operations as the destination address. SS is used for stack and frame (BP) data.The segment registers can be implicitly selected by context, or they can be explicitly selected with a segment prefix opcode.


How many base registers are there in 8086?

There are four base registers in the 8086/8088; Code Segment (CS), Data Segment (DS), Stack Segment (SS), and Extra Segment (ES).


How many segment can be directly addressed at a particular time by 8086 microprocessor?

There are four segment registers in the 8086/8088, Code Segment (CS), Stack Segment (SS), Data Segment (DS), and Extra Segment (ES). As a result, there are four segments that can be directly addressed at a particular time, i.e. without an extra instruction to reload a segment register.


What is the use of .stack .data in starting lines of 8086 programming?

.STACK reserves bytes in RAM memory for the stack (the place where the processor will keep function calls and parameters)..DATABelow the ".DATA" line you should declare (and optionally define) your variables, so the compiler reserves the corresponding RAM for each of them.Data works differently from stack, as the data segment will keep named values (the variables values) while the stack will not. The stack will grow as needed upto the maximum value defined in the .STACK directive.


Write an algorithm to remove an item from the top of the stack?

It is not possible to write a code to POP from the stack when there is no your stack implementation information.Because of that I am going to talk more about Stack in computer architecture and there will be additional link to specific examples(-e).In x86 architecture there is three registers (BP, SP and SS) which are connected with stack and only SP and SS is needed.SS - Stack Segment (base register);SP - Stack Pointer (offset);This is how the POP instruction works:# operand = [SS:SP] (top of the stack) # SP = SP + 2; (change SP to point to new top element)


What are the function of segment register?

The segment register in the 8086/8088 provide a base address for any memory access. There are four segment registers, CS - Code Segment, DS - Data Segment, SS - Stack Segment, and ES - Extra Segment. Each in used in the context of a particular instruction and contains the base address of the memory segment divided by 16. This allows the processor to access up to 1 MB of memory, though only in segments of 64 KB at a time.