Lab no 03
Lab no 03
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
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
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.