PURPOSE Demonstrate what you have learned by writing an original assembly language program. TASK Write an original assembly language program, with a .doc file for each of your subroutines and one for...

1 answer below »


PURPOSE


Demonstrate what you have learned by writing an original assembly language program.



TASK


Write an original assembly language program, with a .doc file for each of your subroutines and one for your entire project. You may use any assembler you wish, including LC-3 or ARM (Raspberry Pi). If you use any assembly language other than LC-3 or ARM, you must supply a link to download the assembler you used, along with directions for its use.



  1. Here are the exact requirements for your program:

    1. Your program should behave like a high-level language program.

    2. Your program should have proper comments, including a header that identifies the program, the author, and the purpose.

    3. It should print a welcome message.

    4. It should print prompts to the console screen and input values from the keyboard.

    5. Input values should be validated. If they are not valid, you should inform the user and prompt them to try again.

    6. Output the result to the console screen, along with an appropriate prompt.

    7. Write a description of the entire project, the main file and the subroutines. If there are any special instructions for assembling and linking the project, the description should explain those as well.

    8. Each subroutine should have its own *.doc file.




Hints:


I suggest that you write a prime number detector, such as you designed in Exercises 1, 2 and 3. This will be sufficient for full credit.


For extra credit, write a program that you have previously written in a high-level language, such as Python or C++.


Break your program into subroutines. This will reduce the tedium in writing it. This will also make it easier to understand and to debug.


You may work on this a team. If you do:


Each member of the team should submit an original set of documentation. The project documentation should identify the submitter’s contribution to the project. In addition, each team member should submit their own copy of the *.s and *.doc files.






** if you can do this in python that would be great!

Answered 16 days AfterApr 19, 2021

Answer To: PURPOSE Demonstrate what you have learned by writing an original assembly language program. TASK...

Gaurav answered on Apr 23 2021
149 Votes
Introduction:
The program expects user to enter two numbers. The program then finds the modulus of
two numbers and prints results. The number are read from console as user input. Converted from ASCII to decimal for arithmetic operations and printed back as ASCII value for readable output.
High level program in C
Char result = char(num1 % num2);
Code:
.ORIG x3000
main_func    
        LEA R0,Prompt1Msg     ;; Prompt for input
    PUTS
        GETC                ;; get number from user
        PUTC                ;; echo back to user
        
        LD R1,ascii_0            ;; Subtract 48 from input to convert to decimal
        NOT R1,R1
        ADD R1,R1,#1            ;; two's complement of 48
        ADD R0,R0,R1            ;; Convert user input to decimal
        ST R0, num_n             ;; R0 stored in memory
        LEA R0,NewLine            ;; Prompt for...
SOLUTION.PDF

Answer To This Question Is Available To Download

Related Questions & Answers

More Questions »

Submit New Assignment

Copy and Paste Your Assignment Here