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

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!