Write me 8085 microprocrssor programs for multiplication, division, finding
largest in a series, and smallest in a series and sorting the data and transfer
of data in assembly programming
Here are 8085 microprocessor assembly programs for common operations:
multiplication, division, finding the largest and smallest values in a series,
sorting data, and transferring data.
✅ 1. Multiplication (Repeated Addition Method)
Multiply two numbers: 05 × 03
asmCopyEditLXI H, 3000H ; Load address
MOV B, M ; Load multiplicand into B
INX H
MOV C, M ; Load multiplier into C
MVI D, 00H ; Clear D to store result
LOOP: ADD B ; Add multiplicand
DCR C ; Decrease multiplier
JNZ LOOP ; Repeat until C = 0
STA 3002H ; Store result at 3002H
HLT
Assume 05 is stored at 3000H and 03 at 3001H. Result stored at 3002H.
✅ 2. Division (Repeated Subtraction Method)
Divide 08 by 02 (08 ÷ 02)
asmCopyEditLXI H, 3000H ; Load address
MOV D, M ; Dividend
INX H
MOV E, M ; Divisor
MVI B, 00H ; Quotient = 0
LOOP: CMP E
JC END ; If dividend < divisor, end
SUB E
INR B ; Increment quotient
JMP LOOP
END: STA 3002H ; Store remainder
MOV A, B
STA 3003H ; Store quotient
HLT
Dividend at 3000H, divisor at 3001H. Remainder at 3002H, quotient at
3003H.
✅ 3. Finding Largest in a Series
asmCopyEditLXI H, 3000H ; Start of data
MOV C, M ; Count
INX H
MOV A, M ; First number as max
DCR C ; Decrement count
LOOP: INX H
CMP M
JC SKIP
MOV A, M
SKIP: DCR C
JNZ LOOP
STA 4000H ; Store result
HLT
Assume count and data start from 3000H. Result stored at 4000H.
✅ 4. Finding Smallest in a Series
asmCopyEditLXI H, 3000H
MOV C, M ; Count
INX H
MOV A, M ; First number as min
DCR C
LOOP: INX H
CMP M
JNC SKIP
MOV A, M
SKIP: DCR C
JNZ LOOP
STA 4000H
HLT
✅ 5. Sorting a Series (Bubble Sort - Ascending Order)
asmCopyEditLXI H, 3000H
MOV B, M ; Number of elements
DCR B
LOOP1: MOV C, B
LXI H, 3001H
LOOP2: MOV A, M
INX H
CMP M
JC SKIP
MOV D, M
MOV M, A
DCX H
MOV M, D
INX H
SKIP: DCR C
JNZ LOOP2
DCR B
JNZ LOOP1
HLT
Assume number of elements at 3000H, elements from 3001H.
✅ 6. Data Transfer (Block Transfer)
asmCopyEditLXI H, 3001H ; Source address
LXI D, 4001H ; Destination address
LXI B, 05H ; Number of bytes to transfer
LOOP: MOV A, M
STAX D
INX H
INX D
DCR B
JNZ LOOP
HLT
Transfers 5 bytes from 3001H–3005H to 4001H–4005H.
Let me know if you'd like these programs explained step-by-step, or if you'd
like versions in Intel HEX or with comments customized for specific lab
assignments.