After the assembly language is created it is necessary to determine how to represent each instruction as a number. |
اسمبلی کی زبان بننے کے بعد یہ ضروری ہے کہ ہر ہدایات کو بطور نمبر پیش کیا جائے۔ |
This establishes a one-to-one correspondence between each instruction in the assembly language and each instruction code in the set of instruction codes. |
یہ اسمبلی زبان میں ہر ہدایات اور انسٹرکشن کوڈز کے سیٹ میں ہر انسٹرکشن کوڈ کے درمیان ایک سے ایک خط و کتابت قائم کرتا ہے۔ |
Converting a program from assembly language to instruction codes is called assembling, and conversion from instruction codes back into assembly language is called disassembling. |
کسی پروگرام کو اسمبلی زبان سے انسٹرکشن کوڈ میں تبدیل کرنا اسمبلنگ کہلاتا ہے ، اور انسٹرکشن کوڈز سے اسمبلی زبان میں تبدیل کرنے کو ڈس اسمبلنگ کہا جاتا ہے۔ |
Several choices we must make at this point are: |
اس موقع پر ہمیں کئی انتخاب کرنے چاہئیں: |
What number is used to represent each assembly language instruction? |
ہر اسمبلی زبان کی ہدایات کی نمائندگی کے لیے کونسا نمبر استعمال کیا جاتا ہے؟ |
How are instruction operands encoded? |
انسٹرکشن آپریشنز کو انکوڈ کیسے کیا جاتا ہے؟ |
Are operands part of the instruction word (remember, by word I mean number), or are they separate words (numbers)? |
کیا آپریشنز ہدایات لفظ کا حصہ ہیں (یاد رکھیں ، لفظ سے میرا مطلب نمبر ہے) ، یا وہ الگ الفاظ (نمبر) ہیں؟ |
First, to answer the last question, since there are only small numbers of instructions and registers in this VM it should not be very difficult to encode all operands in a single instruction word, even if (for the sake of simplicity) I were to use a 16-bit instruction word. |
سب سے پہلے ، آخری سوال کا جواب دینے کے لیے ، چونکہ اس VM میں صرف چھوٹی تعداد میں ہدایات اور رجسٹر موجود ہیں ، تمام ہدایات کو ایک ہی ہدایات کے لفظ میں انکوڈ کرنا بہت مشکل نہیں ہونا چاہیے ، چاہے (سادگی کی خاطر) میں استعمال کروں ایک 16 بٹ انسٹرکشن لفظ۔ |
Thus, a 16-bit number written in hexadecimal has 4 digits, giving us easy access to 4 information fields, each containing 16 variations (0-9 and A-F). |
اس طرح ، ہیکساڈیسیمل میں لکھے گئے 16 بٹ نمبر میں 4 ہندسے ہوتے ہیں ، جو ہمیں 4 انفارمیشن فیلڈز تک آسان رسائی فراہم کرتے ہیں ، ہر ایک میں 16 مختلف حالتیں ہوتی ہیں (0-9 اور A-F)۔ |
The first digit of a machine word will be the instruction number. |
مشین ورڈ کا پہلا ہندسہ انسٹرکشن نمبر ہوگا۔ |
This gives our VM the potential for having up to 16 different instructions. |
یہ ہمارے VM کو 16 مختلف ہدایات رکھنے کی صلاحیت فراہم کرتا ہے۔ |
This is a small amount by contemporary standards, but it is plenty for our example virtual machine. |
یہ معاصر معیار کے لحاظ سے ایک چھوٹی سی رقم ہے ، لیکن یہ ہماری مثال ورچوئل مشین کے لیے کافی ہے۔ |
The next three digits will be used for the operands. |
اگلے تین ہندسے آپریشنز کے لیے استعمال کیے جائیں گے۔ |
These can be used as three 1-digit operands, two operands of 1 and 2 digits, or a single 3-digit operand. |
یہ تین 1 ہندسوں کے آپریڈز ، 1 اور 2 ہندسوں کے دو آپریڈز ، یا ایک 3 ہندسوں کے اوپیرینڈ کے طور پر استعمال ہوسکتے ہیں۔ |
Having made these decisions, let us now establish the encoding. |
یہ فیصلے کرنے کے بعد ، آئیے اب انکوڈنگ قائم کریں۔ |
Recall that we have 16 instruction numbers available. |
یاد رکھیں کہ ہمارے پاس 16 انسٹرکشن نمبر دستیاب ہیں۔ |
The halt instruction will be instruction 0, and there is an important reason for choosing 0 for this instruction. |
ہالٹ انسٹرکشن انسٹرکشن 0 ہوگی ، اور اس انسٹرکشن کے لیے 0 کو منتخب کرنے کی ایک اہم وجہ ہے۔ |
Since empty space in the computer's memory will most likely be filled with 0s, any run-away program will eventually encounter a 0 and attempt to execute this instruction, immediately halting the program. |
چونکہ کمپیوٹر کی میموری میں خالی جگہ زیادہ تر 0s سے بھر جائے گی ، لہذا کوئی بھی بھاگنے والا پروگرام بالآخر 0 کا سامنا کرے گا اور اس ہدایات پر عمل کرنے کی کوشش کرے گا ، پروگرام کو فوری طور پر روک دے گا۔ |