Answered step by step
Verified Expert Solution
Question
1 Approved Answer
I want you to add comments in each line of what is happening by entering the code. As you see i have added comments in
I want you to add comments in each line of what is happening by entering the code. As you see i have added comments in the green which i am not sure if they are correct. i want an expert to give me to correct and best comments of what is happening. please feel free to delete and write your comments in the green next to the code. You will see step a to q in my comments. these are the steps i have been doing to write my codes. see last picture for more details.
mov.b Z1, R5 and.b Z2, R5 mov.b R4,48(R4) STEP M, copy z1 to RS and R4&Z2 Store R4 to Memory 48 STEP N, copy z1 to RS store R5 to memory 52 STEP 8, copy z1 to R5 ; Store R5 into memory 56 STEP P, copy Z2 to R5 mov.b Z1, R5 xor.b Z2, R5 mov.b R5,52 (R4) ; exclusive Z2 from RS mov.b Z1, R5 dec.b R5 mov.b R5, 56 (R4) ; decrement destination R5 mov.b Z2, R5 dec.b R5 dec.b RS ; decriment at R5 ; decriment destination at R5 agian mov.b R5, 60 (R4) store R7 at memory 60 mov.w X, RS Swpb R5 mov.w R5, 64 (R4) STEP Q, move X to RS SWAP BYTES STORE R8 at memory 64 Then, use MSP430 assembly instructions to produce the following: (a good source is MSP430 x5xx Family User's guide, section 6.6.2 or MSP430 x4xx Family User's guide, Table 3-17) ctio a. Copy first 16 bits of X b. Copy first 8 bits of X c. Copy second 8 bits of X d. 16-bit addition of words X and Y e. 8-bit addition of Z1 and Z2 f. 8-bit subtraction of Z2 from Zl (Z1-Z2) g. 8-bit subtraction of Zl from Z2 (Z2-Zi) h. 16-bit subtraction of X from Y (Y-X) i. 16-bit subtraction of Y from X (X-Y) j. 16-bit one's complement of Y k. 8-bit one's complement of Z1 . Copy all 16 bits of X (to show no change) m. A logical AND of Zl and Z2 n. A logical XOR of Zl and Z2 o. Decrement Z1 by 1 p. Decrement 22 by 2 q. Swap the bytes of )X Mem +0 Mem + 4 Mem 8 Mem 12 Mem + 16 Mem +20 Mem +24 Mem 28 Mem 32 Mem +36 Mem +40 Mem +44 Mem +48 Mem 52 Mem + 56 Mem +60 Mem 64 mov.b Z1, R5 and.b Z2, R5 mov.b R4,48(R4) STEP M, copy z1 to RS and R4&Z2 Store R4 to Memory 48 STEP N, copy z1 to RS store R5 to memory 52 STEP 8, copy z1 to R5 ; Store R5 into memory 56 STEP P, copy Z2 to R5 mov.b Z1, R5 xor.b Z2, R5 mov.b R5,52 (R4) ; exclusive Z2 from RS mov.b Z1, R5 dec.b R5 mov.b R5, 56 (R4) ; decrement destination R5 mov.b Z2, R5 dec.b R5 dec.b RS ; decriment at R5 ; decriment destination at R5 agian mov.b R5, 60 (R4) store R7 at memory 60 mov.w X, RS Swpb R5 mov.w R5, 64 (R4) STEP Q, move X to RS SWAP BYTES STORE R8 at memory 64 Then, use MSP430 assembly instructions to produce the following: (a good source is MSP430 x5xx Family User's guide, section 6.6.2 or MSP430 x4xx Family User's guide, Table 3-17) ctio a. Copy first 16 bits of X b. Copy first 8 bits of X c. Copy second 8 bits of X d. 16-bit addition of words X and Y e. 8-bit addition of Z1 and Z2 f. 8-bit subtraction of Z2 from Zl (Z1-Z2) g. 8-bit subtraction of Zl from Z2 (Z2-Zi) h. 16-bit subtraction of X from Y (Y-X) i. 16-bit subtraction of Y from X (X-Y) j. 16-bit one's complement of Y k. 8-bit one's complement of Z1 . Copy all 16 bits of X (to show no change) m. A logical AND of Zl and Z2 n. A logical XOR of Zl and Z2 o. Decrement Z1 by 1 p. Decrement 22 by 2 q. Swap the bytes of )X Mem +0 Mem + 4 Mem 8 Mem 12 Mem + 16 Mem +20 Mem +24 Mem 28 Mem 32 Mem +36 Mem +40 Mem +44 Mem +48 Mem 52 Mem + 56 Mem +60 Mem 64
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started