Solving 8085 Weird Problem with DCX/DCR Instruction

  • Thread starter prescott2006
  • Start date
  • Tags
    Weird
In summary: It's also interesting that the bug only occurs when you use the "dcx" instruction. Do you know what other instructions might be affected by this bug?
  • #1
prescott2006
25
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
  • #2
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.
 
  • #3
i do not request anything here.just want to ask whether you guy ever seen such case or not.
 
  • #4
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.
 
  • #5
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.
 

1. What is the 8085 Weird Problem with DCX/DCR Instruction?

The 8085 Weird Problem with DCX/DCR Instruction refers to a phenomenon where the decrement (DCR) and decrement and exchange (DCX) instructions do not function properly in certain cases. This is due to a design flaw in the 8085 microprocessor, where the decrement operation is performed before the exchange operation, resulting in an incorrect value being exchanged.

2. How does the 8085 Weird Problem affect programming?

The 8085 Weird Problem can cause unexpected results in programming, as the decrement and exchange operations may not be performed as intended. This can result in incorrect values being stored in memory or registers, leading to errors in the program's execution.

3. What is the cause of the 8085 Weird Problem?

The 8085 Weird Problem is caused by a design flaw in the 8085 microprocessor. Due to the order in which the decrement and exchange operations are performed, the exchange operation may be performed using an incorrect value, leading to incorrect results.

4. How can the 8085 Weird Problem be avoided?

The 8085 Weird Problem can be avoided by using alternative instructions, such as the decrement and increment (DCR/INR) instructions, instead of the DCX instruction. Additionally, careful programming and testing can help identify and prevent any unexpected behavior caused by the 8085 Weird Problem.

5. Can the 8085 Weird Problem be fixed?

Unfortunately, the 8085 Weird Problem is a design flaw in the 8085 microprocessor and cannot be fixed. The only way to avoid it is to use alternative instructions or be aware of its existence and account for it in programming. However, newer microprocessors have addressed this issue and do not have the same problem with the DCX/DCR instruction.

Similar threads

  • Engineering and Comp Sci Homework Help
Replies
2
Views
3K
  • General Discussion
Replies
4
Views
671
  • Engineering and Comp Sci Homework Help
Replies
5
Views
2K
Replies
10
Views
2K
Replies
7
Views
3K
  • Special and General Relativity
2
Replies
42
Views
4K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
1
Views
7K
Back
Top