After the assembly language is created it is necessary to determine how to represent each instruction as a number. |
Dopo che il linguaggio assembly è stato creato, è necessario determinare come rappresentare ogni istruzione in termini di numeri. |
This establishes a one-to-one correspondence between each instruction in the assembly language and each instruction code in the set of instruction codes. |
Questo stabilisce una corrispondenza uno ad uno tra ogni istruzione nel linguaggio assembly e ogni codice del set dei codici di istruzione. |
Converting a program from assembly language to instruction codes is called assembling, and conversion from instruction codes back into assembly language is called disassembling. |
Il processo di conversione di un programma da un linguaggio assembly a codici di istruzione viene chiamato "assemblaggio", mentre la conversione da codici di istruzione a linguaggio assembly viene chiamata "disassemblaggio". |
Several choices we must make at this point are: |
Le diverse scelte che bisogna compiere a questo punto includono: |
What number is used to represent each assembly language instruction? |
Quale numero si vuole usare per rappresentare ogni istruzione del linguaggio assembly? |
How are instruction operands encoded? |
Come sono codificati gli operandi dell'istruzione? |
Are operands part of the instruction word (remember, by word I mean number), or are they separate words (numbers)? |
Gli operandi sono parte della parola di istruzione (ricordare che per parola intendo numero), o sono parole (numeri) separate? |
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. |
Prima di tutto, per rispondere all'ultima domanda, dato che ci sono solo pochi numeri di istruzioni e registri in questo VM non dovrebbe essere molto difficile codificare tutti gli operandi in un unica parola di istruzione, anche se (per comodità) io userei una parola di istruzione a 16 bit. |
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). |
Così, un numero a 16 bit scritto in esadecimali ha 4 cifre, dandoci facile accesso a 4 campi di informazione, ognuno contenente 16 varianti (0-9 e A-F). |
The first digit of a machine word will be the instruction number. |
La prima cifra del linguaggio macchina sarà un numero di istruzione. |
This gives our VM the potential for having up to 16 different instructions. |
Questo dà al nostro VM il potenziale per avere fino a 16 differenti istruzioni. |
This is a small amount by contemporary standards, but it is plenty for our example virtual machine. |
Questa può risultare una piccola quantità rispetto agli standard contemporanei, ma va più che bene per la nostra macchina virtuale d'esempio. |
The next three digits will be used for the operands. |
Le seguenti tre cifre saranno usate per gli operandi. |
These can be used as three 1-digit operands, two operands of 1 and 2 digits, or a single 3-digit operand. |
Questi possono essere usati come operandi a una cifra, due operandi a 1 o 2 cifre, o un singolo operando a 3 cifre. |
Having made these decisions, let us now establish the encoding. |
Avendo preso queste decisioni, stabiliamo ora la codifica. |
Recall that we have 16 instruction numbers available. |
Ricordare che abbiamo 16 numeri di istruzione disponibili. |
The halt instruction will be instruction 0, and there is an important reason for choosing 0 for this instruction. |
L'istruzione di alt sarà istruzione 0 e c'è una ragione importante per cui scegliere 0 per questa istruzione. |
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. |
Dal momento che spazi vuoti nella memoria del computer saranno probabilmente riempiti per la maggior parte da 0, ogni programma a ciclo infinito incontrerà prima o poi uno 0 e tenterà di eseguire questa istruzione, fermando immediatamente il programma. |