Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

The second image is the outputs of the following problems. I need help programming this in MPLABX. Thank you I just need help answering questions

The second image is the outputs of the following problems. I need help programming this in MPLABX. Thank you
image text in transcribed
image text in transcribed
image text in transcribed
I just need help answering questions 2 & 3 using the information above. Thanks
Register WO W1 W2 W3 W4 Value Ox 1004 Ox 1006 0x8301 OxF0A2 OxFFFF Location 0x1000 Ox1002 0x1004 Ox1006 0x1008 Value 0x382A OxFB80 0x80FF 7B03 0001 1. MOV 0x1000, WREG 2. MOV W2, [WI) 3. ADD W2,W1.WO 4. ADD 0x1002, WREG 5. SUB.B WO, #5, WI 6. MOV #1006, WO 7. INC [WO), wi 8. MOV #1000, W1 9. DEC.B WO, [W1] 10. SUB W2, WO],[Woj 11. DEC2.B W2,W1 12. INC 0x1004 Here is the explantion to the programm steps: MOV 0x1000, WREG ; Moves the byte stored at location 0x1000 to Wo ie.0x80FF is moved. MOV W2,[W1]; Here the W2 is data written to the W1 ie.0x301 is written into W1. ADD W2,W1,W0; Here the (W2)+(W1)=(WC) the lower 8bits of W2 and wl are added and placed in WO. ADD 0x1002,WREG; Here the Ox 1002 is added to WO and the result is stord in WO SUB .B W0,#5,W1 ; Here the (W0)-5 is stord in W1 register MOV #1006,W0;Here the 1006 value is stored in WO register ie. 7B03. INC [W0],W1;here W1=W0+1 MOV #1000,W1;here the value present at the address 1000 is moved to W1 register ie.0x382A. DEC.B W0,[W1]; here the W0-1 is given to the regoster W1 SUB W2,[W0],[W0]; Here W2-W0 is assigned to the Wo. DEC 2.B W2,W1 ;here (W2.Isb)-1 is assiged to the W1. INC 0x1004; here the value of 0x1004 is incremented by +1. 1. Submit the code and outputs of the above instructions. 2. Write a PIC24 instruction sequence that accomplishes k=1-1-32, where 1. j and k ar are uint8 variables. 3. Write PIC24 assembly language equivalents for the following code fragment. Assume 1.) and k are uint16 variables. k = 1 + (5 & 0x4554) - 0x30 Register WO W1 W2 W3 W4 Value Ox 1004 Ox 1006 0x8301 OxF0A2 OxFFFF Location 0x1000 Ox1002 0x1004 Ox1006 0x1008 Value 0x382A OxFB80 0x80FF 7B03 0001 1. MOV 0x1000, WREG 2. MOV W2, [WI) 3. ADD W2,W1.WO 4. ADD 0x1002, WREG 5. SUB.B WO, #5, WI 6. MOV #1006, WO 7. INC [WO), wi 8. MOV #1000, W1 9. DEC.B WO, [W1] 10. SUB W2, WO],[Woj 11. DEC2.B W2,W1 12. INC 0x1004 Here is the explantion to the programm steps: MOV 0x1000, WREG ; Moves the byte stored at location 0x1000 to Wo ie.0x80FF is moved. MOV W2,[W1]; Here the W2 is data written to the W1 ie.0x301 is written into W1. ADD W2,W1,W0; Here the (W2)+(W1)=(WC) the lower 8bits of W2 and wl are added and placed in WO. ADD 0x1002,WREG; Here the Ox 1002 is added to WO and the result is stord in WO SUB .B W0,#5,W1 ; Here the (W0)-5 is stord in W1 register MOV #1006,W0;Here the 1006 value is stored in WO register ie. 7B03. INC [W0],W1;here W1=W0+1 MOV #1000,W1;here the value present at the address 1000 is moved to W1 register ie.0x382A. DEC.B W0,[W1]; here the W0-1 is given to the regoster W1 SUB W2,[W0],[W0]; Here W2-W0 is assigned to the Wo. DEC 2.B W2,W1 ;here (W2.Isb)-1 is assiged to the W1. INC 0x1004; here the value of 0x1004 is incremented by +1. 1. Submit the code and outputs of the above instructions. 2. Write a PIC24 instruction sequence that accomplishes k=1-1-32, where 1. j and k ar are uint8 variables. 3. Write PIC24 assembly language equivalents for the following code fragment. Assume 1.) and k are uint16 variables. k = 1 + (5 & 0x4554) - 0x30

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

More Books

Students also viewed these Databases questions