Question

In: Computer Science

Please make sure to read the instructions carefully! Must use P8! (A) Write the following assembly...

Please make sure to read the instructions carefully! Must use P8!

  • (A) Write the following assembly language program.
    • Start at 6 and counts down by 2 to 0. (No Loops!)
    • Comment each line except STOP and .END.
    • Add something to the output that makes this program uniquely yours.
    • Cut and paste the Assembler Listing into your document.
  • (B) Paste a screenshot of the Output area of the Pep8.
  • (C) Explain the status bits NZVC at the point STOP is loaded.

Assembler Listing

Screen Shot of Output Area

Explain the status bits NZVC

Solutions

Expert Solution

Greetings!!

A) Code:

BR main ;jump to main

prompt: .ascii "Enter a number: \x00" ;prompt message

out: .ascii "Output:\n" ;output message

nl: .ascii "\n" ;newline character

n: .word 2 ;declaring variable n

main: stro prompt,d ;display prompt message

deci n,d ;read number from the user

stro out,d ;display output message

deco n,d ;display the number as it is

stro nl,d ;newline

lda n,d ;load number to accumulator

suba 2,i ;subtract 2 from accumulator

sta n,d ;save to memory

deco n,d ;display number

stro nl,d ;newline

suba 2,i ;subtract 2

sta n,d ;save to memory

deco n,d ;display number

stro nl,d ;newline

suba 2,i ;subtract 2

sta n,d ;save to memory

deco n,d ;display number

stop

.end

Assembly listing:

-------------------------------------------------------------------------------

Object

Addr code Symbol Mnemon Operand Comment

-------------------------------------------------------------------------------

0000 04001F BR main

0003 456E74 prompt: .ASCII "Enter a number: \x00"

657220

61206E

756D62

65723A

2000

0014 4F7574 out: .ASCII "Output:\n"

707574

3A0A

001C 0A nl: .ASCII "\n"

001D 0002 n: .WORD 2

001F 410003 main: STRO prompt,d

0022 31001D DECI n,d

0025 410014 STRO out,d

0028 39001D DECO n,d

002B 41001C STRO nl,d

002E C1001D LDA n,d

0031 800002 SUBA 2,i

0034 E1001D STA n,d

0037 39001D DECO n,d

003A 41001C STRO nl,d

003D 800002 SUBA 2,i

0040 E1001D STA n,d

0043 39001D DECO n,d

0046 41001C STRO nl,d

0049 800002 SUBA 2,i

004C E1001D STA n,d

004F 39001D DECO n,d

0052 00 STOP

0053 .END

-------------------------------------------------------------------------------

Symbol table

--------------------------------------

Symbol Value Symbol Value

--------------------------------------

main 001F n 001D

nl 001C out 0014

prompt 0003

--------------------------------------

B) Output:

C) Flags:

Hope this helps


Related Solutions

Instructions: Please read problem carefully. Write the answers on the answer sheets provided. Make sure that...
Instructions: Please read problem carefully. Write the answers on the answer sheets provided. Make sure that you clearly show all of the work that went in to solving the problem. Partial credit will be awarded on each part of the problem, so make sure that you attempt each part. You are the marketing manager for TotalControl, an electronics company in Orangeburg. Your company produces a line of remote controls for use in home theaters. The company’s main product, the UR...
Please read the instructions and  find attached for the first wiki . Instructions for students: Read carefully...
Please read the instructions and  find attached for the first wiki . Instructions for students: Read carefully the attached document and then post your comments bearing in mind the following questions: 1- What are the pros and cons of rent controls? 2- Why economists disagree on the usefulness of rent control? 3- Do you believe rent control can help the poor? Edit Wiki Content rent control Rent regulation can take various forms, including rent control (the placing of a cap on...
C++ Please read the question carefully and make sure that the function prototypes given are used...
C++ Please read the question carefully and make sure that the function prototypes given are used correctly for both parts. This is one whole programming assignment so please make sure that it;s answered entirely not just one part. The output example is provided at the end of the question. First , write a program to create an array and fill it up with 20 randomly generated integers between 0 to 10 and output the array. Part 1: Write a function...
Instructions – PLEASE READ THEM CAREFULLY The Assignment must be submitted on Blackboard (WORD format only)...
Instructions – PLEASE READ THEM CAREFULLY The Assignment must be submitted on Blackboard (WORD format only) via allocated folder. Assignments submitted through email will not be accepted. Students are advised to make their work clear and well presented, marks may be reduced for poor presentation. This includes filling your information on the cover page. Students must mention question number clearly in their answer. Late submission will NOT be accepted. Avoid plagiarism, the work should be in your own words, copying...
Instructions – PLEASE READ THEM CAREFULLY The Assignment must be submitted on Blackboard (WORD format only)...
Instructions – PLEASE READ THEM CAREFULLY The Assignment must be submitted on Blackboard (WORD format only) via allocated folder. Assignments submitted through email will not be accepted. Students are advised to make their work clear and well presented, marks may be reduced for poor presentation. This includes filling your information on the cover page. Students must mention question number clearly in their answer. Late submission will NOT be accepted. Avoid plagiarism, the work should be in your own words, copying...
c++ Please read the instructions carefully. You must put the proper items in the proper file...
c++ Please read the instructions carefully. You must put the proper items in the proper file (eitehr SSandwich.h or SSandwich.cpp. Do NOT include any main function in your submission. You are encouraged to write your own main function to test what you are submitting. You are submit two files via BlackBoard: A file named SSandwich.h, a header file defining the class SSandwich. No inline methods are permitted. Any enum classes should be defined here also. Your header file should have...
Project Instructions Please read the following instructions and review the table below carefully. Then, enter answers...
Project Instructions Please read the following instructions and review the table below carefully. Then, enter answers for journal items [A] to [V] in the next item in this lesson, called Project 1 Part 1 Journal Entries for Accrual Accounting. You may keep these instructions open in a separate browser or download the instructions as a PDF, and open it as you work through the exercise. Illini Company, Inc. Balance Sheet as of 12/31/20X0 Assets Current Assets: Cash 1,500,000 Accounts receivable,...
Write a simple MIPS Assembly program to average 3 integers. Make sure to read in three...
Write a simple MIPS Assembly program to average 3 integers. Make sure to read in three numbers from the user instead of hard coding them. To divide the sum by 3 you may use div $t0, $t0, 3 where register $t0 conatins the sum of the 3 integers. .data prompt1: .asciiz " Please enter an integer: " prompt2: .asciiz " Please enter an integer: " prompt3: .asciiz " Please enter an integer: " result: .asciiz "The average of three number...
Please explain each step very carefully and make sure your handwriting is easy to read. Thank...
Please explain each step very carefully and make sure your handwriting is easy to read. Thank you Question: Suppose p(x) is a polynomial of degree n with coefficients in R and suppose p(x) has exactly n real roots. Show that p'(x) has exactly n-1 real roots.
Please Read Carefully Before start answering this question. Please follow the instructions. This Question is from...
Please Read Carefully Before start answering this question. Please follow the instructions. This Question is from 'BSBFIM501 Manage budgets and financial plans' course. There are no parts missing for this Question; guaranteed!. This is the original Screenshot direct from the question. Therefore, there are nothing any further information can be provided. Thanks for your understanding and Cooperation. Please answer the following questions from the topics discussed for Prepare, implement, monitor and modify contingency plans: 1.a. Explain the process of preparing...
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT