Does Changing AL Register Affect Parallel Port Output in Assembly Language?

Click For Summary

Discussion Overview

The discussion revolves around the behavior of data output to a parallel port in assembly language, specifically focusing on whether changing the AL register after outputting data affects the output state. Participants explore the implications of program termination on the data present at the parallel port's pins and the nature of data latching in hardware.

Discussion Character

  • Technical explanation
  • Debate/contested

Main Points Raised

  • One participant questions what happens to the data at the parallel port's pins after program termination and whether changing the AL register affects the output.
  • Another participant suggests consulting the device's data sheet for definitive answers, sharing their experience with PIC processors.
  • A participant recalls their experience with a TRS80, stating that data sent to the port latches and remains until changed by the program.
  • It is noted that the definition of 'program termination' can vary, with implications for output behavior depending on the system's state, such as sleep mode or endless loops.
  • One participant identifies the code as x86 (8086) and explains that output ports typically latch data, indicating that changing the AL register after outputting will not affect the output state.

Areas of Agreement / Disagreement

Participants express differing views on the behavior of the output after program termination, with some asserting that the data remains latched while others emphasize the need for more context about the specific hardware and program behavior. No consensus is reached on the exact implications of changing the AL register post-output.

Contextual Notes

Participants highlight the importance of hardware specifications and documentation, indicating that behavior may depend on specific implementations and definitions of program states. There are unresolved questions regarding the exact nature of program termination and its effects on output.

Who May Find This Useful

This discussion may be useful for individuals interested in assembly language programming, parallel port interfacing, and hardware behavior in computing systems.

muh_j18
Messages
21
Reaction score
0
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
.
.
.
 
Engineering news on Phys.org
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.
 
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.
 
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 interrupt 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.
 
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.
 

Similar threads

Replies
1
Views
2K
  • · Replies 4 ·
Replies
4
Views
10K
  • · Replies 5 ·
Replies
5
Views
4K
  • · Replies 10 ·
Replies
10
Views
14K
  • · Replies 9 ·
Replies
9
Views
4K
  • · Replies 3 ·
Replies
3
Views
4K
  • · Replies 1 ·
Replies
1
Views
3K
  • · Replies 1 ·
Replies
1
Views
3K
  • · Replies 1 ·
Replies
1
Views
2K
  • · Replies 12 ·
Replies
12
Views
3K