Develop a program that will implement conditional statement

Assignment Help Assembly Language
Reference no: EM131398276

Project- Assembly Language Programming.

Description:

This project will be done in parts that will increase in complexity. Each portion is to be submitted online separately. In the assembly file for each section you must place a pair of comments identifying yourself and the section that you are working on.

# Name: Jerry Heuring
# Project 1: Section 1

Details:

Section 1:

Using the MARS or SPIM simulator develop a program that will evaluate the following expression:

3 * n + n * (n - 1) - 15

where n is stored in a data location and is set to 15. Your program should use the system calls to print the result and to exit the program.

Section 2:

Using the MARS or SPIM simulator develop a program that will implement the following conditional statement.

If ( n is even) {
n = n / 2;
} else {
n = 3 * n + 1;
}

In this case, n is to be input by the user (assume they input a non-negative value), the conditional is performed, and the resulting n is to be output. Again, use the system calls for input, output, and exiting the program. Hint: There is a remainder pseudoinstruction for the MIPS architecture that you can use to determine if the value is even or odd or you can look at bit 0 to determine if the value is even or odd.

Section 3:

You are to take the conditional from the previous section and build a loop around it to find the Collatz sequence. The structure of this would be:

while (n > 1) {
If (n is even) {
n = n / 2;
} else {
n = 3 * n + 1;
}
cout << n;
}

Section 4:

You are to write a leaf subprogram that will output the following information:

Your Name
Your favorite color
Your favorite sports team
The main program should call your leaf routine and then exit using the system call.

Section 5:

Write a program with a leaf subprogram that will take two values in $a0 and $a1 and compute their greatest common divisor. The greatest common divisor should be returned in the $v0 register. The main program should input the values for $a0 and $a1 using system calls, call your subprogram, and then output the result using a system call.

Submission:

There are locations for you to submit the assignment available in BlackBoard. You need to upload only the .asm (assembly language) file. There is a different location for EACH section..

Reference no: EM131398276

Questions Cloud

Discuss the concept of image : Discuss the concept of "image." How does image affect one's interpretation of an organization? How does it affect how one approaches organizational issues? How does image affect function and outcomes in an organization?
What is meant by neuroplasticity of the pain pathways : What is meant by "neuroplasticity" of the pain pathways? Could this phenomenon provide viable alternatives to use of pain meds in the clinical management of patients
Hypothesize how the political marketplace dealt : Using smoke-free laws as an example, research how and why such laws come about. Analyze the stakeholders involved and hypothesize how the political marketplace dealt with the issue.
Analyze network function virtualization and cloud computing : Analysis of network function virtualization and cloud computing. Examination of opportunities and challenges (e.g., security, cost, reliability, and availability). Videos, audio, photos, diagrams, or graphs as appropriate.
Develop a program that will implement conditional statement : EECS 2110- Using the MARS or SPIM simulator develop a program that will implement the following conditional statement. Write a program with a leaf subprogram that will take two values in $a0 and $a1 and compute their greatest common divisor.
Definition of a global citizen : ou are asked to write a research essay addressing each one of the following subjects: Your definition of a global citizen, Doing Business in Brazil and The challenges of living in Brazil
How the speech content and presentation might differ : You will then begin to write your post in narrative form by describing how the speech content and presentation might differ for the two audiences in regard to the specific topic and the delivery of the speech
Discuss the underlying rationale and motivation : Discuss the underlying rationale/motivation for UN climate change conference in Paris. Highlight the successes and/or failures of the conference...be specific. Who are beneficiaries of this landmark agreement if any?
Describe which form of market efficiency is consistent : The CFO of a certain company always wears his green suit on a day that the firm is about to release positive information about his company. You believe that you can profit from this information by buying the firm’s shares at the beginning of every da..

Reviews

Write a Review

Assembly Language Questions & Answers

  Write a mips assembly language program

Write a MIPS assembly language program that prompts for a user to enter a series of floating point numbers and calls read_float to read in numbers and store them in an array. Then the program should display the array content on the console window. Th..

  Write two (2) arm assembly language subroutines

Write two (2) ARM assembly language subroutines, called output_char and read_char

  Implement the above fib function in assembly

Implement the above fib function in assembly, i.e., translate fib into an equivalent assembly procedure; Implement your main procedure which lets the user enter the number n, calls procedure fib to get the nth Fibonacci number.

  What is the maximum number of one-address instructions

A certain machine has 16-bit instructions and 6-bit addresses. Some instructions have one address and others have two. If there are n two-address instructions, what is the maximum number of one-address instructions?

  Build an 8088 assembler

In this project, you will build an 8088 assembler. The job of your assembler is to turn 8088 assembly code (i.e., the 8086 assembly code language) into 8088 machine code that executes in an DOS emulator.

  Assembler equivalents virgo for common c control flow

Assembler equivalents (Virgo) for common C control flow instructions. This will give you an appreciation for how control flow is implemented in assembly (and machine) language. You will find that it is not quite as simple as it is with a high- level ..

  Write assembly program print binary representation-integers

Write the assembly program called hw6_ex1, stored in file hw6_ex1.asm. This program must prompt user to enter signed 32-bit integer. Program must print out binary representation of the integer.

  Implement in lc-3 assembly language

CPS2390 Computer Organization and Architecture - Implement, in LC-3 assembly language, an encryption and a decryption programs and Subtract the encryption key from the ASCII code.

  Prepare a program in mips assembly language

Prepare a program in MIPS assembly language that reads in a sequence of signed 32-bit integers (words) and return the maximum, the minimum, and the median value of the input sequence.

  Create a assembly language subroutine mulsum that takes an

create a assembly language subroutine mulsum that takes an array named a containing n bytes of positive numbers and

  Stack structure for unsigned integers

Write a program to push 10 items into your stack, and pop them out - Use MARIE's ISA program a stack structure for unsigned integers.

  Requirementsthis project requires you to program a

requirementsthis project requires you to program a maze-type game using assembly language. it is not acceptable to use

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd