MODE command (Developers)
> The MODE command goes something like:
>
> MODE COM1:9600,N,8,1
>
> This then needs to be translated into a call
> to this BIOS interrupt:
>
> http://www.ctyme.com/intr/rb-0811.htm
I'm not so sure that's true. Here's an excerpt from the MS_DOS 7.1 HELP for the MODE command:
***
Syntax
MODE COMm[:] [b[,p[,d[,s[,r]]]]]
MODE COMm[:] [BAUD=b] [PARITY=p] [DATA=d] [STOP=s] [RETRY=r]
Parameters
COMm
Specifies the number of the serial (COM) port. Valid values for m are in
the range 1 through 4.
If you omit any of the following five parameters, MODE uses the most
recent setting for the omitted parameter. If you are using the shorter
form of the syntax (without the words BAUD=, PARITY=, DATA=, and so on),
the MODE command "recognizes" the parameters by their positions. Thus,
if you do not specify a value for a parameter, you must still type the
comma that precedes the next parameter.
BAUD=b
Specifies the first two digits of the transmission rate in bits per
second. The following list shows each valid value for b and its related
rate:
11 110 baud
15 150 baud
30 300 baud
60 600 baud
12 1200 baud
24 2400 baud
48 4800 baud
96 9600 baud
19 19,200 baud
The b value of 19 is not supported on all computers (check your hardware
manual). You can abbreviate this parameter by omitting BAUD= and
specifying a value for b.
***
Based on this description, MODE is not necessarily supposed to initialize the Serial Port, but merely change its parameters. If you want to only change one specific parameter from what it already is, you just provide the one parameter. This may mean MODE may need to keep track of whether the port is already initialized or not, or at least read all the existing parameters and not change the ones the user isn't requesting to be changed.
Also, it appears that it will theoretically accept almost any value for the Baud Rate if you leave out the "BAUD=" and just give it a number. Also, I've seen some serial port hardware that supports 230400 bps.
I work in the communications industry, and the incorrect use of the word "Baud" is one of my pet peeves. What you're changing is the Bit Rate, not the Baud Rate. I could go into a long explanation if anybody cared, but nobody probably does.
Complete thread:
- MODE command - kerravon, 14.10.2021, 12:34 (Developers)
- MODE command - bretjohn, 14.10.2021, 17:36
- MODE command - kerravon, 15.10.2021, 00:29
- MODE command - bretjohn, 15.10.2021, 07:29
- MODE command - kerravon, 15.10.2021, 07:42
- MODE command - bretjohn, 16.10.2021, 00:50
- MODE command - kerravon, 16.10.2021, 02:07
- MODE command - RayeR, 18.10.2021, 21:44
- MODE command - kerravon, 16.10.2021, 02:07
- MODE command - bretjohn, 16.10.2021, 00:50
- MODE command - kerravon, 15.10.2021, 07:42
- MODE command - bretjohn, 15.10.2021, 07:29
- MODE command - kerravon, 15.10.2021, 00:29
- MODE command - DosWorld, 22.10.2021, 03:35
- MODE command - kerravon, 23.10.2021, 01:50
- MODE command - DosWorld, 01.11.2021, 19:05
- MODE command - kerravon, 01.11.2021, 20:02
- MODE command - tom, 02.11.2021, 18:53
- MODE command - kerravon, 02.11.2021, 21:22
- MODE command - tom, 02.11.2021, 18:53
- MODE command - kerravon, 01.11.2021, 20:02
- MODE command - DosWorld, 01.11.2021, 19:05
- MODE command - kerravon, 23.10.2021, 01:50
- MODE command - bretjohn, 14.10.2021, 17:36