Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Write ONE complete assembly program to perform the following tasks: 1) 2) 3) a. 4) b. C. d. e. f. Set-up and initialise the

Write ONE complete assembly program to perform the following tasks: 1) 2) 3) a. 4) b. C. d. e. f. Set-up and

Write ONE complete assembly program to perform the following tasks: 1) 2) 3) a. 4) b. C. d. e. f. Set-up and initialise the table pointer to point to an array of dataset stored at the program memory with a starting label of MyData. The dataset has a total of D'512' elements. Sum all the elements in the dataset, and save the result as a 3-byte answer to file registers of addresses 0x000 until 0x002 at data memory using the little-endian format. Calculate the average value of the dataset, rounded to the nearest integer, and save the answer to file register of address 0x003 at data memory. The average can be calculated as sum of all elements (from b.) divided by the total number of elements (D'512'). Based on the dataset, find / count the total number of elements that are greater than or equal to XX, and save the answer to file register of addresses 0x010 and 0x011 at the data memory using the little-endian format. The count could be a two-byte answer. Requirements: Your main program must start at address 0x000100. Make sure you include sufficient comments to make your program readable and understandable. Note: XX refers to the last two digits of your SID in decimal value. For example, if your SID is EE0100106, then XX is D'06'. Calculate the difference between the total elements in the dataset (D'512') and the total elements that are greater than XX (from d.), and save the result as a 2-byte answer to file registers of addresses 0x012 and 0x013 at data memory using the little-endian format. Lastly, calculate the difference between the average value (from c.) and XX, and save the answer to file registers of address 0x020 at data memory. For debugging purpose, in your assembly program, define a data section at the program memory starting at address 0x002000 using proper assembler directives. The data section should be named MyData and consists of a dataset of 512, 8-bit (1 byte) unsigned decimal numbers. You need to download this dataset from BRIGHTEN, which is a comma-separated value file (.csv) with your student ID (SID) as the file name - for example, if your SID is EE0100106 then the file you should download is EE0100106.csv. You can use Notepad or any text editor to open the file and copy the dataset. Assemble and build your assembly program using the MPLAB IDE based on the PIC18F458 architecture. Debug your program and show that it is functionally correct. Compile all the deliverables into ONE report which should include the following: a. Cover page with your name, student ID and section b. Flow-chart of your program c. The full assembly program from ASM file (*.asm) d. The entire full MPLAB Output Window clearly showing the result of the build process e. The listing file (*.1st) generated after the successful build (excluding the Symbol Table) f. The contents of the program memory (displayed as Symbolic) for main program starting at address 0x000100 g. The contents of the program memory (displayed as Opcode Hex) for MyData data section starting at address 0x002000 h. The final contents of data memory block starting from 0x00 till 0x2F i. The final contents of watch window with the following registers: WREG, STATUS, TABLAT, TBLPTR

Step by Step Solution

There are 3 Steps involved in it

Step: 1

I can offer some general guidance on how to approach the tasks outlined 1 Set up and initialize the ... blur-text-image

Get Instant Access with AI-Powered 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

Income Tax Fundamentals 2013

Authors: Gerald E. Whittenburg, Martha Altus Buller, Steven L Gill

31st Edition

1111972516, 978-1285586618, 1285586611, 978-1285613109, 978-1111972516

More Books

Students also viewed these Accounting questions

Question

x+4 if -4sx

Answered: 1 week ago

Question

=+a. Describe, in words, the event A and B.

Answered: 1 week ago

Question

=+b. Describe, in words, the event A or B.

Answered: 1 week ago