Dismiss Notice
Join Physics Forums Today!
The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

A problem with coding in 8085 microprocessor

  1. Sep 8, 2012 #1
    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
    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.
  2. jcsd
  3. Sep 9, 2012 #2


    User Avatar
    Science Advisor

    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: Sep 9, 2012
Share this great discussion with others via Reddit, Google+, Twitter, or Facebook