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

  Create a assembly language subroutine

Create a assembly language subroutine MULSUM that takes an array named A containing n bytes of positive numbers, and fills two arrays, array B containing n words and array C containing n long words

  Write a function in linux assembly

Write a function in Linux assembly

  Analog measurements

Prepare an assembly program for the correctly measures the wind direction

  Design a simple digital clock

Design a simple digital clock

  Write an assembly program

Prepare an Assembly program that reads in a number of cents.

  Write an assembly language program

Write an assembly language program for encrypting alphabates of a string

  Greatest common divisor of integers-masm assembly language

Must be done in MASM assembly language: Greatest common divisor of two integers is largest integer which will evenly divide both integers. GCD algorithm involves integer division in a loop.

  Write assembly program-find right admission price to movie

Write the Assembly program to find correct admission price to movie. Price of admission to a movie is $7 for kids (under 12) and $9 for adults.

  Create simple 8-bit alu using add-subtract-shift functions

Create a simple 8-bit ALU. Requirements:The eight functions that you will implement are: add, subtract, and, or, shift left logical, less than, shift right logical.

  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.

  Allot op-codes and add microcode to microprogram

Allot op-codes and add microcode to microprogram of Mic-1 to implement following instructions which are then included with IJVM instruction set.

  Write mips assembly program to read two non-negative numbers

Write MIPS assembly program to repeatedly read two non-negative integers and print integer product and quotient without using multiplication and division instructions.

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