| 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. |
تُسمى عملية تحويل البرنامج من لغة التجميع إلى رموز التعليمات تجميعًا (assembling)، بينما يُطلق على عملية التحويل من رموز التعليمات مرة أخرى إلى لغة التجميع اسم فك التجميع (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. |
أولاً، للإجابة على السؤال الأخير، بما أن هناك أعدادًا صغيرة فقط من التعليمات والسجلات في هذه الآلة الافتراضية، فلن يكون من الصعب جدًا ترميز جميع المعاملات في كلمة تعليمة واحدة، حتى لو (من أجل التبسيط) استخدمت كلمة تعليمة بحجم 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. |
يمكن استخدام هذه كمعاملات ثلاثية الأرقام من رقم واحد، أو معاملين من رقم واحد ورقمين، أو كمعامل واحد من ثلاث .أرقام |
| 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. |
نظرًا لأن المساحة الفارغة في ذاكرة الكمبيوتر ستُملأ على الأرجح بالأصفار، فإن أي برنامج جامح سيصادف في النهاية الرقم 0 ويحاول تنفيذ هذه التعليمة (هذا الأمر)، مما يؤدي إلى إيقاف البرنامج فورًا |