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
LuckyWell [14K]
3 years ago
15

Your assignment is to write an assembly language program which read a string and print it in uppercase. This program asks the us

er to enter a string which is subsequently displayed in uppercase. It is important to first ensure that string to be converted is in the a-z range. The program does not recognize any space, symbols or any kind of punctuation marks. Any time the user enters any of this character the program is going to repeatedly ask for the valid string. An example execution of your program could be:________
Computers and Technology
1 answer:
-BARSIC- [3]3 years ago
4 0

Answer:

Check the explanation

Explanation:

.data

prompt: .asciiz "Please enter your string :"

result_str: .asciiz "\nYour captalized string :"

error_prompt: .asciiz "\nInvalid Entry !"

buffer: .space 20

.text

.globl __start

__start:

ASKING_STR:

la $a0,prompt

li $v0,4

syscall

li $v0,8 #take in input

la $a0, buffer #load byte space into address

li $a1, 20 # allot the byte space for string

move $t0,$a0 #save string to t0

syscall

li $v0, 4

li $t0, 0

loop:

lb $t1, buffer($t0)

beq $t1, 0, exit

slti $t2,$t1,91

bne $t2,$0,UPPER_CHECK

slti $t2,$t1,123

bne $t2,$0,LOWER_TO_UPPER

UPPER_CHECK:

slti $t2,$t1,65

bne $t2,$0,INVALID_ENTRY

slti $t2,$t1,90

bne $t2,$0,NEXT

j INVALID_ENTRY

LOWER_TO_UPPER:

sub $t1, $t1, 32

sb $t1, buffer($t0)

NEXT:

addi $t0, $t0, 1

j loop

INVALID_ENTRY:

li $v0, 4

la $a0, error_prompt

syscall

j ASKING_STR

exit:

li $v0, 4

la $a0, result_str

syscall

li $v0, 4

la $a0, buffer

syscall

li $v0, 10

syscall

You might be interested in
In chapter 11, we finally learn how the book got its title. What is the sign of the beaver? Is that what you expected when you r
Ostrovityanka [42]

Answer:

:D

Explanation:

Literally speaking, the sign of the beaver is a scratched pattern the Beaver clan uses to mark their territory. Symbolically, though, it lets other clans know not to hunt on the land it marks.

Authors help readers understand their characters in two different ways: direct characterization and indirect characterization. When an author uses words and phrases that describe a character, it's called direct characterization.

Some books use this technique more than others. Although direct characterization can be interesting if done well, most authors prefer to present their characters using indirect characterization—that is, by showing the reader what characters are like by how they act, what they think, and what other people say about them.

3 0
3 years ago
Where should Nolan go to change the font size of his message before printing it? A.the Paper tab in the Define Styles dialog box
Ahat [919]
<span>D.dialog box the Format tab in the Page Setup dialog box' is the answer. Hope I helped!</span>
8 0
3 years ago
What is the purpose of the operating system's processor management function?
Sloan [31]
The purpose of the operating system's processor management function is that it allows you to run multiple programs on your computer simultaneously. 
5 0
3 years ago
Assume the existence of a class named window with functions named close and freeresources, both of which accept no parameters an
denis-greek [22]
In your question whereas there is a class named window and it would be like this:

class window {
//code here 
}

Next is there is a function called close and freeresource and it goes like this:

class window{
  function close( ){
   //code here
  }
  function freeresource( ){
  // code here
  }
 public destruct (){
this.close();
this.freeresource();
}

}
The last code function destruct invokes the function close and freeresource. Hope this would help 

7 0
3 years ago
What is one pass of a coding sequence called?​
Oksi-84 [34.3K]

Answer:

In computer programming, a one-pass compiler is a compiler that passes through the parts of each compilation unit only once, immediately translating each part into its final machine code. ... This refers to the logical functioning of the compiler, not to the actual reading of the source file once only.

Explanation:

8 0
3 years ago
Read 2 more answers
Other questions:
  • Wireless network devices use ________ to communicate with each other.
    9·2 answers
  • GUI stands for "___ user interface."
    9·2 answers
  • Suppose we provide a new implementation of the transport layer protocol tcp providing the same functionality using different alg
    14·1 answer
  • A large IPv4 datagram is fragmented into 4 fragments at router 1 to pass over a network with an MTU of 1500 bytes. Assume each f
    15·1 answer
  • Which one is correct
    8·1 answer
  • An example of creative curating is when a:
    9·1 answer
  • Write a SELECT statement that returns three columns: EmailAddress, OrderID, and the order total for each customer. To do this, y
    14·1 answer
  • Which of the following is the BEST reason to use cash for making purchases? everfi
    15·1 answer
  • A swimming pool has a length of 28 feet, a width of 17 feet, and a depth of 6 feet. How much water can the swimming pool hold?
    10·1 answer
  • Which of the following statements describes the general idea of an assistive media​
    7·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!