You are on page 1of 4

8085 MICROPROCESSOR PROGRAMMING

Rev. 1.0

This work is licensed under the Creative Commons Attribution-NonCommercial-Share Alike 2.5 India License. To view a copy of this license, visit http://creativecommons.org/licenses/by-nc-sa/2.5/in/deed.en or send a letter to Creative Commons, 171 Second Street, Suite 300, San Francisco, California, 94105, USA.

Page #1

8085 MICROPROCESSOR PROGRAMMING

Rev. 1.0

MULTIPLICATION OF TWO 16-BIT NUMBERS AIM


To write an assembly language program to multiply two 16-bit numbers and obtain the result

ASSEMBLY LANGUAGE PROGRAM


C400 LHLD C660 C401 C402 C403 SPHL C404 C405 C406 C407 C408 C409 C40A C40B C40C C40D C40E C40F C410 C411 C412 C413 C414 C415 C416 C417 C418 C419 C41A C41B C41C C41D C41E C41F C420 C421 C422 C423 LHLD C662 MOV D H MOV E L MVI L 00 MVI H 00 MVI B 00 MVI C 00 DAD SP JNC C416 INX DCX MOV ORA JNZ B D A E D C411 2A 60 C6 F9 2A 62 C6 54 5D 2E 00 26 00 06 00 0E 00 39 D2 16 C4 03 1B 7B B2 C2 11 C4 22 64 C6 79 32 66 C6 78 ; Load the HL register pair directly with ; Multiplicand ; ; Copy the HL register pair content (Multiplicand) to stack pointer ; Load the HL register pair directly with ; Multiplier ; ; Move the H register content to D register ; Move the L register content to E register ; Initialize the L register with 00H ; ; Initialize the H register with 00H ; ; Initialize the B register with 00H ; ; Initialize the C register with 00H ; ; Add stack pointer content with HL register pair ; If carry = 0, then jump to C416H ; ; ; Increment BC register pair ; Decrement DE register pair ; Move E register content to accumulator ; OR the D register content with accumulator ; If non zero, Jump to C411H ; ; ; Store the HL register pair content(1st and 2nd ; byte of Product) to memory at C664H and C665H ; ; Move the C register content to accumulator ; Store accumulator content(3rd byte of ; Product ) to memory at C666H ; ; Move the B register content to accumulator

SHLD C664 MOV A C STA C666 MOV A B

Page #2

8085 MICROPROCESSOR PROGRAMMING

Rev. 1.0

C424 STA C425 C426 C427 HLT

C667

32 67 C6 76

; Store the accumulator content(4th byte of ; Product) to memory at C667H ; ; Halt the execution

EXECUTION
C660 C661 C662 C663 C664 C665 C666 C667 02 0A 02 00 04 14 00 00 ; ; ; ; ; ; ; ; LSB of Multiplicand(Input data) MSB of Multiplicand(Input data) LSB of Multiplier(Input data) MSB of Multiplier(Input data) 1st byte of Product(Output data) 2nd byte of Product(Output data) 3rd byte of Product(Output data) 4th byte of product(Output data)

PROGRAM TRACE

Page #3

8085 MICROPROCESSOR PROGRAMMING

Rev. 1.0

FLAG WORD

REFERENCE
1. Ramesh S.Gaonkar, Microprocessor Architecture, Programming, and Applications, Fourth Edition, Penram International Publishing (India), 2000. 2. S.Subathra, Microprocessor Adhiparashakthi Engineering 2001 Laboratory, Record College, Melmaruvathur, work, March

3. S.Subathra, Programming in 8085 Microprocessor and its applications An Innovative Analysis, Technical Report, Adhiparashakthi Engineering College, Melmaruvathur, March 2003 4. Micro-85 EB, User Manual, Version 3.0, CAT #M85 EB-002, VI Microsystems Pvt. Ltd., Chennai. 5. Micro85 simulation software, Infotech Solutions, Calcutta.

Page #4

You might also like