about summary refs log tree commit diff
path: root/lang/mips/chapter-2/exercise-1/r.s
diff options
context:
space:
mode:
Diffstat (limited to 'lang/mips/chapter-2/exercise-1/r.s')
-rw-r--r--lang/mips/chapter-2/exercise-1/r.s16
1 files changed, 16 insertions, 0 deletions
diff --git a/lang/mips/chapter-2/exercise-1/r.s b/lang/mips/chapter-2/exercise-1/r.s
new file mode 100644
index 0000000..c362e64
--- /dev/null
+++ b/lang/mips/chapter-2/exercise-1/r.s
@@ -0,0 +1,16 @@
+# s4 <<= 3
+	.text
+main:
+	li	$s4,	420		# s4 = 420
+	sll	$s4,	$s4,	3	# s4 <<= 3
+
+	li	$v0,	1		# print integer
+	move	$a0,	$s4		# at s4
+	syscall
+
+	li	$v0,	11		# print character
+	li	$a0,	10		# newline
+	syscall
+
+	li	$v0,	10		# terminate program run
+	syscall