A problem with coding in 8085 microprocessor

  • Thread starter Thread starter dragonflyv2
  • Start date Start date
  • Tags Tags
    Coding
AI Thread Summary
The discussion revolves around a coding issue encountered while using the 80085 simulator for basic arithmetic operations. The provided assembly code is intended to load the value 01H into memory location 0002H. However, the code does not perform as expected. The sequence of operations includes storing 00H at address 0001H and 01H at address 0002H, followed by an attempt to transfer the contents of address 0001H to address 0002H. The confusion arises from the logic of the program, as it effectively overwrites the intended value at 0002H with the value from 0001H instead of achieving the desired outcome. The discussion highlights the importance of understanding memory operations and the flow of data in assembly language programming.
dragonflyv2
Messages
1
Reaction score
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
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:
Thread 'Is this public key encryption?'
I've tried to intuit public key encryption but never quite managed. But this seems to wrap it up in a bow. This seems to be a very elegant way of transmitting a message publicly that only the sender and receiver can decipher. Is this how PKE works? No, it cant be. In the above case, the requester knows the target's "secret" key - because they have his ID, and therefore knows his birthdate.
I tried a web search "the loss of programming ", and found an article saying that all aspects of writing, developing, and testing software programs will one day all be handled through artificial intelligence. One must wonder then, who is responsible. WHO is responsible for any problems, bugs, deficiencies, or whatever malfunctions which the programs make their users endure? Things may work wrong however the "wrong" happens. AI needs to fix the problems for the users. Any way to...

Similar threads

Back
Top