Computer Engineering questions

Please open the documents which are attached below, and follow the instructions and requirements in it.
hw7.docx

q4_hw7.txt

Don't use plagiarized sources. Get Your Custom Essay on
Computer Engineering questions
Just from $13/Page
Order Essay

q5_hw7.txt

Unformatted Attachment Preview

Problem 1 (5 points)
Identify 5 assembly errors in the following program:
.START x3004
AND R5, R5, Some
LD R5, STR
Forward ADD R5, R5, #1
BRz Forward
LDR R4, R5, #0
MUL R4, R4, #1
ST R4, STRING
Forward HALT
Some .FILL #0
STRZ .STRINGZ “HI!!!”
.STOP
Problem 2 (10 points)
Load the following program in PennSim and answer the following questions.
.ORIG x3000
LEA R1, STRZ
AND R2, R2, #0
LD R4, CHAR
REPEAT LDR R3, R1, #0
BRz FINISH
ADD R3, R3, R4
BRnp PASS
ADD R2, R2, #1
PASS ADD R1, R1, #1
;Branch if null
;Branch if not ‘ ‘
BR REPEAT
;Always branch
FINISH ST R2, COUNT
HALT
CHAR .FILL xFFE0
COUNT .FILL x0000
STRZ .STRINGZ “This is CS252!”
.END
a) Show the symbol table created by the assembler for the above program.
Symbol Name
Address
b) How many times is the instruction at label “REPEAT” executed?
c) How many times is the instruction at label “PASS” executed?
d) Describe what this program does in 1-2 sentences.
Problem 3 (6 points)
You are given two pieces of program. They have been written by different programmers to store
x0018 into memory location x6000.
a.
.ORIG x5000
AND R2,R2,#0
ADD R2,R2,#15
ADD R2,R2,#9
STI R2,PTR

HALT
PTR .FILL x6000
.END
b.
.ORIG x6000
.FILL x0018
.END
a) Why there are two ‘ADD’ instructions in module (a)?
b) Explain the fundamental differences in their approaches?
c) Give one example where approach of module a is preferred.
Problem 4 (15 points)
In this problem, you will write an assembly code that will implement a circular left shift by 6 bits.
If you have a binary string 00000011 then the result after circular left shifting by 6 bits will be
11000000. The program we want you to design should take in a 16-bit value at memory location
Loc1. Implement the circular left shifting operation by 6 bits and store the 16-bit result in Loc2.
You can declare the memory locations Loc1 and Loc2 using .BLKW directive. For example, if
[Loc1]=0xF000 then after execution of the program [Loc2] = 0x003C. Your code should start
at memory location 0x3000.
Your code will be graded through automated scripts. You should name your file as
hw7_q4.asm. Files with names other than q4.asm will not be recognized by the automated
script. To check the functionality of your code, you may run the given sample script for this
question using the command mentioned below. However, graders may check the working of
code using values different then used in the sample script.
script q4_hw7.txt
If your test passes successfully, you have to see the message “TRUE(check M3 xC03F)” in the
last line of command output window. Any other message that includes “FALSE(check M3
xC03F)”, indicates your test is failed.
Problem 5 (15 points)
In this problem, you will write a LC-3 assembly code that removes blank spaces from a
string. Assume that the string starts at memory location 0x5000, and is terminated by a ‘’
character (ASCII value = 0). Your program should store the modified string in the memory
location starting at 0x5100. You do not need to modify the original string stored at 0x5000.
You can assume that the original string at 0x5000 will always be less than 100 characters in
length, and it will always start with a letter (A-Z, lowercase or uppercase possible).
Note: If the modified string has 7 characters, and the original string has 15 characters, the
last 8 characters of your modified string should be all ‘%’ (ASCII value = 0x25).
For example: If the original string at 0x5000 was “aa 12 d e f”, the modified string at
0x5100 after your program completes execution should be “aa12def%%%%”.
Note that the original string has 4 blank space characters, and the modified string has 4
extra “%” in the end. Your code should start at memory location 0x3000.
Your code will be graded through automated scripts. You should name your file as
hw7_q5.asm. Files with names other than q5.asm will not be recognized by the automated
script. To check the functionality of your code, you may run the given sample script for this
question using the command mentioned below. However, graders may check the working of
code using values different then used in the sample script.
script q5_hw7.txt
reset
as
as
load
load
lc3os.asm
hw7_q4.asm
lc3os.obj
hw7_q4.obj
set
Loc1 xFF00
break set
STOP
set pc x3000
continue
check Loc2 xC03F
reset
as lc3os.asm
ld lc3os.obj
as q5.asm
ld q5.obj
set pc x3000
set
set
set
set
set
set
set
set
set
x5100
x5101
x5102
x5103
x5104
x5105
x5106
x5107
x5108
xffff
xffff
xffff
xffff
xffff
xffff
xffff
xffff
xffff
set
set
set
set
set
set
set
set
set
x5000
x5001
x5002
x5003
x5004
x5005
x5006
x5007
x5008
x43
x44
x45
x20
x20
x46
x20
x20
x0
continue
check x5100
check x5101
check x5102
check x5103
check x5104
check x5105
check x5106
check x5107
check x5108
x43
x44
x45
x46
x25
x25
x25
x25
x0

Purchase answer to see full
attachment

GradeAcers
Calculate your paper price
Pages (550 words)
Approximate price: -

Why Work with Us

Top Quality and Well-Researched Papers

We always make sure that writers follow all your instructions precisely. You can choose your academic level: high school, college/university or professional, and we will assign a writer who has a respective degree.

Professional and Experienced Academic Writers

We have a team of professional writers with experience in academic and business writing. Many are native speakers and able to perform any task for which you need help.

Free Unlimited Revisions

If you think we missed something, send your order for a free revision. You have 10 days to submit the order for review after you have received the final document. You can do this yourself after logging into your personal account or by contacting our support.

Prompt Delivery and 100% Money-Back-Guarantee

All papers are always delivered on time. In case we need more time to master your paper, we may contact you regarding the deadline extension. In case you cannot provide us with more time, a 100% refund is guaranteed.

Original & Confidential

We use several writing tools checks to ensure that all documents you receive are free from plagiarism. Our editors carefully review all quotations in the text. We also promise maximum confidentiality in all of our services.

24/7 Customer Support

Our support agents are available 24 hours a day 7 days a week and committed to providing you with the best customer experience. Get in touch whenever you need any assistance.

Try it now!

Calculate the price of your order

Total price:
$0.00

How it works?

Follow these simple steps to get your paper done

Place your order

Fill in the order form and provide all details of your assignment.

Proceed with the payment

Choose the payment system that suits you most.

Receive the final file

Once your paper is ready, we will email it to you.

Our Services

No need to work on your paper at night. Sleep tight, we will cover your back. We offer all kinds of writing services.

Essays

Essay Writing Service

No matter what kind of academic paper you need and how urgent you need it, you are welcome to choose your academic level and the type of your paper at an affordable price. We take care of all your paper needs and give a 24/7 customer care support system.

Admissions

Admission Essays & Business Writing Help

An admission essay is an essay or other written statement by a candidate, often a potential student enrolling in a college, university, or graduate school. You can be rest assurred that through our service we will write the best admission essay for you.

Reviews

Editing Support

Our academic writers and editors make the necessary changes to your paper so that it is polished. We also format your document by correctly quoting the sources and creating reference lists in the formats APA, Harvard, MLA, Chicago / Turabian.

Reviews

Revision Support

If you think your paper could be improved, you can request a review. In this case, your paper will be checked by the writer or assigned to an editor. You can use this option as many times as you see fit. This is free because we want you to be completely satisfied with the service offered.

Order your essay today and save 15% with the discount code DISCOUNT15