Solving 8085 Weird Problem with DCX/DCR Instruction

  • Thread starter Thread starter prescott2006
  • Start date Start date
  • Tags Tags
    Weird
AI Thread Summary
The discussion revolves around an issue with the 8085 microprocessor where the DCX instruction was not recognized, leading to problems in a project involving LED control. After simulation success, the circuit failed to operate until the instruction was changed from DCX to DCR, which resolved the delay issue. Participants noted that the DCX instruction is intended for decrementing register pairs, not for the intended use in this context. The conversation highlights the importance of debugging and understanding instruction behavior, suggesting that the simulator may have a bug. The overall takeaway emphasizes the need for thorough analysis and resource utilization when troubleshooting microprocessor programming issues.
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.
 
Back
Top