.CP     Com port Parameters

Syntax:

        .CP  comport,baudrate,parity,databits,stopbits

See also:

.EF   .LF   .LI   .SF   .TF   .TW  

Function:

The .CP directive sets the communication parameters of the selected serial COM port. This is useful if you intend to send the generated object file directly to a programmer or EPROM simulator connected to the COM port.

For now this directive only works on Version 2 of the SB-Assembler. Version 3 doesn't know this directive yet because of the differences in the operating systems it can run on.

Explanation:

I have added this directive to be able to set the communication parameters of the serial port in case you intend to send the target file directly to a device connected to a COM port.

All parameters are to be entered in the order indicated under the heading "Syntax".

comport

This is an expression that must evaluate to a legal DOS COM port number. Usually this in the range from 1..4, but all ports don't necessarily exist depending on your hardware. Only 1..16 is accepted as values, otherwise you'll get a Out of range error.

baudrate

This is the baud rate you wish to use for communication. The expression should evaluate to one of the following baud rates, otherwise you'll get a Out of range error.

110
150
300
600
1200
2400
4800
9600
19200

parity

This is the parity you wish to use. The parity is indicated by a letter N (none), E (even), or O (odd). Other letters will generate an Illegal parameter error

databits

This expression should evaluate to a value of 7 or 8. Other values will result in a Out of range error.

stopbits

This expression should evaluate to a value of 1 or 2. Other values will result in a Out of range error.

Please note that the COM port parameters are only set during pass 2 of the assembly process.

Examples:

        .CP  1,9600,N,8,1       Set COM1 to 9600 baud, No parity,
;                                8 data bits and 1 stop bit.