Outputting to the parallel port (assembly 8086)

  • Thread starter snoggerT
  • Start date
  • Tags
    Parallel
In summary, the conversation is about a problem in code written in Assembly (8086). The issue is with a circuit that communicates with the parallel port on a computer. The code involves a simple down counter that is supposed to display on LEDs. The problem is that the correct port, 378H, is not working and only seems to work with 3BCH. The group has tested the circuit and it seems to be functioning properly. However, the port address can also be set to 3BC or 278 and can be changed in the BIOS. Some suggestions are made to check the BIOS settings and manually write the control bits for the parallel port. Finally, it is noted that only two groups out of fifteen are experiencing this problem
  • #1
snoggerT
186
0
So I'm having a problem in some code I'm working on in Assembly(8086). I've tried everything I can think of, but I can't seem to figure out the problem. So I have a circuit that I built with a DB25 plug so that it can communicate with the parallel port on the computer. All we had to do is make a simple down counter that was displayed to the LEDs on the circuit. The problem is that I can't get the correct port to work. The port should be 378H, but it only seems to sort of work with 3BCH. I've even tried the following simple code to just get a single number to output using port 378H:

.MODEL SMALL
.STACK 64
.DATA

.CODE

MAIN PROC FAR
MOV AL, 55H
MOV DX, 378H
OUT DX, AL

mov AH,4Ch ; return to DOS
int 21h

MAIN ENDP
END MAIN

Can anyone think of a reason that this won't work? Also, I have tested the circuit, and it seems to be working correctly.
 
Physics news on Phys.org
  • #2
There is no rule that says the parallel port must be at 378, it can also be at 3BC or even 278. Check in the bios you can probably choose what address to set it to.
 
  • #3
mgb_phys said:
There is no rule that says the parallel port must be at 378, it can also be at 3BC or even 278. Check in the bios you can probably choose what address to set it to.

Well, we think the port address issue is why the program won't work. Every other person in the class has had it work fine using port 378H except our group and one other, and they are having the same problem as we are. We even compiled/ran a friends program that worked at his lab station, but it didn't work on ours. I guess something could be wrong with the circuit, but then I don't know that that would explain why I can get it to output single numbers using 3BCH and not 378.

edit- Also, the actual hardware profile is showing the port address as 378H.
 
  • #4
Also, if your OS isn't setting the control bits for the parallel port, then you might need to write them yourself to tell the chip that you want those pins to be outputs. The control register is at port number base+3. 'Course that wouldn't directly explain why others are getting it to work, though.
 
  • #5
Can any of you think of why only 2 groups out of 15 would have a problem using port 378H? Even using the simple code I posted above is not working.
 

What is the purpose of outputting to the parallel port in assembly 8086?

The parallel port in assembly 8086 is used to send data from a computer to an external device, such as a printer or scanner. This allows the computer to control and communicate with the external device.

How do I output data to the parallel port in assembly 8086?

To output data to the parallel port in assembly 8086, you will need to use the OUT instruction followed by the port number and the data you want to send. For example, OUT 378H, AL will output the data stored in the AL register to the parallel port with the address 378H.

What is the difference between outputting data to the parallel port and to other ports in assembly 8086?

The parallel port in assembly 8086 uses a different set of instructions and addresses than other ports, such as the serial port or the keyboard port. Additionally, the parallel port is designed to send data in parallel, meaning it can send multiple bits of data at the same time, whereas other ports may only send one bit at a time.

Can I output data to the parallel port without using assembly 8086?

Yes, there are other programming languages and methods that can be used to output data to the parallel port, such as C++ or using a parallel port library. However, assembly 8086 is commonly used for direct hardware manipulation and may be necessary for certain applications.

What are some common errors when outputting to the parallel port in assembly 8086?

Some common errors when outputting to the parallel port in assembly 8086 include using the wrong port address, not sending the correct data format expected by the external device, and not properly initializing the parallel port before attempting to send data. It is important to carefully read the documentation and follow the correct syntax when working with the parallel port in assembly 8086.

Similar threads

  • Engineering and Comp Sci Homework Help
Replies
20
Views
3K
  • Engineering and Comp Sci Homework Help
Replies
1
Views
2K
  • Engineering and Comp Sci Homework Help
Replies
1
Views
1K
  • Engineering and Comp Sci Homework Help
Replies
9
Views
3K
  • Engineering and Comp Sci Homework Help
Replies
5
Views
3K
  • Engineering and Comp Sci Homework Help
Replies
12
Views
3K
  • Electrical Engineering
Replies
4
Views
2K
  • Programming and Computer Science
Replies
4
Views
2K
  • Programming and Computer Science
Replies
7
Views
6K
  • Programming and Computer Science
Replies
4
Views
4K
Back
Top