8085 results

Discussion in 'Homework Help' started by Leite33, Jan 11, 2016.

  1. Leite33

    Thread Starter Member

    Nov 28, 2015
    Dear friends i have the above circuit

    And the above code
    So i have to explain what will happen when i will execute the program to the leds. Can anyone help me? Describe some basic things?
  2. JohnInTX


    Jun 26, 2012
    Sure. The two NAND gates are the address decoders for the output ports.
    R1's address is 0xxxxxx1
    R2's address is 0xxxxxx0
    The other lines are control lines from the 8085 that are gated to select IO operations.
    The code uses OUT instructions to write to the specified port.

    So given that, which port is which and what do the LED's do as the program executes? To know that, use a pencil and paper with a register diagram of the 8085 and trace each instruction from PROGX.
    The XTHL construct is tricky - hint: what does XTHL do and what is in HL after executing it and why does it need to be executed again before the RET?
    Bonus question: Why is this an example of poor programming practice?

    I miss the 8085 sometimes.
    Last edited: Jan 11, 2016
    absf likes this.