1. The lines of code below form a counting loop: LoadDelay mov.w #0x001A, R15 LoopTop dec.w R15 jnz...

90.2K

Verified Solution

Question

Electrical Engineering

1. The lines of code below form a counting loop:

LoadDelay mov.w #0x001A, R15

LoopTop dec.w R15

jnz LoopTop

Done

How many times will this loop execute? Provide the answer indecimal_________

2. Suppose the state of bits at P1OUT are 10110111 and thefollowing line is executed:

xor.b #0x05,&P1OUT

What is the new state of bits at P1OUT after the above lineexecutes? Provide the answer in binary_____________

3. What value is contained in R9 after the following linescomplete execution?

mov #0x0C07, R9

bic #0x0703, R9

Provide the answer in hexadecimal_________

4. What value is contained in R9 after the following linescomplete execution?

mov #0x0C07, R9

and #0x1783, R9

Provide the answer in hexadecimal_________

5. What value is contained in R9 after the following linescomplete execution?

mov #0x0C02, R9

sub #0x0001, R9

Provide the answer in hexadecimal_________

6. Execute the following lines:

mov.w #0xFF02, R12

dec R12

jz CaseA

jmp CaseB

Which branch is taken? (circle one) CaseA CaseB

7. Execute the following lines:

mov.w #0x1234, R12

rra R12

What is the final value in R12?

Provide the answer in hexadecimal_________

8. Execute the following lines:

mov.w #0x8431, R12

rla R12

What is the final value in R12? Provide the answer inhexadecimal_________

Answer & Explanation Solved by verified expert
4.5 Ratings (772 Votes)
Ans 1 Here in the first line of code Register R15 is loaded with value 0x001A which is equivalent to 26 in decimal so from now loop will decrement it by 1 until the value in Register R15 Becomes 0 so after 26 iterations the value in R15 will become zero Hence the loop will execute 26 times Ans 2 Given initially P1OUT10110111 now xorb 0x05P1OUT will XOR the binary value of 0x05 ie 00000101    See Answer
Get Answers to Unlimited Questions

Join us to gain access to millions of questions and expert answers. Enjoy exclusive benefits tailored just for you!

Membership Benefits:
  • Unlimited Question Access with detailed Answers
  • Zin AI - 3 Million Words
  • 10 Dall-E 3 Images
  • 20 Plot Generations
  • Conversation with Dialogue Memory
  • No Ads, Ever!
  • Access to Our Best AI Platform: Flex AI - Your personal assistant for all your inquiries!
Become a Member

Other questions asked by students