7
8085 MICROPROCESSOR PROGRAMMING Rev. 1.0 Page #1 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.

8085 MICROPROCESSOR PROGRAMMING Rev. 1 · 2018. 9. 6. · 8085 MICROPROCESSOR PROGRAMMING Rev. 1.0 Page #6 PROGRAM TRACE FLAG WORD REFERENCE 1. Ramesh S.Gaonkar, “Microprocessor

  • Upload
    others

  • View
    49

  • Download
    1

Embed Size (px)

Citation preview

Page 1: 8085 MICROPROCESSOR PROGRAMMING Rev. 1 · 2018. 9. 6. · 8085 MICROPROCESSOR PROGRAMMING Rev. 1.0 Page #6 PROGRAM TRACE FLAG WORD REFERENCE 1. Ramesh S.Gaonkar, “Microprocessor

8085 MICROPROCESSOR PROGRAMMING Rev. 1.0

Page #1

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 2: 8085 MICROPROCESSOR PROGRAMMING Rev. 1 · 2018. 9. 6. · 8085 MICROPROCESSOR PROGRAMMING Rev. 1.0 Page #6 PROGRAM TRACE FLAG WORD REFERENCE 1. Ramesh S.Gaonkar, “Microprocessor

8085 MICROPROCESSOR PROGRAMMING Rev. 1.0

Page #2

BCD to hexadecimal code conversion

AIM To write an assembly language program to convert BCD number

in to hexadecimal number

ASSEMBLY LANGUAGE PROGRAM

C000 LXI H C100 21 ; Initialize the HL register pair

C001 00 ;

C002 C1 ;

C003 MOV C M 4E ; Move the content of memory to C register

C004 MOV A C 79 ; Move the C register content in to

accumulator

C005 ANI 0F E6 ; And the data byte of OFH with the content of

C006 0F ; accumulator

C007 MOV E A 5F ; Move the content of accumulator to E

register

C008 MOV A C 79 ; Move the C register content in to

accumulator

C009 ANI F0 E6 ; And the databyte FOH with the content of

C00A F0 ; accumulator

C00B RRC 0F ; Rotate right through carry the accumulator

C00C RRC 0F ; Rotate right through carry the accumulator

C00D RRC 0F ; Rotate right through carry the accumulator

C00E RRC 0F ; Rotate right through carry the accumulator

C00F MOV D A 57 ; Move the accumulator content into D register

C010 MVI A 00 3E ; Move immediate 00H to the accumulator

C011 00 ;

C012 ADI 0A C6 ; Add immediate data OAH to the accumulator

C013 0A ;

C014 DCR D 15 ; Decrement the D register

C015 JNZ C012 C2 ; Jump if no zero to C012H

C016 12 ;

C017 C0 ;

C018 ADD E 83 ; Add the content of E register to the

accumulator

C019 STA C101 32 ; Store the accumulator content at C101H

C01A 01 ;

C01B C1 ;

C01C HLT 76 ; Halt the execution

EXECUTION – 1 C100 27 ; BCD number(Input data)

C101 1B ; Hexadecimal number(Output data)

Page 3: 8085 MICROPROCESSOR PROGRAMMING Rev. 1 · 2018. 9. 6. · 8085 MICROPROCESSOR PROGRAMMING Rev. 1.0 Page #6 PROGRAM TRACE FLAG WORD REFERENCE 1. Ramesh S.Gaonkar, “Microprocessor

8085 MICROPROCESSOR PROGRAMMING Rev. 1.0

Page #3

PROGRAM TRACE

FLAG WORD

EXECUTION - 2

C100 65 ; BCD number (Input data)

C101 41 ; Hexadecimal number(Output data)

Page 4: 8085 MICROPROCESSOR PROGRAMMING Rev. 1 · 2018. 9. 6. · 8085 MICROPROCESSOR PROGRAMMING Rev. 1.0 Page #6 PROGRAM TRACE FLAG WORD REFERENCE 1. Ramesh S.Gaonkar, “Microprocessor

8085 MICROPROCESSOR PROGRAMMING Rev. 1.0

Page #4

PROGRAM TRACE

FLAG WORD

EXECUTION - 3

C100 66 ; BCD number (Input data)

C101 42 ; Hexadecimal number(Output data)

Page 5: 8085 MICROPROCESSOR PROGRAMMING Rev. 1 · 2018. 9. 6. · 8085 MICROPROCESSOR PROGRAMMING Rev. 1.0 Page #6 PROGRAM TRACE FLAG WORD REFERENCE 1. Ramesh S.Gaonkar, “Microprocessor

8085 MICROPROCESSOR PROGRAMMING Rev. 1.0

Page #5

PROGRAM TRACE

FLAG WORD

EXECUTION - 4

C100 40 ; BCD number(Input data)

C101 28 ; Hexadeecimal number(Output data)

Page 6: 8085 MICROPROCESSOR PROGRAMMING Rev. 1 · 2018. 9. 6. · 8085 MICROPROCESSOR PROGRAMMING Rev. 1.0 Page #6 PROGRAM TRACE FLAG WORD REFERENCE 1. Ramesh S.Gaonkar, “Microprocessor

8085 MICROPROCESSOR PROGRAMMING Rev. 1.0

Page #6

PROGRAM TRACE

FLAG WORD

REFERENCE

1. Ramesh S.Gaonkar, “Microprocessor Architecture, Programming, and Applications”, Fourth Edition, Penram International

Publishing (India), 2000.

2. S.Subathra, “Microprocessor Laboratory”, Record work,

Adhiparashakthi Engineering College, Melmaruvathur, March

2001

3. S.Subathra, “Programming in 8085 Microprocessor and its

applications – An Innovative Analysis”, Technical Report,

Page 7: 8085 MICROPROCESSOR PROGRAMMING Rev. 1 · 2018. 9. 6. · 8085 MICROPROCESSOR PROGRAMMING Rev. 1.0 Page #6 PROGRAM TRACE FLAG WORD REFERENCE 1. Ramesh S.Gaonkar, “Microprocessor

8085 MICROPROCESSOR PROGRAMMING Rev. 1.0

Page #7

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.