ADD
Meaning: Addition of two registers.
Syntax:
ADD R1, R2, R3
Working: Adds the values of R2 and R3 and stores the result in R1.
Example: If R2 = 10 and R3 = 5, then R1 = 15.
Learn the assembly instructions supported by RISC-Vision
Search an instruction to understand its meaning, syntax and example.
Meaning: Addition of two registers.
Syntax:
ADD R1, R2, R3
Working: Adds the values of R2 and R3 and stores the result in R1.
Example: If R2 = 10 and R3 = 5, then R1 = 15.
Meaning: Subtraction of two registers.
Syntax:
SUB R1, R2, R3
Working: Subtracts R3 from R2 and stores the result in R1.
Example: If R2 = 10 and R3 = 5, then R1 = 5.
Meaning: Add an immediate number.
Syntax:
ADDI R1, R2, 5
Working: Adds the number 5 to the value in R2 and stores the result in R1.
Example: If R2 = 10, then R1 = 15.
Meaning: Bitwise AND operation.
Syntax:
AND R1, R2, R3
Working: Performs AND on each corresponding bit of R2 and R3.
Example: 1100 AND 1010 = 1000.
Meaning: Bitwise OR operation.
Syntax:
OR R1, R2, R3
Working: Performs OR on each corresponding bit of R2 and R3.
Example: 1100 OR 1010 = 1110.
Meaning: Bitwise exclusive OR.
Syntax:
XOR R1, R2, R3
Working: Produces 1 when corresponding bits are different.
Example: 1100 XOR 1010 = 0110.
Meaning: Load Word from memory.
Syntax:
LW R1, 0(R2)
Working: Reads memory at the address R2 + 0 and stores the value in R1.
Example: If R2 = 10, it loads M[10] into R1.
Meaning: Store Word in memory.
Syntax:
SW R1, 0(R2)
Working: Stores the value of R1 at memory address R2 + 0.
Example: If R2 = 10, the value of R1 is stored in M[10].
Meaning: Branch if Equal.
Syntax:
BEQ R1, R2, 2
Working: If R1 and R2 are equal, execution jumps by the given offset.
Example: If both registers are equal, the next instruction is skipped and execution jumps according to the offset.
Meaning: Branch if Not Equal.
Syntax:
BNE R1, R2, 2
Working: If R1 and R2 are different, execution jumps by the given offset.
Example: If the registers are different, the next instruction is skipped and execution jumps according to the offset.
No matching instructions found.