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

Assembly language question

  1. Apr 7, 2010 #1
    when outputing data to the parallel port, after the execution of the program, and when it terminates, what happens to the data that was at the parallel port's pins? do they still the same, or do they change immediatley?
    and inside the program, does changing the data in AL, changes the output? like in the following example:
    .
    .
    .
    mov dx,378h
    mov al,00110011b
    out dx,al; now the data on the ouput are 00110011, but do they change after this
    mov al,14h ; instruction?
    add al,2
    .
    .
    .
     
  2. jcsd
  3. Apr 7, 2010 #2

    Averagesupernova

    User Avatar
    Science Advisor
    Gold Member

    Have a look at the data sheet for the device. I've never programmed in assembly, just C, and I don't know which processor you are referring to. But I can tell you that with the experience I have had with PIC processors I have NEVER had a question unanswered by the data-sheet or anything that comes with the MPLAB programming environment.
     
  4. Apr 7, 2010 #3
    Many years ago I did some assembly language programming for a parallel printer port on a TRS80. If my memory serves me correct, the data sent to the port latches and remains the same until your program or another program changes it. However, as Averagesupernova advised, it is best to consult the data-sheet and documentation.
     
  5. Apr 7, 2010 #4

    Averagesupernova

    User Avatar
    Science Advisor
    Gold Member

    It also depends on how you define 'the program terminates'. PICs for instance have various modes of powering down, sleep mode, etc. Also, when your program terminates it could simply go into an endless loop and stay there until an external interupt transfers control to another part of the program. In this case I can't see why the output register would do anything other than keep the last data written to it latched. So, (and I say this all the time) more information please. If we knew a bit more about the big picture we may come up with a better answer. Or, you may have already had it answered by the last several posts.
     
  6. Apr 9, 2010 #5

    uart

    User Avatar
    Science Advisor

    That looks like x86 (8086) code. Typically the output ports on such a processor are implemented in external hardware and not built into the processor itself. Most output port implementations will latch the data, so yes it will remain valid until another output instruction overrides it. Changing the AL register after outputing will definitely not effect the state of the output port.
     
Know someone interested in this topic? Share this thread via Reddit, Google+, Twitter, or Facebook




Similar Discussions: Assembly language question
  1. Assembly language (Replies: 5)

Loading...