中国DOS联盟

-- 联合DOS 推动DOS 发展DOS --

联盟域名:www.cn-dos.net 论坛域名:www.cn-dos.net/forum
DOS,代表着自由开放与发展,我们努力起来,学习FreeDOS和Linux的自由开放与GNU精神,共同创造和发展美好的自由与GNU GPL世界吧!

中国DOS联盟论坛
现在时间是 2026-07-31 20:48
中国DOS联盟论坛 » DOS开发编程 & 发展交流 (开发室) » 谁能给我一份DOS下串口编程的资料或者源代码?谢谢! 查看 14,853 回复 57
16 发表于 2007-11-21 10:49 ·  中国 陕西 西安 电信
初级用户
★★
积分 85
发帖 73
注册 2007-09-23 23:00
18年会员
UID 98146
性别 男
状态 离线
谢谢分享!
17 发表于 2007-11-22 11:08 ·  中国 广东 江门 新会区 电信
初级用户
★★
积分 117
发帖 57
注册 2007-10-23 20:57
18年会员
UID 100584
性别 男
状态 离线
A机的发送端(TX)与B机的接收端(RX)相连,A机的接收端(RX)与B机的发送端(TX)相连,两机的地线(GND)相连;

发送:
OPEN "COM1:1200,N,8,1,RS,CS,DS" AS #1
PRINT #1,"OK"
CLOSE #1

接收:
OPEN "COM1:1200,N,8,1,RS,CS,DS" AS #1
INPUT #1,A$
CLOSE #1
在她弯下腰的瞬间 我彷佛看见 那神秘柔和的曲线 如云雾中岭壑的蜿蜒
18 nice 发表于 2007-12-13 22:46 ·  中国 广东 腾讯云
初级用户
积分 92
发帖 47
注册 2007-12-07 13:20
18年会员
UID 104967
性别 男
状态 离线
good
19 发表于 2007-12-19 15:49 ·  中国 上海 浦东新区 电信
新手上路
积分 2
发帖 1
注册 2007-12-19 14:06
18年会员
UID 106127
性别 男
状态 离线
不错啊,我也需要一个
20 发表于 2008-04-11 10:25 ·  中国 湖南 长沙 电信
新手上路
积分 5
发帖 3
注册 2008-04-10 09:50
18年会员
UID 115442
性别 男
状态 离线
非常感谢
21 发表于 2008-04-11 17:30 ·  中国 湖北 武汉 电信
新手上路
积分 7
发帖 4
注册 2007-12-05 18:27
18年会员
UID 104773
性别 男
状态 离线
呵呵。。串口并口编程,我的代码
http://hi.baidu.com/大伦子
22 发表于 2008-04-11 17:31 ·  中国 湖北 武汉 电信
新手上路
积分 7
发帖 4
注册 2007-12-05 18:27
18年会员
UID 104773
性别 男
状态 离线
转载时请留言哦。。我只是想认识几个朋友罢了,交流交流编程罢了,呵呵
23 发表于 2008-04-17 09:06 ·  中国 福建 厦门 电信
高级用户
★★★
积分 741
发帖 366
注册 2007-07-25 19:11
19年会员
UID 94024
性别 男
状态 离线
Originally posted by jojand at 2007-11-22 11:08:
A机的发送端(TX)与B机的接收端(RX)相连,A机的接收端(RX)与B机的发送端(TX)相连,两机的地线(GND)相连;

发送:
OPEN "COM1:1200 ...

对,居于com设备句柄的操作更省事。
另:单片机方面可以用232芯片(如max232)来实现电平匹配从而降低对电源的要求,以前的电流环在设计中比较容易出现意外。
24 发表于 2008-05-15 12:42 ·  中国 山东 青岛 联通
新手上路
积分 8
发帖 3
注册 2008-05-14 19:15
18年会员
UID 118678
性别 男
状态 离线
我想下载,可是积分不够
25 发表于 2008-05-15 13:53 ·  中国 四川 乐山 电信
新手上路
积分 14
发帖 7
注册 2008-05-15 13:21
18年会员
UID 118738
性别 男
状态 离线
下来学习下
26 发表于 2008-05-16 16:15 ·  中国 江苏 无锡 江阴市 电信
新手上路
积分 4
发帖 2
注册 2006-12-03 01:01
19年会员
UID 72409
性别 男
状态 离线
非常感谢~学习中
27 发表于 2008-05-16 17:03 ·  中国 贵州 贵阳 电信
新手上路
积分 2
发帖 1
注册 2008-05-16 16:42
18年会员
UID 118857
性别 女
状态 离线
看看...学习
28 发表于 2008-05-21 11:43 ·  中国 上海 广电网
新手上路
积分 18
发帖 9
注册 2008-05-21 11:14
18年会员
UID 119274
性别 男
状态 离线
ding qi !!
29 发表于 2008-05-21 18:48 ·  中国 山西 临汾 侯马市 联通
新手上路
积分 4
发帖 2
注册 2008-05-06 18:05
18年会员
UID 117915
性别 男
状态 离线
下载了,谢谢
30 贴一段phoenix 的int 14h的code吧 发表于 2008-05-22 14:50 ·  中国 上海 广电网
新手上路
积分 18
发帖 9
注册 2008-05-21 11:14
18年会员
UID 119274
性别 男
状态 离线
先是注释:
;----------------------------------------------------------------------------
;
; I N T E R R U P T 1 4
;
; coreBiosSerialInterface - The BIOS serial interface supports the
; Intel 8250 Serial chip.
; Functions available are init, send, receive, and status.
;
;
; AH = 00 - Initialize Communications Port
; Entry: DX - COM adapter to initialize (0-3)
; AL - Initialization values
;
; 7 6 5 4 3 2 1 0
; Baud rate Parity stop bits Word length
; ---------------------------------------
; 000-110 00-None 0-1 10-7 Bits
; 001-150 01-Odd 1-2 11-8 Bits
; 010-300 10-None
; 011-600 11-Even
; 100-1200
; 101-2400
; 110-4800
; 111-9600
; Exit: AH - Line status
;
;
; AH = 01 - Send Character
; Entry: DX - Communication adapter number (0-3)
; AL - Character to send
; Exit: AH - Line Status
;
;
; AH = 02 - Receive Character
; Entry: DX - Communcation adapter number (0-3)
; Exit: AL - Character received
; AH - Line Status
;
;
; AH = 03 - Return Communication Status
; Entry: DX - Communication adapter number (0-3)
; Exit: AL - Modem status
; Bit 0 - Delta clear to send
; Bit 1 - Delta data set ready
; Bit 2 - Trailing edge ring indicator
; Bit 3 - Delta (RLSD)
; Bit 4 - Clear to send
; Bit 5 - Data set ready
; Bit 6 - Ring indicator
; Bit 7 - Received line signal detect
;
; AH - Line status
; Bit 0 - Data ready
; Bit 1 - Overrun error
; Bit 2 - Parity Error
; Bit 3 - Framing Error
; Bit 4 - Break detect
; Bit 5 - Trans holding register empty
; Bit 6 - Trans shift register empty
; Bit 7 - Time out error
;
; AH = 04 - Extended Initialize (PS2 compatibility)
; Entry: DX - Communication adapter number (0-3)
; AL - Break
; 00H - No Break
; 01H - Break
; BH - Parity
; 00H - None
; 01H - Odd
; 02H - Even
; 03H - Stick parity odd
; 04H - Stick parity even
; BL - Stop Bit
; 00H - One
; 01H - Two if 6,7, or 8 bit word length
; One and one-half if 5 bit word length
; CH - Word Length
; 00H - 5 bits
; 01H - 6 bits
; 02H - 7 bits
; 03H - 8 bits
; CL - Baud Rates
; 00H - 110 baud
; 01H - 150 baud
; 02H - 300 baud
; 03H - 600 baud
; 04H - 1200 baud
; 05H - 2400 baud
; 06H - 4000 baud
; 07H - 9600 baud
; 08H - 19200 baud
;
; Exit: AL - Modem status
; Bit 0 - Delta clear to send
; Bit 1 - Delta data set ready
; Bit 2 - Trailing edge ring indicator
; Bit 3 - Delta (RLSD)
; Bit 4 - Clear to send
; Bit 5 - Data set ready
; Bit 6 - Ring indicator
; Bit 7 - Received line signal detect
;
; AH - Line status
; Bit 0 - Data ready
; Bit 1 - Overrun error
; Bit 2 - Parity Error
; Bit 3 - Framing Error
; Bit 4 - Break detect
; Bit 5 - Trans holding register empty
; Bit 6 - Trans shift register empty
; Bit 7 - Time out error
;
; AH = 05 - Extended Communications Port Control (PS2 compatibility)
; Entry: AL = 0 Read modem control register
; DX - Communication adapter number (0-3)
; Exit BL = Modem control register
;
; Entry AL = 01 Write modem control register
; DX - Communication adapter number (0-3)
; BL - Modem Control Register
;
; Exit: AL - Modem status
; Bit 0 - Delta clear to send
; Bit 1 - Delta data set ready
; Bit 2 - Trailing edge ring indicator
; Bit 3 - Delta (RLSD)
; Bit 4 - Clear to send
; Bit 5 - Data set ready
; Bit 6 - Ring indicator
; Bit 7 - Received line signal detect
;
; AH - Line status
; Bit 0 - Data ready
; Bit 1 - Overrun error
; Bit 2 - Parity Error
; Bit 3 - Framing Error
; Bit 4 - Break detect
; Bit 5 - Trans holding register empty
; Bit 6 - Trans shift register empty
; Bit 7 - Time out error
;
;============================================================================
论坛跳转: