Read without ads and support Scribd by becoming a Scribd Premium Reader.
3.8-BIT MULTIPLICATION AND DIVISION
AIM:
To write an assembly language program to
(i)
Multiply two 8-bit numbers
(ii)
Divide two 8-bit numbers
APPARATUS REQUIRED:

8085 Kit and Power supply
ALGORITHM:
8-BIT MULTIPLICATION:

1. Initialize a register for carry.
2. Get the two input data (multiplier and multiplicand) from memory locations.
3. Clear accumulator for repeated addition and have multiplier as count.
4. Add multiplicand with accumulator content.
5. Check for carry. If carry =1, goto next step, else goto step 7.
6. Increment the carry register.
7. Decrement the count.
8. Check for count. If count=0, goto next step, else goto step 4.
9. Store the result and carry in memory locations.
10. Stop program execution.

PROGRAM:
Address
Opcode Label
Mnemonics Comments
4101
MVI C,00

Move immediate 00 to C register
4102
4103

LDA 4500
Load accumulator with the content of
4104

Address 4500
4105
4106

MOV B,A
Move the content of B-register to
Accumulator
4107
LDA 4501
Load accumulator with the content of
4108

Address 4501
4109
410A

MOV D,A
Move the content of D-register to
Accumulator
410B
XRA A
X-OR the content of accumulator
410C
L2
ADD B
Add the content of B register to
accumulator content
410D
JNC L1
Jump if no carry to label location L1

410E
410F
4110

INR C
Increment C register
4111
L1
DCR D
Decrenent D register
4112
JNZ L2

Jump on no zero to label location L2
4113
4114
4115

STA 4503
Store accumulator content to address

4503
4116
4117
4118

MOV A,C
Move the content of C-register to
Accumulator
4119
STA 4504
Store accumulator content to address

4504
411A
411B
411C

HLT
Halt the program execution
ALGORITHM:
8-BIT DIVISION:

1. Initialize a register for quotient.
2. Get the two input data (divisor and dividend) from memory locations.
3. Compare divisor and dividend.
4. Check for carry, if set goto step 8, else to next step.
5. Subtract divisor from dividend.
6. Increment the quotient register.
7. Go to step 3.
8. Store the remainder and quotient in memory locations.
9. Stop program execution.

PROGRAM:
Address
Opcode Label
Mnemonics Comments
4101
MVI C,00

Move immediate 00 to C register
4102
4103

LDA 4500
Load accumulator with the content of
4104

Address 4500
4105
4106

MOV B,A
Move the content of B-register to
Accumulator
4107
LDA 4501
Load accumulator with the content of
4108
Address 4501
4109
410A
L2
CMP B
Compare B register content to
accumulator content
410B
JC L1

Jump on carry to label location L2
410C
410D
410E

SUB B
Subtract the content of B register from
accumulator content
410F
INR C
Increment C register
4110
JMP L2

Jump to label location L2
4111
4112
4113

L1
STA 4503
Store accumulator content to address

4503
4114
4115
4116

MOV A,C
Move the content of C-register to
Accumulator
4117
STA 4504
Store accumulator content to address

4504
4118
4119
411A

HLT
Halt the program execution
PROCEDURE:

1. Key in the opcodes.
2. Give the input data at specified memory locations.
3. Execute the program.
4. Check the results at specified output locations.

OBSERVATION :
8-bit Multiplication
Address
Data
Input
4500
08
4501
03
Output
4503
18 (Product LSB)
4504
00 (Carry MSB)
8-bit Division
Address
Data
Input
4500
08
4501
03
Output
4503
02 (Remainder)
4504
02 (Quotient)
Search History:
Searching...
Result 00 of 00
00 results for result for
  • p.
  • More From This User

    Notes
    Load more