Solving 8085 Weird Problem with DCX/DCR Instruction

  • Thread starter Thread starter prescott2006
  • Start date Start date
  • Tags Tags
    Weird
Click For Summary

Discussion Overview

The discussion revolves around an issue encountered while interfacing the 8085 microprocessor with memory and LEDs, specifically regarding the behavior of the DCX and DCR instructions in a program designed to light up LEDs sequentially with a delay. Participants explore the reasons behind the 8085's recognition of these instructions and the implications for debugging the program.

Discussion Character

  • Exploratory, Technical explanation, Debate/contested, Homework-related

Main Points Raised

  • One participant reports that the 8085 does not recognize the DCX instruction but does recognize DCR, leading to a change in their program to achieve the desired delay.
  • Another participant questions the assumption that DCX does not work, suggesting that the issue may stem from a misuse of the instruction rather than a fault in the 8085 itself.
  • A later reply indicates that the DCX instruction is functioning as intended, as it decrements a register pair, but hints at a potential bug in the simulator used for testing.
  • Participants discuss the importance of debugging and understanding the instructions rather than assuming they are faulty.
  • Areas of Agreement / Disagreement

    There is no consensus on whether the issue lies with the 8085's instruction set or the user's understanding of it. Some participants suggest a misunderstanding or misuse of the DCX instruction, while others express uncertainty about the simulator's accuracy.

    Contextual Notes

    Participants mention the need for a detailed instruction reference guide and debugging resources, indicating that the discussion may be limited by the participants' access to documentation and tools for troubleshooting.

    Who May Find This Useful

    This discussion may be useful for students and practitioners working with the 8085 microprocessor, particularly those interested in instruction behavior, debugging techniques, and interfacing projects.

prescott2006
Messages
24
Reaction score
0
we were requested to interface 8085 with memory and led,then a routine need to be written to make the led light up one at a time with delay 1 second.we have simulate the program and it run perfectly but when we test on the circuit we built it doesn't work.after a lot of trial and error,finally we found that answer,the 8085 does not recognize DCX,it only recognize DCR,so we only change the DCX in our original program to DCR to perform delay.do you guy know why the 8085 behave like this?simply does not recognize the DCX instruction.our lecturer also say never seen this before.
 
Physics news on Phys.org
prescott2006 said:
we were requested to interface 8085 with memory and led,then a routine need to be written to make the led light up one at a time with delay 1 second.we have simulate the program and it run perfectly but when we test on the circuit we built it doesn't work.after a lot of trial and error,finally we found that answer,the 8085 does not recognize DCX,it only recognize DCR,so we only change the DCX in our original program to DCR to perform delay.do you guy know why the 8085 behave like this?simply does not recognize the DCX instruction.our lecturer also say never seen this before.

You are expected to show MUCH more effort than this in your schoolwork questions here on the PF. Post your code and work so far, and ask a specific question about the code. We do not do your schoolwork for you here.
 
i do not request anything here.just want to ask whether you guy ever seen such case or not.
 
Hi Prescott, I think what Berkeman means is that you don't seem to have done much in the way of trying to debug the code yourself. I appreciate that you have done plenty of work on project as a whole, but it does seem very presumptuous to just assume that "dcx" doesn't work rather than to look into it further to find out how you have misused the instruction.

As it turns out it is a fairly simple problem with a simple solution and if you have a reasonably detailed instruction reference guide you should be able to discover the reason without too much effort. You know that the systematic analysis required to debug an issue like this really is a very important part of what you are learning. :)

Tell us what resources you have to debug with (eg break points etc) and what documentation you have on hand. I can offer some more if you're still stuck after following up on the above hints.
 
Hey Prescott, did you figure this one out yet? The "dcx" instruction does do what it's supposed to do, it decrements a register pair. I doesn't however ... ?

Can you fill in the ... ?

It's interesting that your simulator didn't model this correctly. It would be a bug in the simulator rather than a bug in the 8085.
 

Similar threads

Replies
5
Views
3K
  • · Replies 4 ·
Replies
4
Views
3K
Replies
7
Views
3K
Replies
10
Views
5K
  • · Replies 42 ·
2
Replies
42
Views
8K