Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Use HCS12 assembly language only - not C code Using CodeWarrior to create a new project that uses assembly language. Write an assembly program that

Use HCS12 assembly language only - not C code

Using CodeWarrior to create a new project that uses assembly language. Write an assembly program that turns on the red LED at the beginning. It switches to off 2 seconds later and switches back to on after three more seconds. (That is, it stays on for 2 seconds and off for 3 seconds.) This switching process lasts forever. Use a loop (or nested loops) for each of the 2/3-second delay where the loop body of the inner-most loop should contain only multiple instances of the NOP instruction. Use trial-and-error in adjusting the loop iterations to achieve the delay. Write down instructions in the (nested) loops of your program, identify the number of clock cycles needed for each instruction in the loops, and calculate the total number of cycles to get the amount of delay. Use that information to calculate the clock speed of the CPU in MHz, given that the clock speed is an integer in MHz.

Hint: You may use the DBNE instruction for the loop control. In order to find out the number of clock cycles for a particular HCS12 CPU instruction, you may either get it from the data sheet or use the Full Chip Simulation in CodeWarrior, in case you have trouble determining the proper machine code version from the data sheet.

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

The Database Management Systems

Authors: Patricia Ward, George A Dafoulas

1st Edition

ISBN: 1844804526, 978-1844804528

More Books

Students also viewed these Databases questions

Question

4. Does cultural aptitude impact ones emotional intelligence?

Answered: 1 week ago