Need help with coding this program in RISC-V (RARS) assembly
language programs, thank you
Operation of the file Lab3.asm This program will print out a pattern with numbers and stars (asterisks) and dollar signs ($). 1. It will first prompt for the height of the pattern. If the user enters an invalid input such as a negative number or zero, an error message will be printed and the user will be prompted again. 2. Then your program should print the following pattern using numbers, stars and dollar signs. Each row in the pattern must not have any blank space or any other character in between the number, * and $ sign. Example Outputs User inputs 0,-1, and then 5 Enter the height of the pattern (must be greater than 0):-1 Invalid Entry! Enter the height of the pattern (must be greater than 0):0 Invalid Entry! Enter the height of the pattern (must be greater than 0):5 $1 $*$3 $*$*$5 $*$*$*$7 $*$*$*$*$9 - program is finished running (0) -- To receive all possible points, the output should match the sample format exactly.
Exception calls You may use ecall 11 (print character), ecall 4 (print string) and ecall 1 (print integer) to print the lab3 pattern, but you MUST use ecall 4 (print string) to print the prompt message. You may collect user input using ecall 5 (read integer). When finished, your program should end by calling ecall 10 (exit). See below for a summary of ecalls and their uses. The three provided .asm files in the Google Drive's Lab3 folder should already give you an extensive idea of how to apply ecalls. ECALL # FUNCTION PURPOSE 1 Print integer Prints an integer in ASCII 4 Print string Print prompt 5 10 Read integer Read user input Exit Successfully end the program Print character Prints an ASCII character Table: Allowed ecalls 11
Need help with coding this program in RISC-V (RARS) assembly language programs, thank you
-
answerhappygod
- Site Admin
- Posts: 899604
- Joined: Mon Aug 02, 2021 8:13 am
Need help with coding this program in RISC-V (RARS) assembly language programs, thank you
Join a community of subject matter experts. Register for FREE to view solutions, replies, and use search function. Request answer by replying!