Assembly language question

  • Thread starter muh_j18
  • Start date
  • #1
21
0

Main Question or Discussion Point

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
.
.
.
 

Answers and Replies

  • #2
Averagesupernova
Science Advisor
Gold Member
3,593
601
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.
 
  • #3
887
98
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.
 
  • #4
Averagesupernova
Science Advisor
Gold Member
3,593
601
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.
 
  • #5
uart
Science Advisor
2,776
9
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.
 

Related Threads on Assembly language question

  • Last Post
Replies
5
Views
4K
  • Last Post
Replies
10
Views
32K
Replies
10
Views
8K
Replies
1
Views
5K
  • Last Post
Replies
9
Views
6K
Replies
7
Views
3K
  • Last Post
Replies
2
Views
1K
  • Last Post
Replies
3
Views
1K
Replies
3
Views
4K
Replies
8
Views
3K
Top