Question:
Which of the following must be the last statement of a source program?
निम्न में से कौन सा सोर्स प्रोोग्रााम का अंतिम कथन होना चाहिए?
Options:
- STOP
- RETURN
- OP
- END
- स्टॉप
- रिटर्न
- ओपी
- End
Correct Answer: d)
Explanation:
Detailed Explanation:
The correct answer is d) End.
In assembly and compiler source programs, statements are divided into executable instructions and assembler directives:
- END Directive: Must be the physically final statement in an assembly source program. It signals to the assembler that there are no further source lines to translate, officially terminating the assembly process. It may also specify the program’s execution entry point label (e.g.,
END START). - Why STOP is not the source end statement:
STOP(orHLT) is an executable CPU instruction that halts the processor at runtime. A program may have multiple STOP instructions, or none at all (e.g., looping indefinitely or returning to the OS), but it must have exactly oneENDdirective marking the end of the source text. - RETURN: Used at the end of a subroutine/function to return control to the calling routine.
विस्तृत व्याख्या:
सही उत्तर d) End है।
असेंबली भाषा के सोर्स प्रोग्राम में:
- End डायरेक्टिव: यह सोर्स प्रोग्राम का सबसे अंतिम कथन (last statement) होना चाहिए। यह एसेम्बलर को सूचित करता है कि सोर्स कोड समाप्त हो गया है और एसेम्बलिंग प्रक्रिया को रोक दिया जाना चाहिए।
- STOP और End में अंतर:
Endएक एसेम्बलर डायरेक्टिव (स्यूडो-ऑप) है जो कंपाइलेशन/एसेम्बलिंग समय पर काम करता है।STOP / HLTएक मशीन निर्देश है जो रन-टाइम पर CPU के निष्पादन को रोकता है।
- RETURN: यह सब-रूटीन से मुख्य प्रोग्राम में लौटने के लिए उपयोग किया जाने वाला निर्देश है।