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

Lab no 03

The document outlines a lab exercise focused on identifying even and odd numbers using assembly language and register operations in the Keil u Vision IDE. It includes source code examples for both even and odd number identification. The conclusion emphasizes the enhancement of skills in logical operations and conditional branching through this exercise.

Uploaded by

Zulqurnan Anjum
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)
4 views

Lab no 03

The document outlines a lab exercise focused on identifying even and odd numbers using assembly language and register operations in the Keil u Vision IDE. It includes source code examples for both even and odd number identification. The conclusion emphasizes the enhancement of skills in logical operations and conditional branching through this exercise.

Uploaded by

Zulqurnan Anjum
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/ 3

Lab no 03

Find even and odd in registors

Objective:
To implement an assembly language program that identifies even and odd numbers
using register operations, enhancing skills in logical operations and conditional branching in the
Keil u Vision IDE.

(Even in Registors)
Source code.

AREA Mycode,Code,Readonly
ENTRY
EXPORT Reset_Handler
Reset_Handler
MOV R0, #13
MOV R1, #2
UDIV R3,R0,R1
MUL R4,R3,R1
SUB R5,R0,R4
CMP R5,#0
MOVEQ R6,#0
MOVNE R7,#1
END

Fig 3.1

Aleeza Imran (2022-EE-30)


Output:

Fig 3.2

(odd in Registors)
Source code.
AREA Mycode,Code,Readonly
ENTRY
EXPORT Reset_Handler
Reset_Handler
MOV R0, #13
MOV R1, #3
UDIV R3,R0,R1
MUL R4,R3,R1
SUB R5,R0,R4
CMP R5,#0
MOVEQ R6,#0
MOVNE R7,#1
end

Fig 3.3

Aleeza Imran (2022-EE-30)


Output:

Fig 3.4

Conclusion :
This lab demonstrated the use of assembly language to identify even and odd
numbers using register operations, enhancing skills in logical operations and branching in Keil u
Vision IDE.

Aleeza Imran (2022-EE-30)

You might also like