Go4Expert

Go4Expert (http://www.go4expert.com/)
-   Assembly Language Programming (ALP) Tutorials (http://www.go4expert.com/articles/assembly-language-programming/)
-   -   8085 Assembly language programming code for beginners (http://www.go4expert.com/articles/8085-assembly-language-programming-code-t302/)

shabbir 16May2005 07:08

8085 Assembly language programming code for beginners
 
Addition of two 8 bit numbers.
Code:

  MVI B, 06
  //Load Register B with the Hex value 06
  MOV A, B
  //Move the value in B to the Accumulator or register A
  MVI C, 07
  //Load the Register C with the second number 07
  ADD C
  //Add the content of the Accumulator to the Register C
  STA 8200
  //Store the output at a memory location e.g. 8200
  HLT
  //Stop the program execution

Addition of two 8 bit numbers stored in memory
Code:

  LDA 8500
  //Load the accumulator with the address of memory viz 8500
  MOV B, A
  Move the accumulator value to the register B
  LDA 8501
  //Load the accumulator with the address of memory viz 8501
  ADD B
  //Add the content of the Accumulator to the Register B
  STA 8502
  //Store the output at a memory location e.g. 8502
  HLT
  //Stop the program execution

Addition of two 8 bit numbers stored in memory and storing the carry
Code:

  LDA 8500
  //Load the accumulator with the address of memory viz 8500
  MOV B, A
  Move the accumulator value to the register B
  LDA 8501
  //Load the accumulator with the address of memory viz 8501
  ADD B
  //Add the content of the Accumulator to the Register B
  STA 8502
  //Store the output at a memory location e.g. 8502
  MVI A, 00
  //clear the accumulator with 00
  ADC A
  //Add with carry the content of the accumulator
  STA 8503
  //Store the output at a memory location e.g. 8503
  HLT
  //Stop the program execution

Implementing the above program for the subtraction is very simple just replace ADD with SUB and ADC with SBB and all should be working fine.

shabbir 4Mar2006 23:38

Re: 8085 Assembly language programming code for beginners
 
Moved the post into the new thread at sorting of numbers in assembly language programming

foundy 21Mar2006 10:01

Re: 8085 Assembly language programming code for beginners
 
help me...help me....

coderzone 21Mar2006 14:32

Re: 8085 Assembly language programming code for beginners
 
Quote:

Originally Posted by foundy
help me...help me....

But how.

foundy 21Mar2006 15:28

Re: 8085 Assembly language programming code for beginners
 
i've an asignment to do...but i don't know how to do it....

shabbir 21Mar2006 18:49

Re: 8085 Assembly language programming code for beginners
 
Quote:

Originally Posted by foundy
i've an asignment to do...but i don't know how to do it....

Just create a new thread about the problem you are facing and definitely some members and experts will try to help you out.

miss ain 25Apr2006 14:23

Re: 8085 Assembly language programming code for beginners
 
can u help n explain 2 me to write 8085 instruction for this program?

Write 8085 ALP to convert the given binary number in a memory location X to the equivalent unpacked BCD numbers in three consecutive memory location

shabbir 25Apr2006 20:44

Re: 8085 Assembly language programming code for beginners
 
Quote:

Originally Posted by miss ain
can u help n explain 2 me to write 8085 instruction for this program?

Write 8085 ALP to convert the given binary number in a memory location X to the equivalent unpacked BCD numbers in three consecutive memory location

Just create a new thread about the problem you are facing and definitely some members and experts will try to help you out. This post will not be seen by all the members.

santu1225 28Oct2006 18:55

Re: 8085 Assembly language programming code for beginners
 
i am new to this form.

Thank you for doing this great job.I may need ur help often, i just started my MS in computer science and I joined in ALP.

Thanks
with regards
santosh

shabbir 29Oct2006 10:05

Re: 8085 Assembly language programming code for beginners
 
santu1225 Welcome to G4EF.


All times are GMT +5.5. The time now is 23:52.