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

Prog 3

Uploaded by

api-3705912
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOC, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
50 views2 pages

Prog 3

Uploaded by

api-3705912
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOC, PDF, TXT or read online on Scribd
You are on page 1/ 2

##################################################

#########################

Performing Arithmetic operations

##################################################
#########################

.aseg add1,data
.org 30h
num1 .dsb 2
num2 .dsb 2
.rseg add1,code
mov num1,#10b
mov num2,#11b
mov r0,num1
mov r1,num2
mov a,r0
add a,r1 ; addition using b0 pointers
mov a,num1
add a,31h ; addition using direct
addressing
mov r0,#30h
mov a,@r0
mov r1,#31h
add a,@r1 ; addition using indirect
addressing
mov dptr,#arr1
mov a,#00h
movc a,@a+dptr
mov b,a
mov a,#01h
movc a,@a+dptr
add a,b ; addition using 16 bit
pointer dptr
mov num1,#32h
mov num2,#45h
mov a,num1
mov b,num2
add a,b
da a ;decimal adjust
clr c
mov a,#32h
add a,#54h
mov r0,a
mov a,#54h
addc a,#23h
mov r1,a
nop
nop
arr1 .db1 32h,24h
.end

You might also like