0% found this document useful (0 votes)
95 views2 pages

Logical Operation

The document describes an ALP program for performing arithmetic, logical, and bit manipulation operations in 8051. It includes code segments that demonstrate addition, subtraction, multiplication, division, incrementing, decrementing, AND, OR, XOR logical operations, and setting, clearing, and complementing bits. The program is organized into sections for arithmetic, logical, and bit manipulation operations with corresponding code examples for each type.

Uploaded by

kskumargie
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)
95 views2 pages

Logical Operation

The document describes an ALP program for performing arithmetic, logical, and bit manipulation operations in 8051. It includes code segments that demonstrate addition, subtraction, multiplication, division, incrementing, decrementing, AND, OR, XOR logical operations, and setting, clearing, and complementing bits. The program is organized into sections for arithmetic, logical, and bit manipulation operations with corresponding code examples for each type.

Uploaded by

kskumargie
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/ 2

Aim:

To write ALP for performing Arithmetic, Logical , Bit manipulation operations in 8051
Apparatus:

1. ADS-SDA-51-STA kit
2. Microprocessor Power Supply
3. RS 232 Cable
5. Adapter, Keyboard, Cables, Connecting Wires Etc.

org 9000h
;addition without carry
mov a, #06h
mov b, #09h
add a, b
mov r0, a
;Substraction with carry
mov a, #08h
subbc a, #03h
mov r1, a
;multiplication
mov a, #03h
mov b, #06h
mul ab
mov r2, a
;division
mov a, #08h
mov b, #03h
div ab
mov r3, a
mov r4, b
;increment operation
mov a, #03h
inc a
mov r5, a
;decrement operation
mov r6, #07h
dec r6
lcall 0003h
end

Logical operation
org 8000h
mov r0, #0fh
mov r1, #foh
mov r2, #66h
; And operation
mov a, #ffh
anl a, r0
mov r3, a
; Or operation
mov a, #ffh
orl a, r1
mov r4, a
; Xor operation
mov a, 03h
mov a, #ffh
xrl a, r2
mov r5, a
lcall 0003h
end

Bit Manipulation
org 9000h
mov a, #ffh
clr c
;clear the carry flag
anl c, acc.7
mov r0, a
setb c
;set the carry flag
mov a, #00h
orl c, acc.5
mov r1, a
mov a, #ffh
cpl acc, 3
mov r2, a
lcall 0003h
end

You might also like