(Solved) : Write Spim Assembly Language Program Num Vowels Based Hardware Implementation Method Lab N Q42785482 . . .

Write a SPIM assembly language program num-vowel.s based on the hardware implementation method in the lab notes and the above practice.The program will do the following:

  1. Prompt the user to enter a string.
  2. The program will call the procedure vowelp tocheck if a character entered in the string is a vowel or not.
  3. Count how many vowels and how many non-vowels are in thestring.
  4. Print out the calculated results with appropriate message.
  5. Hint: A loop is needed.

/********************************************************************* * FileName: vowelCount.S * * Processor: PIC32MX * * Assembler/Compiler/Linker: MPLAB C32 * * * Description: * This project asks the user to enter a string. * The program then counts the number of vowels in the string. * ********************************************************************/#include <p32xxxx.h>################################################# .data prompt1: .asciiz “Please enter a string up to 50 chars long:n 00” stringBuffer: .space 50 printNumVowels: .asciiz “The number of vowels is: %dn 00” #Used for debugging #printChar: .asciiz “The var sitting in the return is: %cn 00” #printInt: .asciiz “The int sitting in the return is: %dn 00″## Students DO NOT edit this section################################################## ## text segment ## ################################################## .text .align 2 .globl main .ent main .type main, @functionmain: .frame $fp,512,$31 # vars= 8, regs= 1/0, args= 0, gp= 8 .mask 0x40000000,-8 .fmask 0x00000000,0 .set noreorder .cpload $25 .set reorder addiu $sp,$sp,-512 sw $31,508($sp) sw $fp,504($sp) move $fp,$sp .cprestore 16## END Students DO NOT edit this section## Students edit here ################################################# la $a0,prompt1 # print prompt on terminal jal printf # out a string la $a0,stringBuffer # load the address of the stringBuffer li $a1,50 # load the length jal mreads la $s0, stringBuffer lb $a0, ($s0) jal vowelp la $a0, printNumVowels move $a1, $v0 jal printf ## Do not edit below ###################################### move $sp,$fp lw $31,508($sp) lw $fp,504($sp) addiu $sp,$sp,512 j $31 .end main## Do not edit above ###################################### vowelp: li $v0, 0 # initialize $v0 to 0 beq $a0,’a’,yes beq $a0,’e’,yes beq $a0,’i’,yes beq $a0,’o’,yes beq $a0,’u’,yes jr $rayes: li $v0,1 jr $ra

Expert Answer


Answer to Write a SPIM assembly language program num-vowel.s based on the hardware implementation method in the lab notes and the…

Leave a Comment

About

We are the best freelance writing portal. Looking for online writing, editing or proofreading jobs? We have plenty of writing assignments to handle.

Quick Links

Browse Solutions

Place Order

About Us

× How can I help you?