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
Next revisionBoth sides next revision
instruction_encoding [2021/04/25 16:20] – [ALU instructions] simerinstruction_encoding [2023/12/18 12:45] – [ALU instructions] pulkomandy
Line 55: Line 55:
 Jump instructions are identified by Operand A = 7 (makes sense, because they change the PC which is register 7) Jump instructions are identified by Operand A = 7 (makes sense, because they change the PC which is register 7)
  
-^Instruction    ^Opcode0^Operand A^Opcode1  ^6-bit Immediate +^Instruction    ^Opcode0^Operand A^Opcode1  ^6-bit Immediate  ^Condition   
-^ JB, JNAE, JCC |  0    |       |Direction| Jump offset     | +^ JB, JNAE, JCC |  0    |       |Direction| Jump offset     | C = 0      
-^ JAE, JNB, JCS |  1    |       |Direction| Jump offset     | +^ JAE, JNB, JCS |  1    |       |Direction| Jump offset     | C = 1      
-^ JGE, JNL, JSC |  2    |       |Direction| Jump offset     | +^ JGE, JNL, JSC |  2    |       |Direction| Jump offset     | S = 0      
-^ JL, JNGE, JSS |  3    |       |Direction| Jump offset     | +^ JL, JNGE, JSS |  3    |       |Direction| Jump offset     | S = 1      
-^ JNE, JNZ      |  4    |       |Direction| Jump offset     | +^ JNE, JNZ      |  4    |       |Direction| Jump offset     | Z = 0      
-^ JE, JZ        |  5    |       |Direction| Jump offset     | +^ JE, JZ        |  5    |       |Direction| Jump offset     | Z = 1      
-^ JPL            6    |       |Direction| Jump offset     | +^ JPL            6    |       |Direction| Jump offset     | N = 0      
-^ JMI            7    |       |Direction| Jump offset     | +^ JMI            7    |       |Direction| Jump offset     | N = 1      
-^ JBE, JNA      |  8    |       |Direction| Jump offset     | +^ JBE, JNA      |  8    |       |Direction| Jump offset     | !(Z=0&C=1) 
-^ JA, JNBE      |  9    |       |Direction| Jump offset     | +^ JA, JNBE      |  9    |       |Direction| Jump offset     | Z=0 & C=1  
-^ JLE, JNG      |  A    |       |Direction| Jump offset     | +^ JLE, JNG      |  A    |       |Direction| Jump offset     | !(Z=0&S=0) 
-^ JG, JNLE      |  B    |       |Direction| Jump offset     | +^ JG, JNLE      |  B    |       |Direction| Jump offset     | Z=0 & S=0  
-^ JVC            C    |       |Direction| Jump offset     | +^ JVC            C    |       |Direction| Jump offset     | N = S      
-^ JVS            D    |       |Direction| Jump offset     | +^ JVS            D    |       |Direction| Jump offset     | N != S     | 
-^ JMP            E    |       |Direction| Jump offset     |+^ JMP            E    |       |Direction| Jump offset     | Always     |
 |                F    |       | Reserved for special instructions || |                F    |       | Reserved for special instructions ||
  
Line 137: Line 137:
  
 The ST operation uses the second source operand (Rs, address, ...) as the target, and operand A (always a register) as the source. The ST operation uses the second source operand (Rs, address, ...) as the target, and operand A (always a register) as the source.
 +
 +Other operations can use both forms, so the "From [Addr16]" would be something like this:
 +
 +''R3 = R2 + [Addr16]''
 +
 +and the "To [Addr16]" corresponds to:
 +
 +''[Addr16] = R2 + R3''
 +
 +(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.
instruction_encoding.txt · Last modified: 2024/05/12 11:44 by pulkomandy
CC Attribution 4.0 International
Driven by DokuWiki Recent changes RSS feed Valid CSS Valid XHTML 1.0