Description

Description

Student Details: CRN:

Name:

Name:

Name:

ID:

ID:

ID:

2

Restricted – مقيد

Pg. 01

Task 3: Modulus Operation<> “Error*” “Task 3: Modulus Operation Task 3: Modulus Operation

Learning Outcome(s):

Develop assembly language programs.

Description and Instructions

This project is designed to help you become familiar with the MARIE architecture and its assembly language instructions. By completing this project, you will develop a basic program using MARIE instructions, demonstrating your understanding of fundamental computer architecture concepts. The project includes both basic and advanced tasks to challenge your understanding of MARIE assembly programming. Please use the online tool and provide a screenshot of the result for each task.

Task 1: Addition and SubstructionOperations

For this task, you are required to write a MARIE program that performs the following operations using assembly language instructions:
1. Take two inputs from the user.
2. Perform addition and subtraction on the two input values.
3. Display the results of both operations.

Requirements:

• The program should take two inputs (numbers) from the user and store them in memory.
• It should load the numbers from memory and perform addition and subtraction using the appropriate MARIE instructions.
• The program must display the results of both the addition and subtraction.
• Ensure that the program halts after displaying the results.

Example Input/Output:

Input 1: 8
Input 2: 5
Output: Sum = 13, Difference = 3

Task 2: Multiplication and Division Operations

Building on the first task, this advanced task requires you to enhance the program by adding multiplication and division operations. You should then display the results of these operations in addition to the sum and difference.

Requirements:

• Implement multiplication using a loop (as MARIE has no direct multiplication instruction).
• Implement division using repeated subtraction.
• Display the results of all four operations: addition, subtraction, multiplication, and division.
• Ensure that the program halts after displaying all the results.

Example Input/Output:

Input 1: 6
Input 2: 2
Output: Sum = 8, Difference = 4, Product = 12, Quotient = 3

Task 3: Modulus Operation

For this bonus task, implement a modulus operation (remainder of division) as part of your program. This will further challenge your understanding of MARIE assembly instructions and loops.

Requirements:

• Implement the modulus operation using repeated subtraction.
• Display the result of the modulus in addition to the sum, difference, product, and quotient.
• Ensure that the program halts after displaying all results.

Example Input/Output:

Input 1: 7
Input 2: 3
Output: Sum = 10, Difference = 4, Product = 21, Quotient = 2, Remainder = 1

General Requirements:

Your code must be clearly commented and organized, explaining the purpose of each section and how it works.
• Make sure to name memory locations appropriately (e.g., num1, num2, result).
• You must demonstrate proper use of MARIE instructions, including loops and conditional statements.
• Ensure that the program is readable and well-structured.

MARIE Instruction Set Guide

Instruction

Operation

Use Example

Explanation

Load X

Load the value stored at memory location X into the Accumulator (AC).

Load num1

Loads the value from memory location num1 into the AC for further operations.

Store X

Store the value in the Accumulator into memory location X.

Store result

Stores the current value in the AC into memory location result.

Add X

Add the value stored at memory location X to the value in the Accumulator.

Add num2

Adds the value from memory location num2 to the value in the AC.

Subt X

Subtract the value stored at memory location X from the value in the Accumulator.

Subt num2

Subtracts the value from memory location num2 from the AC.

Input

Take a value from the user input and store it in the Accumulator.

Input

Takes an input from the user and stores it in the AC.

Output

Output the value in the Accumulator to the screen.

Output

Outputs the current value in the AC to the screen.

Halt

Stop the program execution.

Halt

Ends the program execution.

Skipcond X

Skip the next instruction based on the value in the Accumulator.

Skipcond 400

Skips the next instruction if the condition is met (e.g., Skipcond 400 skips if AC = 0).

Jump X

Unconditionally jump to the instruction located at memory location X.

Jump Loop

Redirects execution to the instruction at Loop. Useful for loops or unconditional branches.

Clear

Set the value of the Accumulator to zero.

Clear

Resets the AC to 0. Useful before performing arithmetic operations.

JNS X

Store the address of the next instruction in X, then jump to X + 1.

JNS Subroutine

Used for jumping to subroutines and returning later.

JnS X

Save the address of the next instruction in memory location X and jump to X + 1.

JnS Subroutine

Typically used for subroutines, allowing for modular programming.

Working with Loops

Loop and conditional logic using Jump, Skipcond, and arithmetic instructions.

Jump Loop

Implemented using Jump, Skipcond, and arithmetic operations for tasks like multiplication and division in a loop.

Restricted – مقيد

Share This Post

Email
WhatsApp
Facebook
Twitter
LinkedIn
Pinterest
Reddit

Order a Similar Paper and get 15% Discount on your First Order

Related Questions

Description

Description Instructions: Students can work in groups of two or individually to complete the project. The students may use POM and/or Microsoft Excel to answer the questions. Submit only soft copy by Moodle. Please fill and attach the cover sheet before submission. Plagiarized projects will be given 0 marks. If

Description

Description Evidence required: ➢ Written responses to each of the ten instructions ➢ Assessment Criteria as headings for each answer. ➢ Professionally presented answers, with in-text Harvard Referencing to support them. ➢ End Reference list. ➢ 3,900 (+/-10%) words in total. 5OS065Assessment Level Associate Walkthrough Diploma Learning Outcome 3 Asked

Description

Description My final project yahya and another document structure to be followed. Jeddah International College Business Administration Department Digital Transformation and the Future of Work in Saudi Mining: Impacts of Automation on Jobs, Skills, and Transition Strategies In Partial Fulfillment of Master of Business Administration (MBA Prepared by Yahya Mabrook

Description

Description My final project yahya and another document structure to be followed. Jeddah International College Business Administration Department Digital Transformation and the Future of Work in Saudi Mining: Impacts of Automation on Jobs, Skills, and Transition Strategies In Partial Fulfillment of Master of Business Administration (MBA Prepared by Yahya Mabrook

Description

Description Instructions: Students should work individually to complete the case study. Submit only soft copy by Moodle. Please fill and attach the cover sheet before submission. Plagiarized case study will be given 0 marks. If the case study is submitted late, marks will be deducted. Operations Management– MB 504 Case

Description

Description Submit: Only Soft copy on Moodle. Students can work in teams of two or submit the assignment individually. Use the proper format (font, font size, spacing). In case of late submissions your marks will be deducted. Plagiarism is strictly forbidden. Any assignments that have copied material will be given

Description

Description the task is to answer presentation qustions

Description

Description I need a research about company ( BED AND BEYOND) closed cuz shortage of cash the main reason – I need a professional research cover all the side of the company, financial and accounting use SWAT ANALYSIS their financial statements if they have , why it’s closed? Cover everything

Description

Description I need a research about company ( BED AND BEYOND) closed cuz shortage of cash the main reason – I need a professional research cover all the side of the company, financial and accounting use SWAT ANALYSIS their financial statements if they have , why it’s closed? Cover everything

Description

Description I want a beautiful presentation with clear and beautiful pictures.

Description

Description IPC in labsI want a beautiful presentation with clear and beautiful pictures.

Description

Description IPC in Radio diagnosis and interventional radiology I want a beautiful presentation with clear and beautiful pictures.

Description

Description see College of Computing and Informatics Project Deadline: Monday 21/04/2025 @ 23:59 [Total Mark for this Assignment is 14] Students Details: CRN: ### Name: ### Name: ### Name: ### ID: ### ID: ### ID: ### Instructions: • You must submit two separate copies (one Word file and one PDF

Description

Description i want ppt good very good and add photo for each slide topic: Saudi Arabia’s contributions to combating epidemics globally… NGO efforts Stop TB partnership partners with at least two Saudi NGOs: Dr. Abdul rahman Al Mishari Hospital and Al Salam Hospital. NGOs are non-governmental organizations (NGOs). These organizations

Description

Description A report, referring to the above scenario, with written responses to each of the 10instructions above. • Approximately 3900 words in total, refer to CIPD word count policy. Please tick whether you are submitting a draft or your summative assessment: Draft ☐ ☐ Summative Complete the first part of

Description

Description Research Structure: 1. Introduction – Background of the mining industry in general and in KSA. – Importance of digitization and automation. – Objectives of my study. 2. Theoretical Framework – Concepts and theories related to digitization, automation, and the future of work. 3. Literature Review – Summary of existing

Description

Description See College of Health Sciences Department of Health Informatics ASSIGNMENT COVER SHEET Course name: Public health outbreak and disaster management Course number: PHC 372 Assignment title The Role of Technology in Public Health Disaster Management “Natural disasters have always been a significant threat to human lives and infrastructure, causing

Description

Description See College of Health Sciences Department of Public Health ASSIGNMENT COVER SHEET Course name Maternal and Child Health Course number PHC 373 CRN – Branch name XXXXX Assignment title or task: ( write and questions) Discuss the methods, advantages, and criticisms of evidence-based practice in maternal and child health