Answered step by step
Verified Expert Solution
Question
1 Approved Answer
CodeWarrior HCS12X Special Edition v5.1 Dragon12-Plus2- SM 1. Use breakpoints and single step to debug the program posted on Moodle in file lab1_a.asm.. The program
CodeWarrior HCS12X Special Edition v5.1 Dragon12-Plus2-SM
1. Use breakpoints and single step to debug the program posted on Moodle in file lab1_a.asm.. The program is supposed to double the variable K 10 times and record the doubled value in K2. The Count variable is used to keep track of how many times we did that. Lines 1-4 is initialization. Lines 5-12 is the loop where K, K2, and Count are calculated. Line 13 is where the program enters self-pointing branch (infinite loop) Create a new assembly project and replace the contents of main.asm by the contents of lab.asm file. Make (build) the program. There should be no assemble time errors. Debug your program by pressing F5. Your debugger dialog will appear. Start/run your program (F5). After few seconds, press the Halt button (F6). This should stop your program at line (13) because of the infinite loop. Look at the data window, you should see that K-10, K2-20 & Count 9. This reveals the problem: Count should be 10 as we doubled K 10 times in the loop but here it shows 9! 1. Use breakpoints and single step to debug the program posted on Moodle in file lab1_a.asm.. The program is supposed to double the variable K 10 times and record the doubled value in K2. The Count variable is used to keep track of how many times we did that. Lines 1-4 is initialization. Lines 5-12 is the loop where K, K2, and Count are calculated. Line 13 is where the program enters self-pointing branch (infinite loop) Create a new assembly project and replace the contents of main.asm by the contents of lab.asm file. Make (build) the program. There should be no assemble time errors. Debug your program by pressing F5. Your debugger dialog will appear. Start/run your program (F5). After few seconds, press the Halt button (F6). This should stop your program at line (13) because of the infinite loop. Look at the data window, you should see that K-10, K2-20 & Count 9. This reveals the problem: Count should be 10 as we doubled K 10 times in the loop but here it shows 9Step 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