Code Segment (CS)

Cpu Memory Management Segmented Model


The code segment is a segment that stores the code data type of a program. Ie it stores the instructions being executed.

Next Instruction

The next instruction to be executed in the code segment is located by the following logical address:



More Instruction - Cycle.


Segment Selector

The segment selector that locate this segment is the CS segment register.


The CS register contains the segment selector for the code segment.

The CS register cannot be loaded explicitly by an application program. Instead, it is loaded implicitly by instructions or internal processor operations that change program control (such as procedure calls, interrupt handling, or task switching).

Discover More
Card Puncher Data Processing
Assembly - Text Section

Code segment (CS) (“text segment”, executable code) It defines an area in memory that stores the instruction codes. This is a fixed area. Nasm syntax: The declaration global _start defines the...
Card Puncher Data Processing
Instruction - Fetch

Fetch is a step in the the cycle of an instruction. The processor fetches instructions from the code segment, using a logical address that consists of: the segment selector in the CS register ...
Logical Address Segment
Memory Segment - Logical Address (pointers)

To address a byte in a segmented model, a program uses an address called a logical address Logical addresses are often referred to as pointers. where: Segment-register is a segment selector that...
Segment Register Init Flat Memory Model
Memory Segment - Segment Register

The segment registers (CS, DS, SS, ES, FS, and GS) hold 16-bit segment selectors To access a particular segment in memory, the segment selector for that segment must be present in the appropriate segment...

Share this page:
Follow us:
Task Runner