Question: Please use PIC24 Assembly Code. 5. TASK 3: mysub.s Create a project named mysub using the same procedure given in Task 2 (Project ->Save Project

 Please use PIC24 Assembly Code. 5. TASK 3: mysub.s Create a

Please use PIC24 Assembly Code.

5. TASK 3: mysub.s Create a project named mysub using the same procedure given in Task 2 (Project ->Save Project As, etc.) corresponding assembly language file named mysub.s. Using digits Y5Y4Y3Y2Y1Y0 = 382501 , write an assembly language program that implements the following C program. You must translate each line of the C program to assembly instruction(s). uint16 xx=0xDEAD, yy=0xBEEF; uint8 i, j, k, l, m; i Y1Y0; j Y3Y2; k Y5Y4; 1 = i + k; m = j - l; xx=xx-vy-m; Variables i, j, k, l, m are all 8-bit (byte) variables and xx and yy are 16-bit variables. YIYO, Y3Y2 and Y5Y4 are considered as decimal numbers for this task. Use the watch window to watch variables i, j, k, l, m, xx, and yy. Also, use the data memory window to monitor the memory locations corresponding to these variables. Write your program, simulate it, and verify that you calculate the correct results. Hint: If you experience the error "Link Error: Cannot access symbol (xx) at an odd address", initialize 16-bit variables first and then 8-bit variables. That is, all variables defined using the .space 2 directive should appear before variables defined using the space 1 directive. 3 Page Give the value of the flags after the execution of m = - 1 . Assume that WO =j and W1 = 1 Include SR(status register) in your watch window to verify your result. Instruction Value of flags z OV SUB.B WO,W1,WO N 5. TASK 3: mysub.s Create a project named mysub using the same procedure given in Task 2 (Project ->Save Project As, etc.) corresponding assembly language file named mysub.s. Using digits Y5Y4Y3Y2Y1Y0 = 382501 , write an assembly language program that implements the following C program. You must translate each line of the C program to assembly instruction(s). uint16 xx=0xDEAD, yy=0xBEEF; uint8 i, j, k, l, m; i Y1Y0; j Y3Y2; k Y5Y4; 1 = i + k; m = j - l; xx=xx-vy-m; Variables i, j, k, l, m are all 8-bit (byte) variables and xx and yy are 16-bit variables. YIYO, Y3Y2 and Y5Y4 are considered as decimal numbers for this task. Use the watch window to watch variables i, j, k, l, m, xx, and yy. Also, use the data memory window to monitor the memory locations corresponding to these variables. Write your program, simulate it, and verify that you calculate the correct results. Hint: If you experience the error "Link Error: Cannot access symbol (xx) at an odd address", initialize 16-bit variables first and then 8-bit variables. That is, all variables defined using the .space 2 directive should appear before variables defined using the space 1 directive. 3 Page Give the value of the flags after the execution of m = - 1 . Assume that WO =j and W1 = 1 Include SR(status register) in your watch window to verify your result. Instruction Value of flags z OV SUB.B WO,W1,WO N

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!