Tvůrce webu je i pro tebe! Postav třeba web. Bez grafika. Bez kodéra. Hned.
wz

<< Zpět

česky: , English:

COM

Sériové porty COM


COMSet - set COM port

INPUT:
AL = setup parameters
- bit 0,1: data bits 0=5b, 1=6b, 2=7b, 3=8b
- bit 2: stop bits 0=1 bit, 1=2 bits (or 1.5 with 5 bits)
- bit 3,4: parity 0 or 2=none, 1=odd, 3=even
- bit 5..7: baud rate 0=110 Baud, 1=150 Baud, 2=300 Baud, 3=600 Baud, 4=1200 Baud, 5=2400 Baud, 6=4800 Baud, 7=9600 Baud
BL = COM port index (0..3)

OUTPUT:
CY = invalid COM port or operation error


COMSend - send byte to COM port

INPUT:
AL = byte to send
BL = COM port index (0..3)

OUTPUT:
CY = invalid COM port or operation error (time-out)


COMRecv - receive byte from COM port (with waiting)

INPUT:
BL = COM port index (0..3)

OUTPUT:
AL = byte from COM port (or 0 on error)
CY = invalid COM port or operation error (time-out, AL = 0)


COMRecvNoWait - receive byte from COM port (without waiting)

INPUT:
BL = COM port index (0..3)

OUTPUT:
AL = byte from COM port (or 0 on error)
CY = invalid COM port or operation error (time-out, AL = 0)


COMRecvTest - test if some byte from COM port is ready

INPUT:
BL = COM port index (0..3)

OUTPUT:
CY = invalid COM port or byte is not ready


COMState - get COM port state

INPUT:
BL = COM port index (0..3)

OUTPUT:
AL = modem status
- bit 0: 1=delta clear to send
- bit 1: 1=delta data set ready
- bit 2: 1=trailing edge ring detector
- bit 3: 1=delta recv line signal detect
- bit 4: 1=clear to send
- bit 5: 1=data set ready
- bit 6: 1=ring indicator
- bit 7: 1=received line detect signal
AH = line status
- bit 0: 1=data ready status
- bit 1: 1=overrun error
- bit 2: 1=parity error
- bit 3: 1=framing error
- bit 4: 1=break detect
- bit 5: 1=trans holding reg empty
- bit 6: 1=trans shift reg empty
- bit 7: 1=time-out or general error
CY = invalid COM port or operation error


COMPort - get address of COM port

INPUT:
BL = COM port index (0..3)

OUTPUT:
AX = addres of COM port (3f8h=COM1, 2f8h=COM2, 0=no port)
CY = invalid COM port (AX = 0)


COMCheck - check COM port

INPUT:
BL = COM port index (0..3)

OUTPUT:
CY = invalid COM port


COMGetNum - get number of COM ports)

OUTPUT:
AL = number of COM ports


COMRead - read data from COM port

INPUT:
BL = COM port index (0..3)
CX = number of bytes
DI = destination buffer

OUTPUT:
CY = invalid COM port or operation error (CX > 0)
CX = remaining bytes (or CX = 0 if no error NC)


COMWrite - write data to COM port

INPUT:
BL = COM port index (0..3)
CX = number of bytes
DI = source buffer

OUTPUT:
CY = invalid COM port or operation error (CX > 0)
CX = remaining bytes (or CX = 0 if no error NC)


Zdrojový kód COM.ASM

<< Zpět