Question: Write ONE complete assembly program to perform the following tasks: a . Set - up and initialise the table pointer to point to an array

Write ONE complete assembly program to perform the following tasks:
a. Set-up and initialise the table pointer to point to an array of dataset stored
at the program memory with a starting at address 002500 and label it as
Array. The dataset has a total of D'256' elements of 8-bit, signed numbers
given in hexadecimal representation.
b. Count positive elements (excluding zero) in Array and save the result in
POSNUM at address 010 in data memory.
c. Sum all the positive elements in the dataset and save the result as a 3-byte
answer to file registers of addresses 0000 until 0002 at data memory using
the little- endian format.
Requirements:
Your main program must start at address 000050. Make sure you include
sufficient comments to make your program readable and understandable.
For debugging purpose, in your assembly program, define a data section at the
program memory after your main program. The data section should be named Array and
consists of a dataset of D'256' hexadecimal numbers.
Compile all the deliverables into ONE report which should include the following:
a. Flow-chart of your program
b. The full assembly program
c. The entire full MPLAB Output Window clearly showing the result of the
build brocess
d. The contents of the program memory (displayed as Symbolic) for main
programstarting at address 0x00050?
e. The contents of the program memory (displayed as Opcode Hex) for Array
datasection
f. The final contents of data memory block of BANK 0
g. The final contents of watch window with the following registers:
WREG,STATUS, TABLAT, TBLPTR, FSR x
Data Set:-
0x450x500x300x310x300x370x300x35
0x370x300x490x750x740x230x2C 0x6F
0x4D 0x750x680x610x6D 0x6D 0x610x64
0x200x540x610x720x650x710x200x41
0x7A 0x690x7A 0x200x420x690x6E 0x20
0x4D 0x6F 0x680x610x6D 0x610x640x20
0x410x730x720x690x310x460x540x69
0x3F 0x3C 0x760x310x2E 0x460x290x54
0xCB 0x750xC30xA20xAE 0xB70x4F 0x4C
0xF00x0D 0xC50xAD 0x390xB60x1C 0x33
0x060x9B 0xE40x220x480xBC 0xDA 0x7F
0x9C 0x3F 0xE10x700x370xCA 0x3A 0x51
0xE80xD10xF60xD00xBC 0x3B 0x3E 0xEC
0x870x900x580x8A 0x180x860x980x08
0x790x630x860x860xDD 0xC80xA50xAF
0x960xB30x740xD70xFC 0x000x3E 0xC5
0x6A 0x0C 0x190xCE 0xE60x870x690xA8
0x740x620x290x2E 0xE90xD20x550xFA
0xE10xF70x5B 0x160x3C 0xCB 0xCE 0xE5
0x440x660x950x2F 0x890x100xF70xE6
0x8D 0x250x150x8C 0x190xA90xEB 0x8B
0x240x1B 0x480xF80x650x570x4C 0x5A
0x330xD50x340x200xF70xE00xBD 0xAF
0x500xF30x270xDF 0xC10x870x060xA5
0xF90x670xB90x780x800xD60x890x04
0xF90x430xC40xAF 0x720x020x410x6D
0xA30xA10xEB 0x200xA10x4F 0xCF 0x84
0x280xB70xC80x250x020xC50xA90x62
0xAD 0xA10xBB 0x660xE10x410x580x69
0xE50xEF 0x5B 0x0B 0x2E 0x170x400x66
0xD70x880xC40x430xCB 0x320xB20xFF
0x630xB20xD30x560xE80x640x9A 0xC8
Write ONE complete assembly program to perform

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock 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 Programming Questions!