SSC IMD SA 2017 – Question 155

Question:

Which of the following stores all names and their associated values in an assembler?

निम्न में से कौन सा एसेम्ब्लर स्टोर सभी नाम और उनके रिलेशनित मान का भण्डारण करता है?

Options:

  • Special purpose register
  • Symbol table
  • Value map set
  • None of these
  • विशेष प्रयोजन रजिस्टर
  • प्रतीक टेबल
  • वैल्यू मैप सेट
  • इनमे से कोई नहींं

Correct Answer: b)

Explanation:

Detailed Explanation:

The correct answer is b) Symbol table (प्रतीक टेबल).

In system software, assemblers, and compilers:

  • The Symbol Table is a core data structure used to store all user-defined identifiers (such as variable names, function names, and jump labels) along with their associated attributes, data types, and corresponding memory addresses.
  • In a standard two-pass assembler:
    • Pass 1: Scans the entire source code to identify all labels and symbols, calculates their memory offsets using the location counter, and inserts the pairs $\langle \text{Symbol Name}, \text{Address} \rangle$ into the Symbol Table.
    • Pass 2: Translates opcodes into binary machine code and consults the Symbol Table to replace every symbolic operand/target with its corresponding numerical address.

विस्तृत व्याख्या:

सही उत्तर b) प्रतीक टेबल (Symbol Table) है।

सिस्टम सॉफ्टवेयर, एसेम्बलर और कंपाइलर डिज़ाइन में:

  • सिंबल टेबल (प्रतीक टेबल): यह एक अत्यंत महत्वपूर्ण डेटा संरचना है जो प्रोग्राम में प्रयुक्त सभी प्रतीकों/नामों (जैसे लेबल, वेरिएबल नाम, प्रक्रिया नाम आदि) और उनके संबंधित मेमोरी मानों/पतों (addresses) का भंडारण करती है।
  • टू-पास एसेम्बलर में इसका उपयोग:
    • पास 1: एसेम्बलर कोड को स्कैन करता है और सभी लेबलों तथा उनके मेमोरी पतों को सिंबल टेबल में दर्ज करता है।
    • पास 2: एसेम्बलर सिंबल टेबल से इन मानों को पढ़कर प्रतीकात्मक नामों को उनके वास्तविक बाइनरी पतों से प्रतिस्थापित करता है।

Leave a Comment

Your email address will not be published. Required fields are marked *

Scroll to Top