Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
instruction_encoding [2024/05/12 09:20] pulkomandyinstruction_encoding [2024/07/01 13:29] (current) – [Multiplication] simer
Line 9: Line 9:
 ===== Summary ===== ===== Summary =====
  
-^Opcode 0\1^ 0  ^ 1       ^ 2           ^ 3 ^ 4 ^ 5 ^ 6 ^ 7 ^ +^Opcode 0\1     ^ 0       ^ 1            ^ 2           ^ 3  ^ 4                        ^ 5        ^ 6        ^ 7     ^ 
-^        |ADD, JB, JNAE, JCC |||||||| +^Addressing mode|[BP+Imm6]|#Imm6                     |[Rs]|Rs,#Imm16,[Addr16], Rs ASR|Rs LSL/LSR|Rs ROL/ROR|[Addr6]| 
-^        |ADC, JAE, JNB, JCS |||||||| +^       **ADD**//JB, JNAE, JCC// ||             **ADD** ||||| 
-^        |SUB, JGE, JNL, JSC |||||||| +^       **ADC**//JAE, JNB, JCS// ||             **ADC** ||||| 
-^        |SBC, JL, JNGE, JSS | +^       **SUB**//JGE, JNL, JSC// ||             **SUB** ||||| 
-^        |CMP, JNE, JNZ | +^       **SBC**//JL, JNGE, JSS// ||             | **SBC** ||||
-^        |JE, JZ +^       **CMP**//JNE, JNZ//      ||             | **CMP** ||||
-^        |NEG, JPL | +^       //JE, JZ//                 ||                       |||||| 
-^        |JMI | +^       **NEG**//JPL//           ||             | **NEG** ||||
-^        |XOR, JBE, JNA | +^       //JMI//                    ||                       |||||
-^        |LD, JA, JNBE ||POP,RETF,RETI|LD, JA, JNBE +^       **XOR**//JBE, JNA//      ||             | **XOR** ||||
-^        |OR  | +^       **LD**//JA, JNBE//       ||POP,RETF,RETI| **LD**  ||||
-^        |AND | +^       **OR**, //JLE, JNG//       ||             | **OR**  ||||
-^        |TEST| +^       **AND**, //JG, JNLE//      ||             | **AND** ||||
-^        |ST           |PUSH| +^       **TEST**, //JVC//          ||             | **TEST**||||
-^       +^       **ST**, //JVS//            ||PUSH         | **ST**  ||||
-^        |MUL |CALL      |GOTO|   |MUL|INT,IRQ,FIR_MOV,BREAK|     |+^       E  | //JMP//                    ||             |||||
 +^        | MUL.us        |CALL         |MAC.us,//GOTO// MAC.us |MUL.ss|INT,IRQ,FIR_MOV,BREAK|MAC.ss ||
  
 +  * Instructions in bold: uses the addressing mode listed on the first line
 +  * Instructions in italics: only if operand A (destination register) is PC
 ===== Special instructions ===== ===== Special instructions =====
  
Line 41: Line 44:
 Note: Operand A and Operand B cannot be 0, 6 or 7 (it is not possible to multiply SP, SR or PC with something). Note: Operand A and Operand B cannot be 0, 6 or 7 (it is not possible to multiply SP, SR or PC with something).
 They also can not be 3 or 4 in MAC (MR is used for intermediate results). If the size of the MAC  They also can not be 3 or 4 in MAC (MR is used for intermediate results). If the size of the MAC 
-operation is exactly 16, it will be stored as N=0.+operation is exactly 16, it will be encoded as N=0.
 ==== CALL and GOTO ==== ==== CALL and GOTO ====
  
Line 134: Line 137:
 ^%% D:[++Rs]      %%| ALU op|  Op. A  | 3       | 7                | Rs      | ^%% D:[++Rs]      %%| ALU op|  Op. A  | 3       | 7                | Rs      |
 ^%% Rs            %%| ALU op|  Op. A  | 4       | 0                | Rs      | ^%% Rs            %%| ALU op|  Op. A  | 4       | 0                | Rs      |
-^%% #Imm16        %%| ALU op|  Op. A  | 4       | 1                | Unused  | |16-bit immediate in next word| +^%% #Imm16        %%| ALU op|  Op. A  | 4       | 1                | Rs*     | |16-bit immediate in next word, Rs is first operand
-^%% From [Addr16] %%| ALU op|  Op. A  | 4       | 2                | Unused  | |16-bit address in next word| +^%% From [Addr16] %%| ALU op|  Op. A  | 4       | 2                | Rs*     | |16-bit address in next word, Rs is first operand
-^%% To [Addr16]   %%| ALU op|  Op. A  | 4       | 3                | Unused  | |16-bit address in next word|+^%% To [Addr16]   %%| ALU op|  Op. A  | 4       | 3                | Rs*     | |16-bit address in next word, Rs is first operand|
 ^%% Rs ASR shift  %%| ALU op|  Op. A  | 4       | 4 + (shift - 1)  | Rs      | ^%% Rs ASR shift  %%| ALU op|  Op. A  | 4       | 4 + (shift - 1)  | Rs      |
 ^%% Rs LSL shift  %%| ALU op|  Op. A  | 5       | shift - 1        | Rs      | ^%% Rs LSL shift  %%| ALU op|  Op. A  | 5       | shift - 1        | Rs      |
instruction_encoding.1715505628.txt.gz · Last modified: 2024/05/12 09:20 by pulkomandy
CC Attribution 4.0 International
Driven by DokuWiki Recent changes RSS feed Valid CSS Valid XHTML 1.0