Programs For Cso Lab 8085 SRGI-2017
Programs For Cso Lab 8085 SRGI-2017
Apparatus required:
8085 micro processor kit
(0-5V) DC battery
Algorithm:
Step 1 : Start the microprocessor
Step 2 : Intialize 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 2 - 8 bit datas 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
C000 MVI C,00 OE, 00 Initialize the carry as zero
C002 LDA C100 3A, (00, C1) Load the first 8 bit data
C005 MOV, B,A 47 Copy the value of 8 bit data
into register B
C006 LDA C101 3A, (01, C1) Load the second 8 bit data
into the accumulator
C009 ADD B 80 Add the content of reg. B to
reg. A
C00A JNC D2, 0E, 41 Jump on if no carry to Loop
C00D INR C OC If carry is there increment it
by one
C00E Loop STA C102 32 (02, C1) Store the added value in the
accumulator
C011 MOV A,C 79 More the value of carry to the
accumulator from register C
C012 STA C103 32 (03, C1) Store the value of carry in the
accumulator
C015 HLT 76 Stop the program execution
AIM : 5.
WAP to multiply two 8 bit numbers stored at memory location C100 and C101 and stores
the result at memory location C200 and C201.
Apparatus required:
8085 microprocessor kit
(0-5V) DC battery
Algorithm:
Step 1 : Start the microprocessor
Step 2 : Get the 1st 8 bit numbers
Step 3 : Move the 1st 8it number to register ‘B’
Step 4 : Get the 2nd 8 bit number
Step 5 : Move the 2nd 8 bit number to register ‘C’
Step 6 : Intialise the accumulator as zero
Step 7 : Intialise the carry as zero
Step 8 : Add both register ‘B’ value as accumulator
Step 9 : Jump on if no carry
Step 10 : Increment carry by 1 if there is
Step 11 : Decrement the 2nd value and repeat from step 8, till the 2 nd value becomes zero.
Step 12 : Store the multiplied value in accumulator
Step 13 : Move the carry value to accumulator
Step 14 : Store the carry value in accumulator
Address Label Mnemonics Hex Code Comments
C000 LDA C100 3A, 00, C1 Load the first 8 bit number
C003 MOV B,A 47 Move the 1st 8 bit data to register ‘B’
C004 LDA C101 3A, 01, C1 Load the 2nd 8 it number
C007 MOV C,A 4F Move the 2nd 8 bit data to register ‘C’
C008 MVI A, 00 3E, 00 Initialise the accumulator as zero
C00A MVI D, 00 16, 00 Initialise the carry as zero
C00C ADD B 80 Add the contents of ‘B’ and accumulator
C00D JNC D2 11, C0 Jump if no carry
C010 INR D 14 Increment carry if there is
C011 Loop DCR C OD Decrement the value ‘C’
C012 JNZ C2 0C, C0 Jump if number zero
C015 STA C102 32 02, C2 Store the result in accumulator
C018 MOV A,D 7A Move the carry into accumulator
C019 STA C103 32,03,C2 Store the result in accumulator
C01C HLT 76 Stop the program execution
AIM: 6
WAP to add two 16-bit numbers. Store the result at memory address starting from C100.
Apparatus required:
8085 micro processor kit
(0-5V) DC battery
Algorithm:
Step 1 : Start the microprocessor
Step 2 : Get the 1st 8 bit in ‘C’ register (LSB) and 2nd 8 bit in ‘H’ register (MSB) of 16 bit number.
Step 3 : Save the 1st 16 bit in ‘DE’ register pair
Step 4 : Similarly get the 2nd 16 bit number and store it in ‘HL’ register pair.
Step 5 : Get the lower byte of 1st number into ‘L’ register
Step 6 : Add it with lower byte of 2nd number
Step 7 : tore the result in ‘L’ register
Step 8 : Get the higher byte of 1 st number into accumulator
Step 9 : Add it with higher byte of 2nd number and carry of the lower bit addition.
Step 10 : Store the result in ‘H’ register
Step 11 : Store 16 bit addition value in ‘HL’ register pair
Step 12 : Stop program execution
Address Label Mnemonics Hex Code Comments
C000 MVI C,00 0E C 00H
C001 00
C002 LHLD C100 2A HL – 1st No.
C003 00
C004 C1
C005 XCHG EB HL – DE
C006 LHLD C102 2A HL – 2nd No.
C007 02
C008 C1
C009 DAD D 19 Double addition DE
+ HL
C00A JNC AHEAD D2 If Cy = 0, G0 to
(C00E ) C00E
C00B 0E
C00C C0
C00D INR C 0C C C + 01
C00E AHEAD SHLD C104 22 C104 (sum) HL
C00F 04
C010 C1
C011 MOV C,A 79 A Cy
C012 STA C106 32 C106 Cy
C013 06
C014 C1
C015 HLT 76 Stop execution
AIM:7
WAP which tests if any bit is '0' in a data byte specified at an address C000. If it is so, 00
would be stored at address C001 and if not so then FF should be stored at the same address.
AIM :8
Assume that 4 bytes of data are stored at consecutive memory addresses of the data memory
starting at C100. Write a program which loads register C with (C100), i.e. with data
contained at memory address C100, D with (C101), E with (C102) and A with (C103).
LXI H ,C100
MVI C, 10
LOOP : INR M
INX H
DCR C
JNZ :LOOP
HLT
AIM:10
WAP to add 10 bytes stored at memory location starting from C100. Store the result at
memory location C10A.
LXI H,C100
MVI C, 0A
XRA A
BACK : ADD M
INX H
DCR C
JNZ BACK
MOV M,A
HLT