I need to know how to do an interrupt routine of a parallel port on Pascal for my university's scientifc research!
I appreciate the attention!
Geeks To Go is a helpful hub, where thousands of volunteer geeks quickly serve friendly answers and support. Check out the forums and get free advice from the experts. Register now to gain access to all of our features, it's FREE and only takes one minute. Once registered and logged in, you will be able to create topics, post replies to existing threads, give reputation to your fellow members, get your own private messenger, post status updates, manage your profile and so much more.
Create Account How it WorksEdited by lucas89_chuck, 19 January 2009 - 12:50 PM.
Dos;
LptPort = $378;
LptVector = $38;
IRQ = $7;
Count : word;
OldISR : pointer;
mov dx, Port
in al, dx
mov cl, Bit
and cl, 7
mov ah, 1
shl ah, cl
or al, ah
out dx, al
mov dx, Port
in al, dx
mov cl, Bit
and cl, 7
mov ah, 1
shl ah, cl
not ah
and al, ah
out dx, al
Inline($FA);
{whatever you want to do here. I am just incrementing a counter}
Count := Count + 1;
SetPortBit(LPTPort + 1, 6);
Inline($FB);
getIntVec(LPTVector, @OldISR); {save old vector}
setIntVec(LPTVector, @NewISR); {install new vector}
SetPortBit(LPTPort + 1, 6);
SetPortBit(LPTPort + 2, 4);
ClearPortBit($21, 7) {enable inerrupt 7 in PIC}
Count := 0; {counter to count interrupts. Incremented in ISR}
repeat
Write('Interrupt count =');
Writeln(Count);
0 members, 0 guests, 0 anonymous users
Community Forum Software by IP.Board
Licensed to: Geeks to Go, Inc.