Hello,I have to build a program using assembly with Mars system.

The program is supposed to return a hailstone Sequence

A)- get user input (integer) - N

B) check if even or odd

- if the input is even, the next number should N/2

- if the user's input (N*3)+1

C) reproduce the operation on the next number until the number is equal to 1

D) display the sequence

E) count and display the number of iterartion

I have the user input done, and then, I tried to do a bitwise operation using AND to see if the number is even or not but the program doesn't work after the user's input, as i have an output equal to zero

can you help me please?

here is my code so far

.data

prompt: .asciiz "enter an integer:"
message1: .asciiz "you entered an even number"
message2: .asciiz "you entered an odd number"
message3: .asciiz "and the next numbers should be:"
gototheline: .asciiz "\n"
message4: .asciiz "you just entered the number:"



.text
main:

#print the prompt
li $v0,4
la $a0,prompt
syscall

#get the user's input
li $v0,5
syscall

#store the input'svalue
move $t3, $v0

#display the user's input message
li $v0,4
la $a0,message4
syscall

#go to the line
li $v0,4
la $a0,gototheline
syscall

#print value entered by user
li $v0,1
move $a0, $t3
syscall

#go to the line
li $v0,4
la $a0,gototheline
syscall

#bitwise operation on the input
and $a0,$0,1

#call odd function if number is odd
beq $a0,1,ifodd

#print next number message
li $v0, 4
la,$a0,message3
syscall

#go to the line
li $v0,4
la $a0,gototheline
syscall

#print result
li $v0,1
addi $a0,$v1,0
syscall

li $v0,10
syscall

ifeven:
#print message if even
la $a1,message1
syscall

#call the function operation even to do math on the number entered by user
jal operationeven

ifodd:
#print message if odd
la $a2,message2
syscall

#call method to do math on the number entered by user
jal operationodd


operationeven:
#if even N/2
div $v1,$t3,2 # return value on $v1

jr $ra #go back to the main

operationodd:

#multiply by 3
mul $t1,$t3,3

#add 1 to the result of the multiplication
add $v1, $t1,1 #return value on $v1

jr $ra #go back to the main

Answers

Answer 1
Answer: I think you should get used input

Related Questions

What is the relationship between privacy, freedom and security?
Why is it important to place the sheave wheel in exactly the right place on the head frame?
The _________ lets you move the view of a web page up or down and left or right.A.Task barB. Scroll barC. Menu barD. Location bar
All of the following are career pathways for Arts, Audio/Video Technology, and Communications except:
In pseudocode you can use the _________ library function to determine whether a character is an alphabetic letter.

How has technology impacted society and education throughout history? What innovation has had the most profound impact on education?

Answers

technology has impacted society by giving us a way to keep records, data, and documents. Technology has helped us on the education side by giving us a way to do projects, helping us study, and letting us email teachers.

How do you delete extensions on a chrome book bought on the chrome web store?

Answers

If you're using google chrome if you look in the top right corner there are a button with 3 horizontal lines, click it, once you do that go down that list and click settings once you click that, hit extensions on the left side of the screen, after that you will see a list of extension you have find the extension you would like to delete and look far right to the extension and click the trash can. Once you click the trash can a pop up will appear and will say "Confirm Removal"  and under that "Remove_______" If that is the extension you would like to remove continue if not go back to finding that extension If it is click remove
 look in the top right corner there are a button with 3 horizontal lines, click it, once you do that go down that list and click settings once you click that, hit extensions on the left side of the screen, after that you will see a list of extension you have find the extension you would like to delete and look far right to the extension and click the trash can. Once you click the trash can a pop up will appear and will say "Confirm Removal"  and under that "Remove_______" If that is the extension you would like to remove continue if not go back to finding that extension If it is click remove

Once I have entered text into a presentation, how do I modify the font style of the text? Select the text and use options available on the Format Text tab. Fonts cannot be modified in the PowerPoint application. Select the text and use the format options available on the Home tab. Delete the text and retype it after you have selected the appropriate format.

Answers

Select the text and use options available on the Format Text.

The Microsoft Office package offers a variety of options and is a very powerful tool for text modification. Among these tools is also Powerpoint (if you're talking about PowerPoint). All of them in any case make available text modification and Text formatting. 
If you are using Microsoft Word(which i would recommend) then go to the top left corner of the screen and there should be a font section where you can select a font and right next to it is the sizing range for the size of your letters. It depends on the format or the way it fits into the screen. I have an Apple Mac at my house and i use Microsoft Word. I also use a Microsoft computer at my school in digital literacy class.

The general who directed the project responsible for the "Fat Man” graduated from what alma mater in 1918?

Answers

Stafford Leak Warren (July 19, 1896 - July 26, 1981) was an American physician and ... He was responsible for the health and safety of the thousands of personnel ... The medical school had opened in 1925 and did not graduate its first class ... BrigadierGeneral Leslie R. Groves, the director of the Manhattan Project 
It was an director of an Manhattan project.

His name was "Brigadier General Leslie R."

He was the one who graduated from MIT and responsible for "The Fat Man"

Which problems result in a positive number? Choose all answers that are correct. A. –6 – (–8.1) B. C. 7.5 – (–1.4) D. –5.7 + 2.4

Answers

-6 - -8 = 2 so (A) is correct and 7.5 - -1.4= 8.9 so (C) is correct the rest result in negative numbers 
~Riley
You're answers would be A. and C. because of the if you subtract a negative and a negative, they will ALWAYS equal a positive, and a positive and positive will equal a positive, but a negative AND a positive will equal negative. 
I hope I helped! =D

The loss of data, the possibility of viruses, and networks shutting down are all examples of

Answers

The errors of an computer or electronic device
other websites that could put the virus on the computer