How to count the total number of bytes in an array


Problem:

Question 1- Write a program to count the total number of bytes in an array that have bits, 2, 3, and 4 set to 1. The array must have at least 20 bytes. Use .db to reserve and initialize the bytes in the array. Use the label of the array in your code to reference the array. Do not forget to shift the label left since it’s in program memory.

Question 2- Write a program to swap the lower 4 bits with the upper 4 bit of every byte in an array and save the results in a new array. The initial array is to be stored in program memory and not be modified. The output array is to be stored in data memory. Do not forget to reserve the space in data memory. Use .db to reserve and initialize the bytes in the input array and use .byte to reserve the space for the output array in data memory.

Question 3- Write a program that has a segment of code to create a time delay of exactly 1 second. Assume the processor runs at 16 MHz.

 

Please show your work count the total number of bytes in an array.

Request for Solution File

Ask an Expert for Answer!!
Computer Engineering: How to count the total number of bytes in an array
Reference No:- TGS0892854

Expected delivery within 24 Hours