Differences
This shows you the differences between two versions of the page.
| Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
| instruction_encoding [2023/12/18 11:44] – [ALU instructions] pulkomandy | instruction_encoding [2024/07/01 13:29] (current) – [Multiplication] simer | ||
|---|---|---|---|
| Line 7: | Line 7: | ||
| ^Contents|Opcode0|Operand A|Opcode1|6-bit Immediate | ^Contents|Opcode0|Operand A|Opcode1|6-bit Immediate | ||
| + | ===== Summary ===== | ||
| + | |||
| + | ^Opcode 0\1 ^ 0 ^ 1 ^ 2 ^ 3 ^ 4 ^ 5 ^ 6 ^ 7 ^ | ||
| + | ^Addressing mode|[BP+Imm6]|# | ||
| + | ^ | ||
| + | ^ | ||
| + | ^ | ||
| + | ^ | ||
| + | ^ | ||
| + | ^ | ||
| + | ^ | ||
| + | ^ | ||
| + | ^ | ||
| + | ^ | ||
| + | ^ | ||
| + | ^ | ||
| + | ^ | ||
| + | ^ | ||
| + | ^ | ||
| + | ^ | ||
| + | |||
| + | * 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 21: | 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 | + | operation is exactly 16, it will be encoded |
| ==== CALL and GOTO ==== | ==== CALL and GOTO ==== | ||
| Line 114: | Line 137: | ||
| ^%% D: | ^%% D: | ||
| ^%% Rs %%| ALU op| Op. A | 4 | 0 | Rs | | ^%% Rs %%| ALU op| Op. A | 4 | 0 | Rs | | ||
| - | ^%% # | + | ^%% # |
| - | ^%% From [Addr16] %%| ALU op| Op. A | 4 | 2 | Rs | |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] | + | ^%% To [Addr16] |
| ^%% 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 | | ||
| Line 142: | Line 165: | ||
| '' | '' | ||
| - | and the "To [Addr16"]'' | + | and the "To [Addr16]" |
| + | |||
| + | '' | ||
| - | '' | + | (so in this case the register encoded in OPA is used as a source, not a destination). |
| The LD and ST operations with the 16-bit addressing mode ignore the value of Rs, they use only Ra and the 16-bit value. | The LD and ST operations with the 16-bit addressing mode ignore the value of Rs, they use only Ra and the 16-bit value. | ||
