Segmented Memory Organization - 3.2 | Experiment No. 4: Introduction to 8086 Microprocessor - Architecture and Addressing Modes | Microcontroller Lab
K12 Students

Academics

AI-Powered learning for Grades 8–12, aligned with major Indian and international curricula.

Professionals

Professional Courses

Industry-relevant training in Business, Technology, and Design to help professionals and graduates upskill for real-world careers.

Games

Interactive Games

Fun, engaging games to boost memory, math fluency, typing speed, and English skills—perfect for learners of all ages.

Interactive Audio Lesson

Listen to a student-teacher conversation explaining the topic in a relatable way.

Introduction to Segmented Memory Organization

Unlock Audio Lesson

Signup and Enroll to the course for listening the Audio Lesson

0:00
Teacher
Teacher

Today we'll explore the segmented memory organization of the 8086 microprocessor. Can anyone tell me what a segment is?

Student 1
Student 1

Is it a part of the memory that holds data or instructions?

Teacher
Teacher

Great! Each segment can hold up to 64 KB of data and starts at an address that is divisible by 16, which is also known as a paragraph boundary. This allows the processor to manage memory more efficiently.

Student 2
Student 2

Why is it important for the address to be divisible by 16?

Teacher
Teacher

Good question! By ensuring segment starts align with specific boundaries, it optimizes memory access and helps prevent fragmentation.

Student 3
Student 3

So how does the 8086 calculate the real addresses?

Teacher
Teacher

The calculation combines a segment value from a segment register with an offset. Let’s remember this with the acronym 'PO', which stands for 'Physical Address = Offset + Segment'.

Student 4
Student 4

Does that mean the offset can change?

Teacher
Teacher

Exactly! The offset can vary, allowing access to different locations within the segment. Remember that physical addresses are crucial for pointing to actual memory locations.

Student 1
Student 1

Can we see an example of this?

Teacher
Teacher

Absolutely! For instance, if a segment register equals 2000H and the offset is 0050H, what will be the physical address?

Student 2
Student 2

Is it 20050H?

Teacher
Teacher

Well done! This demonstrates how to calculate a physical address.

Understanding Addressing Modes

Unlock Audio Lesson

Signup and Enroll to the course for listening the Audio Lesson

0:00
Teacher
Teacher

Next, let’s discuss addressing modes. They define how we compute the effective address of an operand. Who can name any addressing modes?

Student 3
Student 3

We learned about immediate addressing in class!

Teacher
Teacher

Correct! Immediate addressing mode uses the operand directly in the instruction. For example, 'MOV AX, 5000H' puts 5000H directly into AX.

Student 4
Student 4

What about register addressing?

Teacher
Teacher

Great point! In register addressing mode, the operand resides in a register. For instance, 'MOV AX, BX' copies the value from BX to AX. It is fast because no memory access is required.

Student 1
Student 1

Can you explain direct addressing mode?

Teacher
Teacher

Sure! In direct addressing mode, the effective address is directly specified, for example, 'MOV AX, [1234H]'.

Student 2
Student 2

What about the indirect modes?

Teacher
Teacher

Excellent! Modes like register indirect and based addressing leverage registers to point to addresses. They help in accessing data more flexibly. Let's remember: 'BIR', which stands for Based and Indirect Register modes.

Student 3
Student 3

I want to know more about indexed addressing.

Teacher
Teacher

Indexed addressing uses an index register to modify an address. For instance, 'MOV AL, [SI + 20H]' retrieves data with an offset based on the index. This is especially useful for working with arrays.

Student 4
Student 4

Can we recap what we’ve learned?

Teacher
Teacher

Sure! Addressing modes allow us to access data efficiently. Remember: Immediate, Register, Direct, Indirect, Based, Indexed, and their combinations are key in assembly programming.

Practical Applications of Addressing Modes

Unlock Audio Lesson

Signup and Enroll to the course for listening the Audio Lesson

0:00
Teacher
Teacher

Now let’s dive into some practical applications of these addressing modes. Would anyone like to provide a scenario?

Student 2
Student 2

Could we use immediate addressing in a termination code?

Teacher
Teacher

Exactly! The instruction 'MOV AX, 4C00H' is commonly used for terminating a program. It directly uses an immediate value.

Student 3
Student 3

What about accessing array values?

Teacher
Teacher

Good thinking! For an array, we often use indexed addressing modes. For instance, loading the third element of an array could use 'MOV AL, ARRAY[SI + 2]'.

Student 1
Student 1

And with register indirect, how do we shift data?

Teacher
Teacher

Right on! Using 'MOV AX, [BX]' allows you to load data indirectly using the offset based in BX. This approach is adaptable for manipulating dynamic data.

Student 4
Student 4

Could you explain how based addressing can help with structures?

Teacher
Teacher

Certainly! For data structures, based addressing allows accessing fields by adding offsets to a base register, enabling organized access to structured data.

Student 2
Student 2

What should we remember about the use of these modes in programming?

Teacher
Teacher

Focus on how each addressing mode suits specific tasks in programming to optimize efficiency. Always relate the mode to its context - 'Where you are points to how you access!'

Student 3
Student 3

Thanks for the insights. I feel more confident now!

Teacher
Teacher

You're all doing great! Keep these modes in mind as you explore assembly language further.

Introduction & Overview

Read a summary of the section's main ideas. Choose from Basic, Medium, or Detailed.

Quick Overview

The section focuses on the 8086 microprocessor's segmented memory organization, detailing its architecture and addressing modes.

Standard

In this section, we explore the segmented memory organization of the 8086 microprocessor, discussing the calculation of physical addresses and the various addressing modes that enable efficient data access in assembly language programming.

Detailed

Segmented Memory Organization

The Intel 8086 microprocessor features a unique architecture where its 1 MB of physical memory is divided into logical segments. This system allows each segment to be up to 64 KB in size and requires segments to start at memory addresses that are multiples of 16.

Physical Address Calculation

To access any point in memory, the 8086 utilizes a combination of a segment address from a segment register and an offset address, calculated as:

Physical Address = (Segment Register Value * 10H) + Offset Address

This means that a 20-bit physical address is derived from the 16-bit segment value shifted left by four bits, thus enhancing the ability to utilize the larger memory effectively. An example provided shows how to calculate a physical address using segment values and offsets, illustrating the practical application of this concept.

Addressing Modes

The 8086 processor supports various addressing modes that dictate how the effective address of an operand is determined, including:
1. Immediate Addressing Mode: Operand included in the instruction.
2. Register Addressing Mode: Operand located in a register.
3. Direct Addressing Mode: Offset specified in the instruction directly.
4. Register Indirect Addressing Mode: Effective address in a pointer or index register.
5. Based Addressing Mode: Adds a displacement to the base register's contents.
6. Indexed Addressing Mode: Combines an index register with a displacement.
7. Based-Indexed Addressing Mode: Combines base and index registers, plus an optional displacement.
8. String Addressing Mode: Implicit use with string manipulation instructions.

In conclusion, this section succinctly covers the fundamental concepts behind segmented memory organization and the implications of addressing modes, which are crucial for understanding the assembly language programming for the 8086 microprocessor.

Audio Book

Dive deep into the subject with an immersive audiobook experience.

Overview of Segmented Memory

Unlock Audio Book

Signup and Enroll to the course for listening the Audio Book

The 8086's 1 MB physical memory is divided into logical segments. Each segment can be up to 64 KB in size and starts at an address divisible by 16 (a paragraph boundary). This segmentation allows for flexible memory management, protection, and allows a 16-bit register to access a larger memory space.

Detailed Explanation

The 8086 microprocessor organizes its memory in a unique way called 'segmented memory'. This means that the 1 Megabyte of memory is divided into smaller parts called segments. Each segment can hold up to 64 Kilobytes. The segments start at specific points in memory that are always multiples of 16. This design helps the microprocessor manage memory efficiently by allowing the same address space to be shared by different programs, ensuring better memory protection and organization. By using just 16-bit registers, it can still access a big memory space, which might usually require larger registers.

Examples & Analogies

Imagine a large library (the entire memory) that is divided into many sections (segments). Each section has a certain number of shelves (64 KB) and these sections are organized in such a way that they start at specific points (multiples of 16), making it easy for the librarian (the microprocessor) to find and manage the books (data) within. This organization allows the librarian to maintain order and quickly access any section they need without getting lost.

Physical Address Calculation

Unlock Audio Book

Signup and Enroll to the course for listening the Audio Book

A 20-bit physical address is generated by combining a 16-bit segment address (from a segment register) and a 16-bit offset address (from a general-purpose register, pointer, or index register, or immediate value). The formula for physical address calculation is:

Physical Address = (Segment Register Value * 10H) + Offset Address
Or, equivalently:
Physical Address = (Segment Register Value << 4) + Offset Address

Detailed Explanation

To access a specific location in memory, the 8086 processor calculates a physical address using a combination of two values: a segment address and an offset address. The segment address is taken from the segment registers, which point to the start of a segment, while the offset indicates how far into the segment to look. The calculation can be done using a couple of methods. One method is multiplying the segment register value by 16 (which is the same as shifting it left by 4 bits) to get a base physical address and then adding the offset to this base address to obtain the final physical address.

Examples & Analogies

Think of the physical address calculation like finding a specific book in a library. The segment address is like the section where the book is located, and the offset is like the specific shelf and position of that book within that section. If you know the section (segment address), you can quickly reach the right part of the library, and then by looking at the shelf number (offset), you can find the exact book you're looking for.

Numerical Example

Unlock Audio Book

Signup and Enroll to the course for listening the Audio Book

If DS (Data Segment) = 2000H and the offset address for a variable is 0050H.

Physical Address = (2000H * 10H) + 0050H
Physical Address = 20000H + 0050H
Physical Address = 20050H
This means the actual memory location accessed is 20050H.

Detailed Explanation

Let's calculate an actual physical address using a real example. If the Data Segment (DS) register contains the value 2000H and we want to access a variable that is located at an offset of 0050H, we first need to multiply the segment value by 16 (or shift left by 4 bits). So 2000H multiplied by 10H equals 20000H. Then we add the offset, 0050H, which gives us a result of 20050H. Therefore, when the program wants to access data at this segment with the specified offset, it actually accesses the memory location 20050H.

Examples & Analogies

Using the library analogy again, if the section (segment) for a book is specified as being on the 2000th shelf, and the book is located at the 50th spot on that shelf, you'd move from the start of that section to the 2000th location and then look for the book at position 50. So in memory, just like in the library, you have to know your starting point (the shelf number) and then how far to go to find what you need.

Default Segment Registers

Unlock Audio Book

Signup and Enroll to the course for listening the Audio Book

The default segment register for different types of memory access are:
● Code Segment (CS): Points to the segment where the currently executing program instructions are located. Offset is provided by IP (Instruction Pointer).
● Data Segment (DS): Points to the segment where most data is stored. Default offset from general purpose registers like BX, SI, DI, or direct addresses.
● Stack Segment (SS): Points to the segment where the program stack is located. Default offset from SP (Stack Pointer) or BP (Base Pointer).
● Extra Segment (ES): An additional data segment, often used for string operations.

Detailed Explanation

Each type of memory access in the 8086 microprocessor uses a specific segment register, which helps the processor understand where to find various types of data. The Code Segment (CS) is used to find and execute the program instructions. The Data Segment (DS) is where most of the variables or data are stored. The Stack Segment (SS) points to where the stack memory is located, which is important for managing temporary data during program execution. Lastly, the Extra Segment (ES) is used for additional data operations, particularly when dealing with strings. Understanding these registers is crucial for proper memory management in 8086 programming.

Examples & Analogies

Continuing with the library analogy, you can think of different sections of the library as specialized areas. The Code Segment is like the reference section where instructions or guides (program instructions) are located. The Data Segment is where most of the books (data) are located, while the Stack Segment is a special area where you keep the most recently used books to quickly access them (like a temporary pile). The Extra Segment serves as an additional area where you can keep extra materials for specific projects or topics, making it easier to find what you need.

Definitions & Key Concepts

Learn essential terms and foundational ideas that form the basis of the topic.

Key Concepts

  • Segmented Memory: Allows the 8086 microprocessor to organize memory into logical segments for efficient management.

  • Physical Address Calculation: Combines segment and offset values to derive the effective address in memory.

  • Addressing Modes: Various methods that define how the locations of operands are calculated for efficient data access.

Examples & Real-Life Applications

See how the concepts apply in real-world scenarios to understand their practical implications.

Examples

  • Immediate Addressing Example: 'MOV AX, 5000H' directly loads 5000H into the AX register.

  • Register Indirect Addressing Example: 'MOV AX, [BX]' uses the contents of BX as the address to get data.

Memory Aids

Use mnemonics, acronyms, or visual cues to help remember key information more easily.

🎵 Rhymes Time

  • In segments we abide, for memory is wide; 64 KB we will store, keeping our data galore!

📖 Fascinating Stories

  • Imagine a library where each section (segment) holds hundreds of books (data). The librarian (processor) knows how to get to any book using codes (addresses).

🧠 Other Memory Gems

  • Remember 'S.P.A.C.E.' - Segments Provide Access per Calculation of Every address!

🎯 Super Acronyms

Use 'P.O.N.D' for Physical OR offset + segment for calculating addresses.

Flash Cards

Review key concepts with flashcards.

Glossary of Terms

Review the Definitions for terms.

  • Term: Segment

    Definition:

    A logical division of memory that can address up to 64 KB and starts at a memory address divisible by 16.

  • Term: Addressing Mode

    Definition:

    A method used to specify where an operand is located in memory, affecting how instructions access data.

  • Term: Physical Address

    Definition:

    The actual location in memory that results from combining a segment address and an offset.

  • Term: Immediate Addressing

    Definition:

    An addressing mode where the operand value is specified directly within the instruction.

  • Term: Register Addressing

    Definition:

    An addressing mode where the operand is stored in one of the processor's registers.

  • Term: Direct Addressing

    Definition:

    An addressing mode where the effective address is specified directly in the instruction.

  • Term: Register Indirect Addressing

    Definition:

    An addressing mode where the effective address is provided through a pointer register.

  • Term: Based Addressing

    Definition:

    An addressing mode where a base register's contents are combined with a displacement to form the effective address.

  • Term: Indexed Addressing

    Definition:

    An addressing mode that uses an index register combined with a displacement to access data.

  • Term: String Addressing

    Definition:

    An addressing mode used in string manipulation instructions, implicitly using source and destination indices.