Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

The code language required is HC12 Assembly Language Programming. The image of the code is just a template that shows how the code should be

image text in transcribedimage text in transcribed

The code language required is HC12 Assembly Language Programming. The image of the code is just a template that shows how the code should be formatted.

Lab 3.1.1: Straight Line Create a new project for this lab. Write and test an assembly language program that solves the following straight line equation for y: y = mx + b Generate an integer result as close as possible that solves the following straight-line equation for y. Generate an integer result as close as possible to the actual answer. Assume variable x is always an unsigned 8-bit number. The slope (m) is equal to 0.68 and the offset (b) is equal to 12. Leave the result in accumulator A. Assume value x is in the memory location labeled val. Use assembler directives to define these values. Note that the result will always fit in 8 bits Test and confirm the program is working properly by testing the following values in Val. Modify Val using the data window in the debugger. Val = 0 Result: Val = 10 Result: Val = 75 Result: Val = 200 Result: Val = 255 Result: Extra Credit: The number after the decimal point will always be truncated off of the result. The result will not be rounded up. For extra credit on the lab checkout, display the number to the left of the decimal point in register A and the result to the right of the decimal point in register B. XDEF Entry XREF _SEG_END_SSTACK Variables: Section ds.b 1 Constants: consb: cansm: Section dc.b 1, 2, 3 dc.b $11/$19 Code: Section Entry: LDS LDAA #_SEG_END_SSTACK - ; You should comment your code Make sure the formatting is correct STAA vari Lab 3.1.1: Straight Line Create a new project for this lab. Write and test an assembly language program that solves the following straight line equation for y: y = mx + b Generate an integer result as close as possible that solves the following straight-line equation for y. Generate an integer result as close as possible to the actual answer. Assume variable x is always an unsigned 8-bit number. The slope (m) is equal to 0.68 and the offset (b) is equal to 12. Leave the result in accumulator A. Assume value x is in the memory location labeled val. Use assembler directives to define these values. Note that the result will always fit in 8 bits Test and confirm the program is working properly by testing the following values in Val. Modify Val using the data window in the debugger. Val = 0 Result: Val = 10 Result: Val = 75 Result: Val = 200 Result: Val = 255 Result: Extra Credit: The number after the decimal point will always be truncated off of the result. The result will not be rounded up. For extra credit on the lab checkout, display the number to the left of the decimal point in register A and the result to the right of the decimal point in register B. XDEF Entry XREF _SEG_END_SSTACK Variables: Section ds.b 1 Constants: consb: cansm: Section dc.b 1, 2, 3 dc.b $11/$19 Code: Section Entry: LDS LDAA #_SEG_END_SSTACK - ; You should comment your code Make sure the formatting is correct STAA vari

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

Beyond Big Data Using Social MDM To Drive Deep Customer Insight

Authors: Martin Oberhofer, Eberhard Hechler

1st Edition

0133509796, 9780133509793

More Books

Students also viewed these Databases questions