/ MS-DOS / MS-DOS. / 8 / BIOS

Ш

BIOS

/ BIOS . , ( , , ) BIOS RS-232C, 14h.


14h . DX. DX COM1, , COM2. AL , 8-7. 3- , - 2- , - - 2- . 8-2 . , COM DOS 3.3 19200 , , ROM-BIOS 9600 . , 8-2, , .


                                   
                   - a.  
                                        
                 
                                         
                 
                              -   
                          
                  000  110   00     0  1     10  7  
                   b.       
                  001  150   10     1  2     11  8  
                          
                  010  300   01c.
                   
                  011  600   11d.
                   
                  100 1200 
                 
                  101 2400 
                 
                  110 9600 
                 
                  111      
                 
           .8-7.  ,    
                    ,   14h BIOS

            a.-  ; b. - ; c. - ; d. - 

                                                          8-2
                        
                             14h
         
                 
         
          -            110                    0
                     150                    1
                                 300                    2
                                 600                    3
                                1200                    4
                                2400                    5
                                4800                    6
                                9600                    7
                                             
                                          0  2
                                              1
                                                3
                      1                     0
                                  2                     1
                                             
                        7                     2
                                  8                     3
         

. , , , :


         pckd_commparams = (baudrate << 5) | (parity <<3) |
                           (stopbits << 2) | (wordlength);

. baudrate, parity, stopbits wordlength 8-2. , BIOS 14h. int86 Microsoft :


         #include 
         #define  BIOS_RS232  0x14
                           /*     BIOS */
         static union REGS xr, yr;
             .
             .
             .
         xr.h.ah = 0;        /*     BIOS RS-232 */
         xr.h.al = pckd_commparams;             /*   */
         xr.x.dx = port_number;  /* 0  COM1, 1  COM2 */
         int86(BIOS_RS232, &xr, &yr);               /*   */
             .
             .
             .

Microsoft C 5.0 BIOS: _bios_serialcomm BIOS 14h. , 8- , 1 , 300 , , . service_code port_number 0 (COM1) 1 (COM2). data . Microsoft C 5.0 Run-time Library Reference.


         _bios_serialcom(_COM_INIT, COM1, (_COM_CHR8 | _COM_STOP1 |
                                           _COM_NOPARITY | _COM_300) );

           _bios_serialcom

         status = _bios_serialcomm(service_code, port_number, data);

Ш

Hosted by uCoz