Can someone explain me what the semicolon do in ADD R1, R1; R2? I know that ADD, addition R1 and R2, and puts the value into R1. Does it do the same here? The first picture is the instruction set we are using. The second picture shows the IJVM architecture.
Asked
Active
Viewed 289 times
0
-
4What architecture are you talking about? And what assembler? Syntax varies with assembler even for the same ISA (machine-code format). In some asm syntaxes, `;` is a comment character, e.g. for many Intel-syntax x86 assemblers like NASM and MASM, but x86 doesn't have registers called R1 or R2. – Peter Cordes Nov 16 '21 at 10:55
-
I've updated the post with the instructions set and the architecture. Maybe this update helps. – Wheil Nov 16 '21 at 11:06
-
Your ISA reference shows that `add` is a 3-operand instruction, with two commas separating the 3 operands. A semicolon is probably a typo for a comma, so it should be `r1 += r2` as `add r1, r1, r2` or equivalently `add r1, r2, r1`. – Peter Cordes Nov 16 '21 at 11:11
-
3@Wheil For the future, please avoid posting pictures of text if possible. – fuz Nov 16 '21 at 12:00
-
1What semicolon are you talking about? There is no semicolon in your pictures. – Holger Nov 17 '21 at 08:48