Lec-10: Unconditional Branching in 8085 | Microprocessor

Gate Smashers
16 Jun 202306:29

Summary

TLDRThis video script discusses the concept of unconditional branching in the 8085 microprocessor. It explains how the processor executes instructions sequentially unless a jump is required, which is determined without checking conditions. The script delves into the assembly language instructions like JMP, CALL, and RET, illustrating how they direct the flow of execution to specific memory addresses. It also touches on the addressing modes, particularly Immediate and Direct, and their impact on instruction size and execution. The explanation is technical, aimed at individuals with a background in computer architecture or programming.

Takeaways

  • 😀 The video explains the concept of unconditional branching in the 8085 microprocessor.
  • 📝 Unconditional branching means that the microprocessor will jump to a specific address without checking any conditions.
  • 🔄 The instruction 'JMP' is used for unconditional branching, which directs the control to a particular address immediately after execution.
  • 💡 The term 'LRET' is discussed, which stands for long return and is used in conjunction with 'JMP' to handle function calls and returns.
  • 🔢 The size of the instruction in the 8085 microprocessor is detailed, with 'JMP' being 3 bytes and 'CALL' being 3 bytes, while 'RET' is only 1 byte.
  • 📍 The difference between direct and immediate addressing modes is highlighted, with examples provided for each.
  • 🚀 The video script uses the term 'IMMEDIATE' to describe the addressing mode where the jump is made directly to the address specified in the instruction.
  • 💼 The concept of function calls and returns is explained, with emphasis on how control is transferred to the function and then back to the calling location.
  • 🔧 The script provides a detailed breakdown of how the program counter is updated during the execution of branching instructions.
  • 🧩 The video concludes with a discussion on addressing modes, clarifying that the direct addressing mode is not used for 'JMP' instructions as no data is copied from the address.

Q & A

  • What does the term 'unconditional branching' mean in the context of the 8085 microprocessor?

    -Unconditional branching refers to the process where the microprocessor jumps to a specific address without checking any conditions, regardless of whether the condition is true or not.

  • What is the significance of the instruction 'JMP' in the 8085 assembly language?

    -The 'JMP' instruction in 8085 assembly language is used to jump to a specified memory location, effectively changing the sequence of instruction execution to that location.

  • What does the term 'LDA' stand for in the context of the 8085 microprocessor?

    -In the context of the 8085 microprocessor, 'LDA' stands for 'Load Accumulator', which is an instruction that loads data from a specified memory address into the accumulator.

  • What is the purpose of the 'CALL' instruction in the 8085 microprocessor?

    -The 'CALL' instruction in the 8085 microprocessor is used to initiate a function call, transferring control to a new location in memory where the function is defined, and saving the return address for later use.

  • How does the 'RET' instruction work in the 8085 assembly language?

    -The 'RET' instruction in 8085 assembly language is used to return from a function or interrupt, typically after the function has completed its execution. It retrieves the return address from the stack and continues execution from that address.

  • What is the difference between 'JMP' and 'CALL' instructions in the 8085 microprocessor?

    -The 'JMP' instruction simply jumps to a new address without saving the return address, while the 'CALL' instruction not only jumps to a new address but also pushes the return address onto the stack for later retrieval with a 'RET' instruction.

  • What addressing mode is used when the address is provided directly in the instruction for a jump in the 8085 microprocessor?

    -When the address is provided directly in the instruction for a jump in the 8085 microprocessor, it is referred to as the 'Immediate Addressing Mode'.

  • What is the size of the 'JMP' instruction in terms of bytes in the 8085 microprocessor?

    -The 'JMP' instruction in the 8085 microprocessor is typically 3 bytes in size, as it includes the instruction opcode followed by a 16-bit address.

  • How does the 'CALL' instruction affect the program counter in the 8085 microprocessor?

    -After executing a 'CALL' instruction, the program counter in the 8085 microprocessor is updated to point to the address specified in the instruction, effectively transferring control to that location.

  • What is the significance of the 'C3' opcode in the 8085 microprocessor?

    -The 'C3' opcode in the 8085 microprocessor is associated with the 'JMP' instruction, indicating an unconditional jump to the address that follows the opcode.

  • What addressing mode is being referred to when the script mentions jumping to an address without checking any conditions?

    -The addressing mode being referred to when jumping to an address without checking any conditions is 'Immediate Addressing Mode', where the address is specified directly in the instruction.

Outlines

00:00

💻 Understanding Unconditional Branching in 8085 Microprocessor

The speaker introduces the concept of unconditional branching in the 8085 microprocessor. They explain that unlike conditional branching, which requires checking a condition before jumping to a specific address, unconditional branching jumps directly to a given address without any condition check. The speaker uses the 'JMP' instruction as an example, illustrating how it directs the control to a specific memory location without any condition checks. They also discuss the difference between sequential execution and branching, emphasizing that branching alters the normal flow of instruction execution. The concept of 'CALL' and 'RET' instructions, which are used for function calls and returns in programming, are also touched upon, explaining how they manage the program counter and stack to handle function execution and return. The speaker concludes by encouraging the audience to understand these concepts to better grasp the functioning of the 8085 microprocessor.

05:00

🔍 Exploring Addressing Modes in 8085 Microprocessor

In this segment, the speaker delves into the addressing modes of the 8085 microprocessor. They clarify a common misconception regarding the use of direct addressing mode, where an address is directly provided for the processor to jump to. The speaker explains that the 'JMP' instruction used in the previous paragraph is an example of immediate addressing mode, where the address to jump to is provided immediately after the instruction. They differentiate between direct and immediate addressing modes by providing examples and explaining how the processor interprets the memory location and data. The speaker also discusses the size of the instructions in terms of bytes and how the processor uses these addresses for execution. They conclude by emphasizing the importance of understanding addressing modes for effective microprocessor programming.

Mindmap

Keywords

💡Unconditional Branching

Unconditional branching refers to the action in a microprocessor where a jump to a specific memory address is executed without any condition checks. In the video, this concept is discussed in the context of the 8085 microprocessor, where instructions like 'JMP' are used to redirect the flow of execution to a different part of the program without any condition checks, as opposed to conditional jumps that depend on the state of certain flags.

💡8085 Microprocessor

The 8085 is an 8-bit microprocessor that was introduced by Intel in 1976. It is an extension of the 8080 processor and was designed for use in business and scientific systems. The video script discusses the 8085's instruction set, particularly focusing on branching instructions like JMP and how they work without condition checks, highlighting its role in the instruction execution flow.

💡Instruction Execution

Instruction execution is the process by which a microprocessor carries out the tasks defined by its instruction set. The video explains how instructions are executed sequentially unless a branching instruction like JMP is encountered, which can alter the flow of execution by jumping to a different memory address, bypassing the sequential order.

💡Memory Address

A memory address refers to the location in a computer's memory where data or instructions are stored. The script mentions memory addresses in the context of where the microprocessor will jump to when executing an unconditional branch instruction. For example, the JMP instruction is used to jump to a specific memory address, changing the flow of execution.

💡Direct Addressing Mode

Direct addressing mode is a method of accessing data in memory where the instruction itself contains the memory address of the operand. The video script explains that direct addressing is not the mode used for unconditional branching instructions like JMP, which do not involve accessing data at the specified address but rather changing the execution flow.

💡Immediate Addressing Mode

Immediate addressing mode is used when the operand is directly included as part of the instruction. The video script mentions immediate addressing in the context of the JMP instruction, where the address to jump to is part of the instruction itself, allowing for an immediate change in the execution flow without referencing memory.

💡Program Counter

The program counter (PC) is a register in a microprocessor that keeps track of the memory address of the next instruction to be executed. The video discusses how the PC is updated after executing a JMP instruction, showing how the microprocessor navigates through the instruction set based on the current value of the PC.

💡Hexadecimal

Hexadecimal is a base-16 number system commonly used in computing to represent binary numbers in a more human-readable form. The script refers to hexadecimal when discussing memory addresses and opcodes, such as the address '2020' and the opcode 'C3', which are both represented in hexadecimal notation.

💡Opcode

An opcode is a portion of a machine language instruction that specifies the operation to be performed. The video script mentions opcode 'C3', which corresponds to the JMP instruction in the 8085 microprocessor, illustrating how opcodes are used to identify and execute specific instructions.

💡Return

In the context of the video, 'return' refers to the process of a function concluding and control being passed back to the calling code. The script discusses how a return from a function, indicated by the 'RET' instruction, does not require an address since the return address is stored in the stack, allowing the program counter to know where to resume execution.

💡Stack

The stack is a region of memory that is used to store temporary values, such as function call return addresses. The video script touches on the concept of the stack when explaining how the return address is stored after a function call, allowing the program to resume execution at the correct location after the function completes.

Highlights

Explanation of unconditional branching in the 8085 microprocessor.

Description of the simple concept of unconditional branching without checking conditions.

Use of the JMP instruction for unconditional jumps to a specific address.

Explanation of the 'LET POST JMP' and 'LET POST' addressing modes with examples.

Discussion on the sequence execution and how it's affected by unconditional instructions.

Introduction to the concept of 'CALL' and its role in function execution.

Explanation of how 'CALL' differs from 'JMP' in terms of function execution and return.

Description of 'CALL RETURN' and its function in returning control back to the calling instruction.

Explanation of the stack's role in storing return addresses for 'CALL' instructions.

Discussion on the size of the instruction set in the 8085 microprocessor.

Details on the 'C3' opcode and its significance in the 8085 instruction set.

Explanation of the 'CALL' instruction's size and how it's represented in memory.

Description of the 'RET' instruction and its role in returning from a function.

Explanation of the immediate addressing mode and its application in 'JMP' instructions.

Discussion on the direct addressing mode and its use in accessing memory locations.

Explanation of how the program counter is affected by branching instructions.

Discussion on the addressing modes and their impact on program execution flow.

Transcripts

play00:00

स्टूडेंट वेलकम तू गेट माचिस आज की इस

play00:02

वीडियो में एक्सप्लेन करने जा रहा हूं

play00:03

अनकंडीशनल ब्रांचिंग इन 8085

play00:06

माइक्रोप्रोसेसर अनकंडीशनल का सिंपल सा

play00:09

मतलब है मैंने लास्ट वीडियो में भी आपको

play00:10

बताया था की जहां पे हमें ये चीज नहीं चेक

play00:13

करनी की अगर कंडीशन ट्रू है तब मैं जंप

play00:16

करूंगा अदर वाइस में जंप नहीं करूंगा ऐसा

play00:18

कोई फंडा नहीं है यहां पे अगर आपको दिया

play00:21

हुआ है की लेट पोस्ट जेएमपी और साथ में

play00:24

दिया होगा एड्रेस जैसे मैं लिख डन जेएमपी

play00:27

और साथ में दे डन मैं एड्रेस लेट पोस्ट

play00:29

2020 इसका मतलब क्या है की जैसे ही ये

play00:33

इंस्ट्रक्शन एग्जीक्यूट होगी तो आपका जो

play00:35

एक तरह से कंट्रोल है वो जंप कर देगा इस

play00:38

पर्टिकुलर एड्रेस पर मतलब नॉर्मली तो

play00:40

सीक्वेंस एग्जीक्यूशन होती है लेकिन जैसी

play00:42

है इंस्ट्रक्शन एग्जीक्यूट होगी तो

play00:44

कंट्रोल जो है वो जंप करके इस पर्टिकुलर

play00:46

एड्रेस पे चला जाएगा कोई कंडीशन चेक नहीं

play00:49

होगी ऐसी आपके पास ए जाति है कल कल के साथ

play00:52

भी हम इसी तरीके से मेंशन करते हैं जैसे

play00:54

मैंने लिख दिया कल 2020 इसका मतलब भी क्या

play00:57

है की जल्दी हमारे पास नॉर्मल एग्जीक्यूशन

play01:00

स्पेशल होती है लेकिन बीच में अगर

play01:01

इंस्ट्रक्शन आगे कल 2020 इसका मतलब क्या

play01:04

है की जब करके आपको पर्टिकुलर इस लोकेशन

play01:07

पे जाना और वहां से एग्जीक्यूशन स्टार्ट

play01:09

करनी है और यहां पे कल के साथ ही एक और भी

play01:12

उसे होता है डेट इसे कॉल्ड रिटर्न ये

play01:15

जर्नल्ली आपने सुना होगा जरा देखा भी होगा

play01:17

या आपने किया भी होगा फंक्शंस जैसे नॉर्मल

play01:19

हम सी सी प्लस प्लस सब जगह जो है वो

play01:21

फंक्शंस को उसे करते हैं तो फंक्शंस भी

play01:24

ऐसे ही होता है ना की जैसे मेरे पास में

play01:25

है में के अंदर मैंने पर एग्जांपल कुछ भी

play01:27

इस तरीके से स्टेटमेंट लिखी और उसके बाद

play01:29

मेरा ए गया फंक्शन वन ठीक है अब होता क्या

play01:32

है की नॉर्मल आपका एक-एक करके लाइन

play01:33

एग्जीक्यूट हो रही है लेकिन जैसे ही

play01:35

फूंकेशनल लिखा तो आपका कंट्रोल जो है वो

play01:37

जंप करके जहां पे फंक्शन वन की डेफिनेशन

play01:41

होगी वहां पे चला जाएगा ठीक है और उसके

play01:44

अंदर जो भी लिखा हुआ है उसको एग्जीक्यूट

play01:46

करेगा और जब सर एग्जीक्यूट कर दिया लास्ट

play01:49

में हम लोग फंक्शन के अंदर क्या लिखने हैं

play01:50

रेट लिखने हैं तो आप रिटर्न करके वापस यही

play01:54

पे आओगे और फिर उसके बाद नेक्स्ट वाली को

play01:57

एग्जीक्यूट करोगे तो ये जो है वो सिंपल तो

play02:00

इसीलिए रिटर्न के साथ कोई एड्रेस नहीं

play02:02

होता क्योंकि जब हम कल को एक्चुअल में कल

play02:04

करते हैं तो यहां पे जाओगे और फिर उसके

play02:07

बाद यहां पे आप कहां से गए थे उसका एड्रेस

play02:10

जो है वो स्टॉक में स्टोर कर देते हैं की

play02:12

जब आप वापस आओगे तो आपको पता हो कंट्रोल

play02:14

को पता हो की यार कहां पे आपने वापस ए के

play02:17

स्टार्ट करना है तो ये जो है वो कल रिटर्न

play02:19

इस तरीके से ही इकट्ठा कम करता है अब यहां

play02:21

पे आपसे क्या पूछ सकते हैं कॉन्सेप्ट में

play02:23

आपको कहानी तो साड़ी समझ में ए गई लेकिन

play02:25

क्या आपसे पूछा जा सकता है देखो सबसे पहले

play02:27

चीज आपसे क्या पूछ सकते हैं व्हाट इसे डी

play02:29

साइज ऑफ दिस इंस्ट्रक्शन व्हाट इसे डी

play02:31

साइज ऑफ दिस और व्हाट इस एन साइज ऑफ दिस

play02:34

तो देखो जेएमपी यहां पे अगर हम बात करें

play02:36

जेएमपी जो हमारे पास इंटेल 8085 का जो

play02:40

पूरा सीट है उसमें ये वाला जो जेएमपी है

play02:43

ये एक्चुअल में डिफाइंड है 63 इसका जो अब

play02:47

कोड है वो क्या लिखा हुआ है इसका कोड जो

play02:49

है वो है c3 सॉरी c3 ठीक है अब c3 का मतलब

play02:53

पता है क्या है c3 का मतलब क्या होता है

play02:55

जीरो ये आपका होता है 1 1 0 0 और 3 क्या

play02:58

होता है जीरो जीरो वन मतलब c3 ये हो गया

play03:01

आपका एक तरह से 8 बीट का यानी 1 बीते का

play03:04

तो ये हो गया और उसके बाद आप लोग क्या

play03:05

मेंशन करती हो जेएमपी के बाद एड्रेस अब

play03:08

आपको पता है एड्रेस जो है जो मेमोरी 8 0

play03:11

85 के साथ लगी होती है वो एक्चुअल में 16

play03:13

बीट है यहां पे 16 बीट है तो 16 बीट मतलब

play03:17

क्या हो गया 2/8 ये हो गए तो दो बेट ए हो

play03:20

गया दो बाय के एड्रेस हो गया तो टोटल आपका

play03:22

तीन बाइट जो है वो इसका साइज होगा ऐसी अगर

play03:25

हम बात करें कल की तो कल एक्चुअल में

play03:27

डिफाइंड है ऑफ कोर्स में सीडी और सीडी

play03:30

आपको पता ही है हेक्साडेसिमल में है तो सी

play03:32

को भी अगर आप खोलोगे दी को खोलोगे तो टोटल

play03:34

आठ फिट बन गए यानी एक व्हाइट और यहां पे

play03:36

भी एड्रेस हो गया दो बीते का तो एक व्हाइट

play03:38

इसके लिए दो व्हाइट इसके लिए तो टोटल तीन

play03:41

व्हाइट जो है वो लेकिन रिटर्न जो है

play03:43

रिटर्न सिर्फ एक बाइट के इंस्ट्रक्शन है

play03:45

क्योंकि ये जो है वो आप कोड में c9 जो है

play03:48

वो इसको नंबर दिया वो इसका कोड जो है वो

play03:50

c9 है लेकिन इसके साथ हम लोग कोई एड्रेस

play03:52

लिखने तो वन बाय ठीक है तो अगर मैं ऐसे

play03:55

लिख डन जेएमपी तू जीरो तू जीरो तो होगा

play03:58

क्या जैसे पर एग्जांपल मेरी यहां पे

play04:00

एड्रेस नंबर 1001 यह मेरा एक एड्रेस है ये

play04:03

अलर्ट्स पोज एड्रेस रिलेटेड 2001 अब तू

play04:06

डबल जीरो वन ये आपको पता है की 1 बीते का

play04:09

साइज होता है तो उसमें तो ए गया आपका

play04:11

जीएमपी और 2002 लोकेशन पे क्या ए जाएगा अब

play04:15

लेट पोस्ट मेरा एड्रेस जो है वो मेरे को

play04:17

जंप करना है इस तरीके से जेएमपी और लेट

play04:20

पोस्ट मेरे पास एड्रेस जो है वो है 2021

play04:23

ठीक है तो ये जो लोअर बीते है 2021 वाले

play04:26

में जो तू वन है वो मैं यहां पे स्टोर

play04:28

करता हूं और जो मेरा अपर बीते है डेट इस

play04:31

20 वो मैं यहां पे इस नोट करता हूं तो

play04:33

देखो यहां पे तीन लोकेशन इसने ले ली तो हर

play04:36

एक लोकेशन एक बाइट के तो यानी तीन बिट्स

play04:38

ये लगा अब होता क्या है नॉर्मली आपका जो

play04:41

प्रोग्राम काउंटर है वो पहले इस पे जाता

play04:43

है जेएमपी को कल करेगा और फिर प्रोग्राम

play04:45

का ऑर्डर आगे बाढ़ जाएगा फिर वो इसको कल

play04:47

करेगा फिर आगे बाढ़ जाएगा फिर इसको कल

play04:49

करेगा फिर आगे बाढ़ जाएगा तो मतलब नेक्स्ट

play04:51

वो का रहा है प्रोग्राम काउंटर के हिसाब

play04:53

से नेक्स्ट इंस्ट्रक्शन हम जो 2003 पे

play04:56

पड़ी है उसको एग्जीक्यूट करेंगे लेकिन

play04:57

जैसे ही हमने 2000 2 से इसको कल किया तो

play05:00

यहां पे इंस्ट्रक्शन में मैं पता ग गया

play05:01

मुझे की मुझे जंप करके कहां जाना है तू

play05:05

जीरो तू वन पे जाना है तो यहां पे तू जीरो

play05:07

तू वन पे जाना है तो मतलब आप 2003 पे नहीं

play05:10

जाओगे आप जंप करके जहां पे भी तू जीरो तू

play05:14

वन हुआ वहां पे जाओगे तो ये इस तरीके से

play05:17

जो है वो क करता है और यहां पे अगर आपसे

play05:19

पूछ लेने की ये ऐड्रेसिंग मोड कौन सा है

play05:21

तो जनरली स्टूडेंट को लगता है की सर ये

play05:23

ऐड्रेसिंग मोड कौन सा है आपका डायरेक्ट

play05:25

क्यों क्योंकि जब के साथ हमने क्या दे

play05:27

दिया हमने एड्रेस दे दिया की इस मेमोरी

play05:30

लोकेशन पे जो तो ये क्या होता है डायरेक्ट

play05:32

ऐड्रेसिंग मोड गलत ये डायरेक्ट नहीं है

play05:34

क्यों क्योंकि आपने इस जगह पे जाके जल्दी

play05:38

क्या होता है डायरेक्ट जैसे हम लोग

play05:40

डायरेक्ट ऐड्रेसिंग मोड में क्या लिखने

play05:41

हैं जैसे एग्जांपल के तोर पे मैं आपको बता

play05:42

डन जैसे हमने लिख दिया लोड एकम्युलेटर और

play05:45

लेट पोस्ट मैंने एड्रेस दे दिया तू जीरो

play05:47

तू जीरो अब होता क्या है 2020 एड्रेस पे

play05:50

जाओगे और वहां पे जाके जो भी मिलेगा मतलब

play05:55

उसे अंदर जो पड़ा है उसको लोड करोगे

play05:57

कम्युलेटर के अंदर मतलब इसके अंदर जो डाटा

play06:00

पड़ा है उसे डाटा को लोड करके कम्युलेटर

play06:03

में लेक आना है ये है डायरेक्ट यहां पे हम

play06:06

लोग इस एड्रेस पे जा के कुछ कर नहीं रहे

play06:08

सिर्फ हम जंप करके उसे पर्टिकुलर एड्रेस

play06:11

पे जा रहे हैं वहां से कोई डाटा को कॉपी

play06:12

नहीं कर रहे तो यानी एक तरह से हम लोग

play06:14

क्या का रहे हैं की इमीडीएटली जंप करो इस

play06:17

जगह पे इस लोकेशन पे इमीडीएटली जंप करो तो

play06:20

ये इमीडिएट ऐड्रेसिंग मोड का एग्जांपल है

play06:22

नोट कर लेना ये इमीडिएट ऐड्रेसिंग मोड के

play06:24

अंदर आता है और साइज भी आपको मैंने सर बता

play06:27

दिया थैंक यू

Rate This

5.0 / 5 (0 votes)

Étiquettes Connexes
MicroprocessorUnconditional Branching8085Instruction SetMemory AddressingProgramming ConceptsControl FlowAssembly LanguageComputer ScienceEducational Content
Besoin d'un résumé en anglais ?