From f01d439e7c1b49b8597377f6832b76f16eb446da Mon Sep 17 00:00:00 2001 From: Ian Moffett Date: Sat, 27 Jul 2024 20:12:16 -0400 Subject: Prefix immediates with '#' Signed-off-by: Ian Moffett --- README.md | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'README.md') diff --git a/README.md b/README.md index fb4e782..69e013c 100644 --- a/README.md +++ b/README.md @@ -41,9 +41,9 @@ Bitwise logic operations can write to all registers except `v0`-`v7`, `x0` and ` #### Example ``` /* Set x1 to 5 */ -mov x1, 5 +mov x1, #5 /* Ands x1 (which equals 5) with 1 */ -and x1, 1 +and x1, #1 /* x1 now equals 1 */ ``` @@ -63,7 +63,7 @@ Arithmetic operations can write to all registers except `v0`-`v7`, `x0` and `pc` #### Example ``` /* Set x1 to 5 */ -mov x1, 5 +mov x1, #5 /* Increment x1 */ inc x1 /* x1 now equals 6 */ @@ -89,11 +89,11 @@ Control flow instructions are used to control which instructions the CPU execute #### Example ``` /* Subtract x2 from x1 */ -sub x1, x2 -beq x1, 0, zero -mov x1, 2 +sub x1, x1, x2 +beq x1, #0, zero +mov x1, #2 zero: -mov x1, 3 +mov x1, #3 /* Iff x1 - x2 = 0, x1 equals 3 */ /* Iff x1 - x1 != 0, x1 equals 2 */ ``` -- cgit v1.2.3