1. What is the value of the PC while executing instructions #12 and #18? 2. What is the calculated displacement at instruction #14? Explain your answer. 3. What is the machine code (in hexadecimal) of instructions #09 and #16? 4. What is the value of the SP right after executing instruction #15? 5. What is the value of the SP at the end of the program? 6. What is the long value stored at address $6002 and the value of DO after the execution of the program? 7. What's the value at the X and C flags in the CCR register after executing #10 in the first iteration of the loop?

Computer Networking: A Top-Down Approach (7th Edition)
7th Edition
ISBN:9780133594140
Author:James Kurose, Keith Ross
Publisher:James Kurose, Keith Ross
Chapter1: Computer Networks And The Internet
Section: Chapter Questions
Problem R1RQ: What is the difference between a host and an end system? List several different types of end...
icon
Related questions
Question
Given the following assembly code snippet, assume <SP> = $9000.
Line #: memory address
Assembly code
00: 00001000
LEA $6000, A1
01: 00001004
MOVE.W #%1000000000000001, (A1)+
02: 00001008
MOVE.W #%1100000000000011, (A1)+
03: 0000100C
MOVE.W #%1110000000000111, (A1)+
04: 00001010
MOVE.W #%1111000000001111, (A1)+
05: 00001014
MOVE.W #%1111100000011111, (A1)
06: 00001018
LEA $6000, A1
07: 0000101C
MOVE.B #0, DO
08: 00001020
LOOP1
MOVE.W (A1)+, D1
09: 00001022
AND.W #$00FF, D1
10: 00001026
LSR #1, D1
11: 00001028
MOVE.W D1, -(SP)
12: 0000102A
ADDQ.B #1,DO
13: 0000102c
CMP.B #5, DO
14: 00001030
BLT LOOP1
15: 00001032
LEA $6000, A1
16: 00001036
MOVE.B #0, DO
17: 0000103A
LOOP2
MOVE.W (SP)+, (A1)+
18: 0000103C
ADDQ.B #1,DO
19: 0000103E
CMP.B #5, DO
20: 00001042
BLT LOOP2
Answer the following questions, provide all values in hexadecimal.
1. What is the value of the PC while executing instructions #12 and #18?
2. What is the calculated displacement at instruction #14? Explain your answer.
3. What is the machine code (in hexadecimal) of instructions #09 and #16?
4. What is the value of the SP right after executing instruction #15?
5. What is the value of the SP at the end of the program?
6. What is the long value stored at address $6002 and the value of DO after the execution of the
program?
7. What's the value at the X and C flags in the CCR register after executing #10 in the first iteration
of the loop?
Transcribed Image Text:Given the following assembly code snippet, assume <SP> = $9000. Line #: memory address Assembly code 00: 00001000 LEA $6000, A1 01: 00001004 MOVE.W #%1000000000000001, (A1)+ 02: 00001008 MOVE.W #%1100000000000011, (A1)+ 03: 0000100C MOVE.W #%1110000000000111, (A1)+ 04: 00001010 MOVE.W #%1111000000001111, (A1)+ 05: 00001014 MOVE.W #%1111100000011111, (A1) 06: 00001018 LEA $6000, A1 07: 0000101C MOVE.B #0, DO 08: 00001020 LOOP1 MOVE.W (A1)+, D1 09: 00001022 AND.W #$00FF, D1 10: 00001026 LSR #1, D1 11: 00001028 MOVE.W D1, -(SP) 12: 0000102A ADDQ.B #1,DO 13: 0000102c CMP.B #5, DO 14: 00001030 BLT LOOP1 15: 00001032 LEA $6000, A1 16: 00001036 MOVE.B #0, DO 17: 0000103A LOOP2 MOVE.W (SP)+, (A1)+ 18: 0000103C ADDQ.B #1,DO 19: 0000103E CMP.B #5, DO 20: 00001042 BLT LOOP2 Answer the following questions, provide all values in hexadecimal. 1. What is the value of the PC while executing instructions #12 and #18? 2. What is the calculated displacement at instruction #14? Explain your answer. 3. What is the machine code (in hexadecimal) of instructions #09 and #16? 4. What is the value of the SP right after executing instruction #15? 5. What is the value of the SP at the end of the program? 6. What is the long value stored at address $6002 and the value of DO after the execution of the program? 7. What's the value at the X and C flags in the CCR register after executing #10 in the first iteration of the loop?
Expert Solution
Step 1

Computer Engineering homework question answer, step 1, image 1

trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 2 steps with 2 images

Blurred answer
Recommended textbooks for you
Computer Networking: A Top-Down Approach (7th Edi…
Computer Networking: A Top-Down Approach (7th Edi…
Computer Engineering
ISBN:
9780133594140
Author:
James Kurose, Keith Ross
Publisher:
PEARSON
Computer Organization and Design MIPS Edition, Fi…
Computer Organization and Design MIPS Edition, Fi…
Computer Engineering
ISBN:
9780124077263
Author:
David A. Patterson, John L. Hennessy
Publisher:
Elsevier Science
Network+ Guide to Networks (MindTap Course List)
Network+ Guide to Networks (MindTap Course List)
Computer Engineering
ISBN:
9781337569330
Author:
Jill West, Tamara Dean, Jean Andrews
Publisher:
Cengage Learning
Concepts of Database Management
Concepts of Database Management
Computer Engineering
ISBN:
9781337093422
Author:
Joy L. Starks, Philip J. Pratt, Mary Z. Last
Publisher:
Cengage Learning
Prelude to Programming
Prelude to Programming
Computer Engineering
ISBN:
9780133750423
Author:
VENIT, Stewart
Publisher:
Pearson Education
Sc Business Data Communications and Networking, T…
Sc Business Data Communications and Networking, T…
Computer Engineering
ISBN:
9781119368830
Author:
FITZGERALD
Publisher:
WILEY