Professional Documents
Culture Documents
AIM:
To write an assembly language program to find the largest number of given array
using the microprocessor 8085.
APPARATUS REQUIRED:
ALGORITHM:
8200 05
8201
8203
INPUT
8204
8205
8206
OUTPUT 8300
PROGRAM:
MEMORY COMMENT
OP-CODE LABEL MNEMONICS
ADDRESS
8100 21, 00,82 LXI H,8200 Load the array size to the HL
pair
8103 46 MOV B,M Copy the array size to C
register
8104 23 INX H Increment memory by 1
8105 7E MOV A,M Copy the data to the
accumulator
8106 05 DCR B Decrement array size by 1
8107 23 LOOP INX H Increment memory by 1
8108 BE CMP M Compare accumulator and
memory content
8109 DA, 0D, 81 JNC SKIP Jump on carry to the label
SKIP
810C 46 MOV A,M Copy memory content to B
register
810D 05 SKIP DCR B Decrement array size by 1
810E C2, 07, 81 JNZ LOOP Jump on non-zero to the label
LOOP
8111 32,00,83 STA 8300 Store the result
8114 76 HLT Program ends
RESULT:
The largest number in the given array was find successfully
EXP NO:4 (B) MULTI-BYTE ADDITION IN BCD MODE
AIM:
To write an assembly language program to find the addition of the given multi-
byte number using the microprocessor 8085.
APPARATUS REQUIRED:
ALGORITHM:
8500 03
8501
8503
INPUT 8504
8505
8506
8507
8510
OUTPUT 8511
8512
PROGRAM:
MEMORY COMMENT
OP-CODE LABEL MNEMONICS
ADDRESS
8100 31,00, 20 LXI SP, Initialize Stack Pointer
2000H
8103 21,00, 85 LXI H,8500H load memory address to get
byte count
8106 4E MOV C,M load memory content into C
register
8107 06,00 MVI B,00H clear B register
8109 21,01, 85 LXI H, 8501H load first argument address
810C 11,05, 85 LXI D, 8505H load second argument address
810F 1A LOOP LDAX D load DE with second operand
address
8110 8E ADC M Add memory content and
carry with Acc
8111 27 DAA Decimal adjust the acc content
8112 F5 PUSH PSW Store the accumulator content
into the stack
8113 4 INR B increase b after pushing into a
stack
8114 23 INX H Increase HL pair to point next
address
8115 13 INX D Increase DE pair to point next
address
8116 0D DCR C Decrease c to while all bytes
are not exhausted
8117 C2,0F, 81 JNZ LOOP When bytes are not
considered, loop again
811A D2,21, 81 JNC SKIP when carry = 0, jump to store
811D 3E,01 MVIA, 01H when carry = 1, push it into
stack
811F F5 PUSH PSW Store the accumulator content
into the stack
8120 04 INR B increase b after pushing into
the stack
MEMORY COMMENT
OP-CODE LABEL MNEMONICS
ADDRESS
8121 21,F0, 85 SKIP LXIH, 85F0H load the destination pointer
RESULT:
The largest number in the given array was find successfully