0% found this document useful (0 votes)
6 views

Ex 2 Report Embedded (2140245)

Uploaded by

mmohammedgharawi
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
6 views

Ex 2 Report Embedded (2140245)

Uploaded by

mmohammedgharawi
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 7

KINGDOM OF SAUDI ARABIA

Ministry of Education
KINGABDULAZIZUNIVERSITY
Faculty of Engineering at Rabigh
Electrical Engineering Department
‫قسم الهندسة‬
‫الكهربائية‬

Course Name Embedded Systems Lab Report

Number : 2
Course Code EEN 415

Name : Mohammed Abdu Gharawi

ID No: 2140245
Objective:

1- To study the meaning and function of the assembler codes ADDLW , DECF, LOOPING ,
in addition to previous codes
2- To create a down counter

Procedure:
- Create a down counter starting from 10 and counting down to 0.
- In each counter cycle, increment the value of the work register by 3H.
- Use assembler instructions ADDLW, DECF, and LOOP in the program.

Test Plan:
1- Verify WREG is cleared at the start:
Ensure the code begins by clearing WREG with MOVLW 0x00, and confirm this through
simulation.

2- Monitor the Watch window:


Add WREG, PORTA, and PORTB to the WATCH window, and verify their values during
execution.

3- Check the Output window for success:


Ensure the OUTPUT window shows "BUILD SUCCESSFUL" to confirm the program
compiled without errors.

2
Source Code:
include <p18F458.inc>
org 0x000
count equ 0x25
movlw D'010'
movwf 25h
movlw 0h
main addlw 3h
decf 25h,f
bnz main
movwf 26h
end

3
Screen shots:

4
5
6
Conclusion:

The experiment proved the efficacy of the assembler codes ADDLW, DECF, and LOOP. The
down counter properly counted from 10 to 0, and the work register was increased by 3H each
cycle. The experiment clearly demonstrated the effective usage of assembler codes in
reaching the desired result.

You might also like