Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

12-20 please Purpose of the DOR* register? Give an example how to use it. of the

ID: 3862674 • Letter: 1

Question

12-20 please

Purpose of the DOR* register? Give an example how to use it. of the PINK reitister? Give example on how to use W in the atmega 328p how many ports are avainable for vo port programming? What are theie 6. List the 4 assembly instructions used to address single bits of a port. also provide abriet description of their functionality 7. write a program to send the value owAS to PORTB and oxSA to PORTcevery second. Assume a clock frequency of 1 MHz 8. Write a program that will monitor the PBA bit until it becomes Low: when it becomes Low write the value oxFF to PORTD. 9. Which register is affected by the execution of an arithmetic instruction 11. en using a conditional branch instruction, which register is checked for its status? What is the main difference between the rotate and shift instructions? 12. write a program that will add the values ox4s and ox20 and the sum is multiplied by oxo3 and the result is sent to PORTB 13. write a program that will find the position of the first owin an 8-bit data item.The data is scanned from D7 to DO. Give the result for OxF4 14. How do you define constant values in assembly? Give an example. 15. The different ways in which the CPU access data is known as the 16. Match the instructions in the first column with their corresponding pair in the second column. COM R25 A) i/o direct addressing mode II. ADD R22, R30 B) Immediate addressing mode C) Indirect addressing mode Ill. IN R18, PINB IV. LD R20, Y D) Two-register addressing mode E) Direct addressing mode V. LDS R19, 0x2500 17. How do you place fixed data into program ROM? 18. How do you fetch data from program ROM? 19. Write a program that will read the following message from ROM and place it in data RAM starting at 0x100 .ORG 0x500 MYMESSAGE: DB Programming in Assembly is fun!",0 20. Write a program that will find y where y 20x 5,and xisbetween 0 and

Explanation / Answer

14) There are several ways:-

1) EQU:- used for defining constant.

Syntax :- CONSTANT_NAME EQU expression

example:- TOTAL_STUDENTS equ 50

2) %assign :- used to define numeric constants

Example:- %assign TOTAL 20

3) %definr :- allows both numeric and string constants.

Example:- %define PTR [EBP + 4]

15) The different ways in which the CPU access data is known as Direct Memory Access(DMA).

20) The code is in C:-

#include <stdio.h>

void main() {
int x,y;
for (x=0;x<=5;x++){
y = (20 * x) + 5;
printf("%d ",y);
}
  
}