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]
3 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]3 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
When formatting documents, ____ settings determine where text begins on a line in relation to the left margin?
Setler79 [48]
<span>When attempting to format a given document for certain reasons, the marginal settings are the component that determine where the text will begin on the given line, and where it will be located in relation to the margins of the page, which allows creators to alter their documents to their needs.</span>
3 0
4 years ago
Use the drop-down menus to select the type of goal described in each statement. I want to finish all of my social studies homewo
nalin [4]

Answer:

I want to finish all of my social studies homework by dinner. - <u>Short term goal. </u>

Short term goals are targets that are to be achieved in the near and immediate future such as in a day or in a week. As the goal listed is to be done on the same day, it is a short term goal.

I want to graduate in three years in the top 15% of my class.  - <u>Normative Goal</u>

Normative goals are the goals people set based on what society looks upon as desirable and a good thing to do. Academic excellence is a normative goal as it is looked upon favorably by society.

I want to earn a good grade on my math test tomorrow. - <u>Intrapersonal goals.</u>

Intrapersonal goals are goals that we set within ourselves to motivate ourselves to do better. The writer here wants to do a good job in the math test which makes it intrapersonal.

I want to qualify for Honors Spanish next year. - <u>Long term goal</u>

A long term goal is one that is to be achieved in the future most likely after a period of a year. Qualifying for an Honors in Spanish in the next year is therefore a long term goal.

4 0
4 years ago
hi, I want to ask how do I change the Brainly to another country?, because I pressed the wrong Brainly button to my country​
Setler [38]

Answer:

I don't know maybe you should Uninstall

3 0
3 years ago
Read 2 more answers
Write a character literal representing the (upper case) letter<br> a.
Vlad1618 [11]
The answer would just be 'A'.  A literal is an element that directly represents a value.  In this case the element that directly represents the value false is simply the character 'A'.  When writing the answer the character should be in single quotes as that defines the value as a single character as opposed to a string or another data type.
5 0
4 years ago
The fastest way to get help is to type a word or two in the search box.
Elanso [62]
The fastest way to get help is to type a word or two in the search box. TRUE.
5 0
4 years ago
Other questions:
  • Which is the best description of a hierarchical report?
    13·1 answer
  • I need some cool things to do with windows command prompt.
    13·1 answer
  • A(n) ____ is a primary key that consists of a column that uniquely identifies an entity, such as a person's social security numb
    14·1 answer
  • What are 5 actions that you can do to take care of your camera
    14·2 answers
  • ____ allow us to store a binary image in code. (1 point)
    9·1 answer
  • What type of network component is Telnet?
    10·2 answers
  • How can you ensure that your web pages are compliant with a w3c standard?
    9·1 answer
  • Write a method intersect that accepts two sorted array lists of integers as parameters and returns a new list that contains only
    8·1 answer
  • Project: Baseline, Benchmark, Objective, and Goal
    14·2 answers
  • What other jobs would require employees to follow directions very carefully? (Give 4 examples)​
    9·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!