Draw the map of this data segment
Draw the map of this data segment
.data
arr16: .space 16
5. Find the format and the machine code of the following instruction: sw x5, 32(x30)
Format: S type
Machine Code:
6. Write a program to: l Input an integer X from console l Output to screen the appropriate string: -
“odd” if X is an odd number - “even” if X is an even number.
7.
1. Write a subprogram/function to: l Get an integer X as input argument l Output the absolute value
of X
❑ 2. Use the above function to write a program that reads an input integer from input console, then
calculate and display the absolute value of that integer.
❑ 3. Modify the above program so that it repeats the above process continuously until it reads the
value 0 from input console.
8. ❑ Write a program to read a positive value n from console, then calculate and print the sum of
all numbers from 1 to n.
❑ Implement the function of calculate sum as a procedure with below parameters: l a7: n
(upper boundary) l a0: return value of (1+2+..+n)
9. Develop a simple implementation of the strlen() function size_t strlen(const char *str). Write a
program to input a string (max of 255 chars), then print out its length