Solving 8085 Weird Problem with DCX/DCR Instruction

  • Thread starter Thread starter prescott2006
  • Start date Start date
  • Tags Tags
    Weird
Join the discussion
Ask a follow-up here, or get your own question answered by working scientists, mathematicians and engineers — people, not an autocomplete.
Real named experts · corrections over time · the nuance an AI answer skips
4 replies · 3K views
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.