Download Brainboxes IE-296 Technical information
Transcript
Forterm Serial Solutions if( (brk .LT. 0) .OR. (brk .GT. 1) ) return registers.al = brk if( (par .LT. 0) .OR. (par .GT. 4) ) return registers.bh = par if( (data .LT. 0) .OR. (data .GT. 3) ) return registers.ch = data if( (stop .LT. 0) .OR. (stop .GT. 1) ) return registers.bl = stop if( (Baud .LT. 0) .OR. (Baud .GT. 11) ) return registers.cl = Baud call intrpt( 16#14, registers ) C Return true for good numbers BIOS_x_init = .TRUE. end BIOS_X_Init uses the extended initialise service supplied as part of NewBIOS to set the port up. It works its way though the function parameters, checking that each has a valid value. The parameters are stored in the regtype structure registers, which is used to specify the parameters to intrpt. The chapter "Using NewBIOS", explains the use of intrpt in FORTRAN. The chapter "NewBIOS Reference", sets out the parameters that service 4, the extended initialise, requires. BIOS_X_init returns a .TRUE. flag to show that is has checked its parameters, found them to be ok, and used them to set the serial port. If the parameters are bad then a .FALSE. flag is returned and the serial port is left alone. Because intrpt is a separate module supplied with NewCOM and not part of FORTRAN, the interface statement is used to ensure that the correct parameters etc are passed to the subroutine. Fitting The Parts Together. _______________________ _ The main block of Forterm is shown below. Chapter 11 Page 169