Commit 97e837f9 authored by kjc015's avatar kjc015
Browse files

Exercise 2 Complete

parent 9654eba1
Kyle Chrysler
Tuesday 1:20
Lab05 - notes.txt
Exercise 1: Creating a memory map Exercise 1: Creating a memory map
Segment | Start | End | Size | Comments Segment | Start | End | Size | Comments
------------+-------------+--------------+--------------+-------------- ------------+-------------+--------------+--------------+--------------
...@@ -20,3 +24,24 @@ Data | | | | ...@@ -20,3 +24,24 @@ Data | | | |
Text | | | | Text | | | |
------------+-------------+--------------+--------------+-------------- ------------+-------------+--------------+--------------+--------------
Exercise 2: Making system calls from assembly
1. read an integer from the keyboard into t0
li a7, 5
ecall
mv t0, a0
2. print an integer in t0 to the terminal
mv a0, t0
li a7, 1
ecall
3. read from the keyboard a string and store it at the address corresponding to the label my_str
li a7, 8
ecall
la a0, my_str
4. print to the terminal a string declared at the address corresponding to the label prompt
la a0, prompt
li a7, 4
ecall
5. exit a program returning with the value -1
li a0, -1
li a7, 93
ecall
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment