Question: 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

 Assignment 2 ECE 3130 1) 14 marks) Write a sequence of

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

1 Expert Approved Answer
Step: 1 Unlock

To write an HCS12 assembly language program for the tasks described follow the instructions for each question The HCS12 uses a variant of the Motorola ... View full answer

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!