Aim:
To write an assembly language for adding two 8 bit numbers by using microprocessor kit.
Apparatus required:
8085 micro processor kit
(0-5V) DC battery
Algorithm:
Step 1 : Start the microprocessor
Step 2 : Initialize the carry as ‘Zero’
Step 3 : Load the first 8 bit data into the accumulator
Step 4 : Copy the contents of accumulator into the register ‘B’
Step 5 : Load the second 8 bit data into the accumulator.
Step 6 : Add the two 8-bit data and check for carry.
Step 7 : Jump on if no carry
Step 8 : Increment carry if there is
Step 9 : Store the added request in accumulator
Step 10 : More the carry value to accumulator
Step 11 : Store the carry value in accumulator
Step 12 : Stop the program execution.
Input without carry
Output
Input with carry
Output
Calculation: 1111 1111
1111 1111
--------------
(1) 1111 1110
========
F E
Result:
The assembly language program for 8 bit addition of two numbers was executed successfully by using 8085 micro processing kit.
To write an assembly language for adding two 8 bit numbers by using microprocessor kit.
Apparatus required:
8085 micro processor kit
(0-5V) DC battery
Algorithm:
Step 1 : Start the microprocessor
Step 2 : Initialize the carry as ‘Zero’
Step 3 : Load the first 8 bit data into the accumulator
Step 4 : Copy the contents of accumulator into the register ‘B’
Step 5 : Load the second 8 bit data into the accumulator.
Step 6 : Add the two 8-bit data and check for carry.
Step 7 : Jump on if no carry
Step 8 : Increment carry if there is
Step 9 : Store the added request in accumulator
Step 10 : More the carry value to accumulator
Step 11 : Store the carry value in accumulator
Step 12 : Stop the program execution.
Address | Label | Mnemonics | Hex Code | Comments |
---|---|---|---|---|
4100 | MVI C,00 | 0E, 00 | Initialize the carry as zero | |
4102 | LDA 4300 | 3A, 00, 43 | Load the first 8 bit data | |
4105 | MOV B,A | 47 | Copy the value of 8 bit data into register B | |
4106 | LDA 4301 | 3A, 01, 43 | Load the second 8 bit data into the accumulator | |
4109 | ADD B | 80 | Add the two values | |
410A | JNC | D2, 0E, 41 | Jump on if no carry | |
410D | INR C | 0C | If carry is there increment it by one | |
410E | Loop | STA 4302 | 32, 02, 43 | Store the added value in the accumulator |
4111 | Move the value of carry to the accumulator from register C | |||
4112 | STA 4303 | 32, 03, 43 | Store the value of carry in the accumulator | |
4115 | HLT | 76 | Stop the program execution |
Input without carry
Input Address | Value |
---|---|
4300 | 04 |
4301 | 02 |
Output
Output Address | Value |
---|---|
4302 | 06 |
4303 | 00 (carry) |
Input with carry
Input Address | Value |
---|---|
4300 | FF |
4301 | FF |
Output
Output Address | Value |
---|---|
4302 | FE |
4303 | 01 (carry) |
Calculation: 1111 1111
1111 1111
--------------
(1) 1111 1110
========
F E
Result:
The assembly language program for 8 bit addition of two numbers was executed successfully by using 8085 micro processing kit.