EET3400 LABS : MICROPROCESSOR JAN/APRIL 2022
MICROPROCESSOR LABS: USING INTEL 8085 MICROPROCESSOR LED TRAINER KIT
LAB1: HEXADECIMAL ADDITIONS OF TWO NUMBERS.
The program takes the content of 2009 adds it to 200A and stores the result back at 200B
ALGORITHMS:
(1) Initialize HL Register pair with address where the first number is lying.
(2) Store the number in the accumulator.
(3) Get the second number.
(4) Add the two numbers and store the result in 200B.
(5) Go to Monitor
ADDRESS CODE LABEL MNEMONIC OPERAND COMMENTS
2000 21 09 20 START LXI H, 2009 Point to first number
2003 7E MOV A, M Load the accumulator
2004 23 INX H Advance pointer
2005 86 ADD M Add the second number
2006 23 INX H Advance pointer
2007 77 MOV MA Store result
2008 EF RST 5
2009 DATA First number to be added
200A DATA Second number to be added
200B RESULT Result
Example:
Address Data
2009 1A
200A 18
200B 32 Data in Hex Number.
LAB2: THE DECIMAL ADDITION OF TWO DECIMAL NUMBERS. THE RESULT SHOULD NOT BE
GREATER THAN 199.
The program will add two decimal numbers lying at 200A and 200B.The result will be stored in decimal
at 200C.
ALGORITHMS:
(1) Load the contents of first location in Accumulator.
(2) Add it with the contents of second location.
(3) Adjust the decimal.
(4) Store the result and go back to monitor.
ADDRESS CODE LABEL MNEMONIC OPERAN COMMENTS
D
2000 21 0A 20 LXI H, 200A Point to first number
2003 7E MOV A, M Load it in to accumulator
2004 23 INX H Point to second number
2005 86 ADD M Add the two numbers
2006 27 DAA Convert to decimal
2007 23 INX H Point to Storage
2008 77 MOV M,A Store it
2009 EF RST 5
200A DATA Two decimal numbers to be added
200B DATA
200C RESULT Result
Example:
Address Data
200A23
200B 32
200C55 Answer in decimal.
LAB3: ADD TWO SIXTEEN BIT NUMBERS.
The program will add two sixteen bit numbers lying at 200C, 200D, 200E and 200F.The result will be
stored at 2010 and 2011. Carry is neglected.
ALGORITHMS:
(1) Load the first number in HL.
(2) Load the second number.
(3) Add the two and store result.
(4) Go back to monitor.
ADDRESS CODE LABEL MNEMONIC OPERAND COMMENTS
2000 21 0C 20 START LHLD 200C Load the HL Register with first
number
2003 EB DCHG Exchange the HL and DE register
2004 2A OE 20 LHLD 200E Load the HL register with second
number
2007 19 DAD Add HL and DE Registers
2008 22 10 20 SHLD 2010 Store the result in 2010
200B EF RST 5 Point to Storage
200C First No. LSB First 16-bit number
200D First No. MSB
200E Second No. LSB Second 16-bit number
200F Second No. MSB
2010 RESULT LSB Result of addition
2011 RESULT MSB
Example:
Address Data
200CCA LSB1
200DA7 MSB1
200E 6B LSB2
200F B9 MSB2
2010 35 LSB1 + LSB2 (CA + 6B)
2011 61 MSB1 + MSB2 (A7 + B9)
LAB 4: TO MULTIPLY TWO 8 BIT NUMBERS
PROGRAM ANALYSIS:
Two 8 bit numbers are stored in memory locations 8100 and 8101. They are
multiplied and the results are stored in memory locations 8200 and 8201.
Memory Machine Label Opcode Operand Comments
Address code
8000 AF XRA A Clear A
8001 A8 XRA B Clear B
8002 A9 XRA C Clear C
8003 21 LXIH 8100 Set HL pair as index
8004 00 to source memory
8005 81
8006 46 MOVB,M Move[M] to B
8007 23 INXH Increment HL pair
8008 86 L2 ADD M Add[A] to [M]
8009 D2 JNC L1 Jump if no carry to
800A 0D L1
800B 80
800C 0C INRC Increment [C]
800D 05 L2 DCRB Decrement[B]
800E C2 JNZ L2 Jump if non zero to
800F 08 L2
8010 80
8011 32 STA 8200 Store[A] IN 8200
8012 00
8013 82
8014 79 MOVA,C Move[C] to A
8015 32 STA 8201 Store[A] in memory
8016 01 location 8201
8017 82
8018 76 HLT Halt program
Result: The program is executed and the results are stored in the memory locations 8200 and 8201.
Input: At 8100: 03
At 8101: 02
Output: At 8200: 06
At 8201: 00