1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
laiz [17]
2 years ago
7

Compose a program to examine the string "Hello, world!\n", and calculate the total decimal numeric value of all the characters i

n the string (including punctuation marks), less the numeric value of the vowels.
The program should load each letter, add that numerie value to the running total to produce a total sum, and then add the value to a "vowels running total as well. The program will require a loop. You do not need a counter, since the phrase is null terminated. Remember, punctuation (even spaces!) have a numeric value as well.
Computers and Technology
1 answer:
Ainat [17]2 years ago
6 0

Answer:

.data

  str:   .asciiz   "Hello, world!\n"

  output:   .asciiz "\nTotal character numeric sum = "

.text

.globl main

main:

  la $t0,str       # Load the address of the string

  li $t2,0       # Initialize the total value to zero

loop:   lb $t1,($t0)       # Load one byte at a time from the string

  beqz $t1,end       # If byte is a null character end the operation

  add $t2,$t2,$t1       # Else add the numeric value of the byte to the running total

  addi $t0,$t0,1       # Increment the string pointer by 1

  b loop           # Repeat the loop

end:

  # Displaying the output

  li $v0,4       # Code to print the string

  la $a0,output       # Load the address of the string

  syscall           # Call to print the output string

  li $v0,1       # Code to print the integer

  move $a0,$t2       # Put the value to be printed in $a0

  syscall           # Call to print the integer

  # Exiting the program

  li $v0,10       # Code to exit program

  syscall           # Call to exit the program

Explanation:

You might be interested in
Cmo se puede añadir amigo ??'
seropon [69]

Answer:ok

Explanation:

5 0
3 years ago
Select the correct answer.
ss7ja [257]
The answer a identifying portfolio goal
8 0
3 years ago
Read 2 more answers
To join a social network you create an avatar true or false
svp [43]
False because not all social media webstites provide avatars
7 0
3 years ago
Read 2 more answers
• Suppose an application generates chunks of 40 bytes of data every 20 msec, and each chunk gets encapsulated in a TCP segment a
kobusy [5.1K]

Answer:

10

Explanation:

i don't know please just thank me

8 0
3 years ago
What tells the hardware what to do and how to do it?
oksano4ka [1.4K]

Answer:

I think its CPU

Explanation:

8 0
2 years ago
Other questions:
  • If a class has member variables that are pointers, you must ensure that you implement ____.
    6·1 answer
  • An administrator running a port scan wants to ensure that no processes are listening on port 23. What state should the port be i
    7·1 answer
  • Indexed sequential access, an index is more useful when the number of record is
    10·1 answer
  • Select the correct answer.
    10·2 answers
  • Murray is a database technician. He has created a single enterprise database system. How is this better than multiple databases
    15·1 answer
  • Suppose Host A sends Host B a TCP segment encapsulated in an IP datagram. When Host B receives the datagram, how does the networ
    11·1 answer
  • Which of the following is a valid c++ identifier a. mouse b. _int c. 2_stop d. float​
    10·1 answer
  • Please select the word from the list that best fits the definition Asking for review material for a test
    14·2 answers
  • DEFINE Problem:
    11·1 answer
  • What is output by the following line of code?
    15·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!