Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Please convert this Assembly code into CCS. ; Subroutine to give delay of R12 0.1s Parameter is passed in R12 and destroyed ;R4 used for
Please convert this Assembly code into CCS.
; Subroutine to give delay of R12 0.1s Parameter is passed in R12 and destroyed ;R4 used for loop counter, stacked and restored DelayTenths: ; Stack R4: will be overwritten ; Start with test in case R120 push. R4 jmp mov.w #DELAYLOOPS , R4 dec.w R4 LoopTest OuterLoop: ; Initialize loop counter DelayLoop: [clock cycles in brackets] ; Decrement loop counter [11 ; Repeat loop if not zero [21 ;Decrement number of 0.1s delays DelayLoop nz dec.w R12 LoopTest: ; Finished number of 0.1s delays? #0,R12 OuterLoop R4 cmp.w No: go around delay loop again nz pop.w ret Yes: restore R4 before returning Return to caller ; Subroutine to give delay of R12 0.1s Parameter is passed in R12 and destroyed ;R4 used for loop counter, stacked and restored DelayTenths: ; Stack R4: will be overwritten ; Start with test in case R120 push. R4 jmp mov.w #DELAYLOOPS , R4 dec.w R4 LoopTest OuterLoop: ; Initialize loop counter DelayLoop: [clock cycles in brackets] ; Decrement loop counter [11 ; Repeat loop if not zero [21 ;Decrement number of 0.1s delays DelayLoop nz dec.w R12 LoopTest: ; Finished number of 0.1s delays? #0,R12 OuterLoop R4 cmp.w No: go around delay loop again nz pop.w ret Yes: restore R4 before returning Return to callerStep 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