A problem with coding in 8085 microprocessor

  • Thread starter dragonflyv2
  • Start date
  • Tags
    Coding
In summary, the code is supposed to store the value 01H in the memory location 0002H, but it is not working as expected. The logic used in the code stores 00 at location 0001 and 01 at location 0002 before transferring the contents of 0001 to 0002 and halting. It is unclear what the intended purpose of the code is.
  • #1
dragonflyv2
1
0
After i had studied and implemented codes to perform basic arithematic operations, factorial of a number, look-up tables, i got stuck at a pretty silly problem, while coding with the 80085 simulator:

MVI A,000H
STA 0001H
MVI A,0001H
STA 0002H
LXI H,0001H
MOV A,M
LXI B,0002H
STAX B
HLT
This piece of code is supposed to load the value 01H in the memory location 0002H. But it doesno't go as i expected. Where is the error with my logic.
 
Technology news on Phys.org
  • #2
dragonflyv2 said:
MVI A,000H
STA 0001H
MVI A,0001H
STA 0002H
LXI H,0001H
MOV A,M
LXI B,0002H
STAX B
HLT
This piece of code is supposed to load the value 01H in the memory location 0002H. But it doesno't go as i expected. Where is the error with my logic.
Assuming that you have RAM at memory address 0000...?, then that program should store zero at both address 0000 and 0001, though it's a convoluted way of doing it. What are you actually trying to achieve?

Basically your program does the following
- stores 00 at location 0001
- stores 01 at location 0002
- transfers the contents of 0001 to 0002
 
Last edited:

1) What is a 8085 microprocessor?

The 8085 microprocessor is an 8-bit microprocessor that was first introduced by Intel in 1976. It is widely used in various electronic devices and is known for its simplicity and low cost.

2) What is the most common problem encountered when coding for the 8085 microprocessor?

The most common problem encountered when coding for the 8085 microprocessor is incorrect or incomplete coding. This can lead to errors in the program and make it difficult to execute the desired task.

3) How can one troubleshoot coding errors in the 8085 microprocessor?

To troubleshoot coding errors in the 8085 microprocessor, one can use an emulator or simulator to test the program and identify any errors. Additionally, checking the code line by line and referring to the 8085 microprocessor's programming manual can also help in identifying and resolving coding errors.

4) What are some common tips for coding in the 8085 microprocessor?

Some common tips for coding in the 8085 microprocessor include understanding the instruction set and addressing modes, using comments to make the code more readable, and checking for any hardware limitations that may affect the program's execution.

5) Are there any resources available for learning and improving coding skills for the 8085 microprocessor?

Yes, there are various online resources, tutorials, and forums available for learning and improving coding skills for the 8085 microprocessor. Additionally, referring to textbooks and practice problems can also help in mastering coding for the 8085 microprocessor.

Similar threads

Replies
2
Views
3K
Back
Top