Question
Write a fully-commented program for the HC12 board, including appropriate directives and labels for memory operands and constants. The program should do the following: The
Write a fully-commented program for the HC12 board, including appropriate directives and labels for memory operands and constants. The program should do the following:
The program should start execution at address $2000.
Use directives to create an array of N=20 unsigned 16-bit decimal values: 133,1200,1390,1900,1881,3939,2010,4080,9801,4592,11,22,33,3333,3242,5435,8760,9800, 2876,9601 stored in contiguous memory at locations start at $1100.
Count the number of the even numbers and store the count at the memory location $1000 with a label (even_cnt).
Count the number of the odd numbers and store the count at the memory location $1001 with a label (odd_cnt).
Add even_cnt + odd_cnt and store the result at memory location $1002 with a label (M).
Make sure that M is equal to N = 20.
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