Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Assignment 2 ECE 3130 1) 14 marks) Write a sequence of directives for an HCS12 assembly language program that performs the following: a) Define an

image text in transcribed
Assignment 2 ECE 3130 1) 14 marks) Write a sequence of directives for an HCS12 assembly language program that performs the following: a) Define an array called Temperatures starting from memory location $2000 and initialize it with SFF, SB2, and $9. Each element is stored in a byte. b) Define a word variable called Counter and initialize it to zero. c) Define an uninitialized array, called "Speed, in the next 14 bytes. Each element is a byte. d) Define a string called Error_Msg and initialize it with Please enter a number below 10" 2) [1 marks] Write an instruction to set the content of the memory location S3000 to $3A. 3) [3 marks] Write an instruction sequence to add 15 to the byte at the memory location $1000, and store the result at the memory location $3000. 4) [3 marks) Write an instruction sequence to swap the 16-bit word stored at $3000 and $ 3001 with the 16-bit word stored at $2100 and $2101. 5) [3 marks] Write an instruction sequence to subtract the byte number stored at $2000 from the byte number stored at $2001 and store the difference at $2002. 6) [4 marks] Write an instruction sequence to add the content of the accumulator A to the 16- bit word stored at memory locations S2000 and $2001, and store the result at the memory locations $3000 and $3001. The number stored in B is signed. 7) 3 marks] Register X contains the starting address of a table of data. The table is 3 bytes long. Write a sequence of code to copy the table to another table whose starting address is stored in register Y. Table x of data . 11

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

Wiley Ifrs 2005 Interpretation And Application Of International Accounting And Financial Reporting Standards

Authors: Barry J Epstein ,Abbas Ali Mirza ,Peter Walton

Revised Edition

0471668370, 978-0471668374

Students also viewed these Databases questions