[comp.os.msdos.programmer] COM1 COM2 interrupt numbers?

mitchell (Bill Mitchell) (09/13/90)

In article <37363@unix.cis.pitt.edu> zhang@unix.cis.pitt.edu (Hong Zhang) writes:
>
>According to MS-DOS Encyclopedia, on PC the int numbers of COM1 / COM2
>are 12 / 11, while on AT, they are 11 / 12. How do I write a comm
>program for all IBM compatibles?
>
>Thanks in advance.

There is a BIOS data area from 0040:0000 thru 0040:008f, containing
all sorts of interesting stuff.  In particular, the first four words
contain the I/O addresses of COM1 thru COM4, and the next four words
contain the I/O addresses of LPT1 thru LPT4.

jc58+@andrew.cmu.edu (Johnny J. Chin) (09/14/90)

First of all ... the hardware interrupt for the serial ports are 3 or 4, by
default.

COM1 - IRQ4 (hardware interrupt request #4)
COM2 - IRQ3

As for some other common ones:

INT 0 - NMI (non-maskable interrupt) - usually due to memory parity error
INT 1 - reserved
INT 2 - used by many EGA/VGA cards (usually available on 8088)
        cascading interrupt on 286/386/486 machines
INT 3 - COM2:
INT 4 - COM1:
INT 5 - Hard Disk Controller on 8088 (available for LPT2: on 286/386/486)
INT 6 - Floppy Controller
INT 7 - LPT1:

INT 14 - cascaded off INT 2 - Hard Disk Controller on 286/386/486.


I hope this information helps ...

      __________                                ___
     /          \                          /   /    /_/ / /\/
    _/  /   /   /                       __/.  /__  / / / / /
   /     /     /
  /           / 4730 Centre Ave. #412   ARPAnet: Johnny.J.Chin@andrew.cmu.edu
 /  -------  /  Pittsburgh, PA  15213   BITnet:  jc58@andrew
 \__________/   (412) 268-8936          UUCP: ...!harvard!andrew.cmu.edu!jc58
 Computer Dr.

Disclaimer:   The views expressed herein are STRICTLY my own, and not CMU's.

PA163514@tecmtyvm.mty.itesm.mx (09/15/90)

Mr. or Miss Zhang

I don't know where did you find your MS-DOS reference, but my literature
say the opposite, look that:

Int    Purpose

1C       Com1
1B Com2

This is for PC-XT

I'm sure about int 1C, because, I work with com-interrupts.

I'm not sure, but I think com-interrupt in AT are inverse. That is,
com1 1B and Com2 1C, but look that:

You can know if your Pc is AT or XT, in this manner:

With basic,

10 def seg=&hf000
20 x=peek (&hffe)


If  x=FF       It's PC
    x=FE            XT
    x=FD            PCjr
    x=FC            AT

In assembly language

mov  ax,0f000h
mov  es,ax
mov  al,es:{0fffeh}

And al is equivalent to x

Some questions, refer to:
Juan Manuel Gonzalez Nava
Informatic Research Center
ITESM Monterrey Mexico
Bitnet:   PA163514@MTYTECVM.MTY.ITESM.MX

There is a new country. Mexico

Ralf.Brown@B.GP.CS.CMU.EDU (09/15/90)

In article <90257.214305PA163514@tecmtyvm.mty.itesm.mx>, PA163514@tecmtyvm.mty.itesm.mx wrote:
}Int    Purpose
}1C       Com1
}1B	  Com2
}
}This is for PC-XT
}
}I'm sure about int 1C, because, I work with com-interrupts.
}I'm not sure, but I think com-interrupt in AT are inverse. That is,
}com1 1B and Com2 1C, but look that:

First of all, that's INT 0C/0B, not 1C/1B (which are timer tick and ^Break).
Secondly, both PC and AT use INT 0C for COM1 and INT 0B for COM2 (as do IBM-
compatible 386s).
--
UUCP: {ucbvax,harvard}!cs.cmu.edu!ralf -=- 412-268-3053 (school) -=- FAX: ask
ARPA: ralf@cs.cmu.edu  BIT: ralf%cs.cmu.edu@CMUCCVMA  FIDO: 1:129/3.1
Disclaimer?    |   I was gratified to be able to answer promptly, and I did.
What's that?   |   I said I didn't know.  --Mark Twain

PA163514@tecmtyvm.mty.itesm.mx (09/16/90)

Sorry from PA163514


You ara right.


Interrupts are 12(decimal) or its equivalent Ch

I put a Re: in this list, there is a mistake, I wrote

1Ch   sorry, check it's   0Ch

1Ch is the timer tick.

stever@Octopus.COM (Steve Resnick ) (09/27/90)

In article <Iaw_cB600VY6IMyqUW@andrew.cmu.edu> jc58+@andrew.cmu.edu (Johnny J. Chin) writes:
>First of all ... the hardware interrupt for the serial ports are 3 or 4, by
>default.
>
>COM1 - IRQ4 (hardware interrupt request #4)
>COM2 - IRQ3
>
>As for some other common ones:
>
>INT 0 - NMI (non-maskable interrupt) - usually due to memory parity error
>INT 1 - reserved
>INT 2 - used by many EGA/VGA cards (usually available on 8088)
>        cascading interrupt on 286/386/486 machines
>INT 3 - COM2:
>INT 4 - COM1:
>INT 5 - Hard Disk Controller on 8088 (available for LPT2: on 286/386/486)
>INT 6 - Floppy Controller
>INT 7 - LPT1:
>
>INT 14 - cascaded off INT 2 - Hard Disk Controller on 286/386/486.
>
>
>I hope this information helps ...

These are IRQ's, not INTS - ie, when COM1 needs service it DOES NOT issue
an int 3, it issues an INT 0BH. Note that IRQ interrupts start at int 08H
the timer vector. Based on this I think that INT 0 is not an IRQ but an INT
line on the CPU, otherwise, the timer would be vectored to NMI (which it isn't)

Steve


-- 
----------------------------------------------------------------------------
steve.resnick@f105.n143.z1.FIDONET.ORG - or - apple!camphq!105!steve.resnick
Flames, grammar errors, spelling errrors >/dev/nul
----------------------------------------------------------------------------

Ralf.Brown@B.GP.CS.CMU.EDU (09/27/90)

In article <Iaw_cB600VY6IMyqUW@andrew.cmu.edu>, jc58+@andrew.cmu.edu (Johnny J. Chin) wrote:
}INT 0 - NMI (non-maskable interrupt) - usually due to memory parity error
}INT 1 - reserved
}INT 2 - used by many EGA/VGA cards (usually available on 8088)
}        cascading interrupt on 286/386/486 machines
}INT 3 - COM2:
}INT 4 - COM1:
}INT 5 - Hard Disk Controller on 8088 (available for LPT2: on 286/386/486)
}INT 6 - Floppy Controller
}INT 7 - LPT1:
}
}INT 14 - cascaded off INT 2 - Hard Disk Controller on 286/386/486.

Read IRQ instead of INT for all of the above (IRQ0-7 are normally programmed
to appear as INT 08-0F and IRQ8-15 as INT 70-77).  Secondly, NMI is *not*
tied to any IRQ (it is INT 02).  IRQ0 is the system clock tick and IRQ1 is
the keyboard interrupt.

--
UUCP: {ucbvax,harvard}!cs.cmu.edu!ralf -=- 412-268-3053 (school) -=- FAX: ask
ARPA: ralf@cs.cmu.edu  BIT: ralf%cs.cmu.edu@CMUCCVMA  FIDO: 1:129/3.1
Disclaimer?    |   I was gratified to be able to answer promptly, and I did.
What's that?   |   I said I didn't know.  --Mark Twain