



Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
This page cannot be seen from the preview
Don't miss anything!




Write a simple assembly code to load the hex values into GPRs (R16-R20) with an increment of 3 number before loading to next register, using step over function view register data. ( Hint : 0x01R 16 and 0x0 4 R 17 )
LDI R16,0x LDI R17,0x AGAIN: ADD R16,R OUT PORTD,R BRNE AGAIN
Write an assembly code to toggle all the pins of PORTA and PORTC infinite times, when both PORTS pins toggling with complement value with respect to other PORT pins values. Make Proteus design file to check output of this program.(Hint: 0x5 5 PORTA and 0 xAAPORTC at a time then 0xAAPORTA and 0x5 5 PORTC)
LDI R 20 , 0 x 55 OUT PORTA,R 20 LDI R 21 , 0 XAA OUT PORTC,R 21 AGAIN: COM R 20 COM R OUT PORTA,R 21 OUT PORTC,R 20 JMP AGAIN
Write and assemble a program to clear R19 and add 5 to R19 100 times using BRNE instruction. Output the sum to PORTD.
; ; Q no.04.asm ; ; Created: 05/10/2019 15:26: ; Author : taqdess ; ; Replace with your application code .INCLUDE "M 32 DEF.INC" .ORG 0 LDI R 16 , 100 LDI R 19 , 0 LDI R 20 , 5 AGAIN: ADD R 19 , R 20 DEC R BRNE AGAIN OUT PORTD, R 19