Assembly language question

In summary, when outputting data to the parallel port, the data remains latched at the port's pins until another output instruction overrides it. Changing the data in AL after outputting will not affect the output. It is recommended to consult the data sheet and documentation for more specific information and to consider the overall context of the program in question.
  • #1
muh_j18
21
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
  • #2
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
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
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.
 
  • #5
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.
 

What is Assembly language?

Assembly language is a low-level programming language that is closely related to the machine code of a computer. It uses mnemonic codes to represent machine instructions and allows direct control over the computer's hardware.

What are some common uses of Assembly language?

Assembly language is commonly used for writing device drivers, operating systems, and embedded systems. It is also used for optimizing critical parts of applications and for reverse engineering.

What are the advantages of using Assembly language?

Assembly language allows for direct access to the computer's hardware, making it very efficient in terms of speed and memory usage. It also offers a high level of control and flexibility, making it ideal for programming tasks where performance is critical.

What are the disadvantages of using Assembly language?

Assembly language is very low-level and can be difficult to learn and debug. It is also highly dependent on the specific hardware and architecture of the computer, making it less portable and may require rewriting for different systems.

How does Assembly language compare to other programming languages?

Assembly language is considered a low-level language compared to higher-level languages like C or Java. This means that it is closer to the computer's hardware and requires more detailed instructions to perform tasks. Higher-level languages are easier to learn and write, but they may sacrifice some performance and control compared to Assembly language.

Similar threads

  • Engineering and Comp Sci Homework Help
Replies
20
Views
3K
  • Engineering and Comp Sci Homework Help
Replies
4
Views
3K
  • Computing and Technology
Replies
2
Views
633
  • Programming and Computer Science
Replies
4
Views
2K
  • Electrical Engineering
Replies
1
Views
2K
  • Programming and Computer Science
Replies
5
Views
3K
  • Engineering and Comp Sci Homework Help
Replies
1
Views
2K
  • Engineering and Comp Sci Homework Help
Replies
4
Views
1K
  • Engineering and Comp Sci Homework Help
Replies
9
Views
3K
  • Engineering and Comp Sci Homework Help
Replies
4
Views
9K
Back
Top