Wednesday, 2 March 2016

8051 Assembly Language Programming

(1)Write  a Program to  add 2 -8bit  number data in stored in Register R0,R1 and result  to be stored in R2.

ans:
MOV   A  ,   R0    ; LOAD THE CONTENT OF THE REGISTER R0 IN REGISTER A.
ADD  A  ,  R1    ; ADD THE CONTENT OF REGISTER A WITH THE CONTENT OF REGISTER R1.
MOV   R2   ,   A  ;  STOR THE RESULT OF ADDITION  IN REGISTER   R2.
SJMP   Here  ; Stop.

(2)write  a program to add 2-8bit   number data is stored in internal  memory  and store  the result  in register R2:
ans:
MOV   A , #44H    ; LOAD THE CONTENT 44H IN REGISTER A
ADD  A ,  #66H    ; ADD THE CONTENT OF REGISTER A WITH THE CONTENT 66H.
MOV  R2,, A       ;STORE  THE RESULT OF ADDITION IN   REGISTER  R2
SJMP    Here  ; Stop

(3)write a program   to add 2  -8 bit number data is stored in data Memory location 51H ,52H AND STORE  THE RESULT IN DATA MEMORY LOCATION 53H.

MOV  A,51H  ;  LOAD   REGISTER A WITH THE CONTENT OF MEMORY LOCATION  51H
ADD  A, 52H  ; ADD THE CONTENT OF REGISTER A WITH CONTENT OF  MEMORY  52H
MOV  53H,  A :  SOTRE THE RESULT OF ADDITION  IN DATA MEMORY 53H.
SJMP   Here  ; Stop.

(4)write program to add 2-8bit  number Data is stored in data memory location  whose  address stored in R1  and R2 register and store  the result  in data memory  location 53H.

MOV A, @R1   ;LOAD REGISTER A WITH THE CONTENT OF MEMORY LOCATION POINTER BY REGISTER R1
ADD  A,@R2   ; ADD THE CONTENT OF REGISTER A WITH THE CONTENT OF LOCATION POINTER BY REGISTER R2S.
MOVE 53H, A  ; STORE  THE RESULT  OF ADDITION IN DATA MEMORY 53H.
SJMP  Here  ;  Stop

No comments:

Post a Comment

Disqus Shortname

Ads Top

About Me

My photo
Technical Trainer for Full Stack Web Development & Digital Marketing Course

Comments system

Popular Posts

Navigation-Menus (Do Not Edit Here!)

Animation - Scroll IMG (yes/no)

Fixed Menu (yes/no)

Related Posts No. (ex: 9)

PageNavi Results No. (ex: 7)

Facebook

Advertising

Popular