================================================================== MikeOS -- The Mike Operating System kernel SERIAL PORT ROUTINES ==================================================================
Set up the serial port for transmitting data
Example:
call init_serial_port
; sets serial port 1 to 9600 baud, no parity, 8 data bits, 1 stop bit
Send a byte via the serial port
Example:
mov al, 'a' ; place char to transmit in al call os_send_via_serial ; call it. cmp ah, 128 ; check if bit 7 is set, if it is then indicates an error. jnz all_ok ; bit 7 not set so it's all OK. jmp oops_error ; deal with it.
Get a byte from the serial port
Example:
call os_get_via_serial ; call it. cmp ah, 128 ; check if bit 7 is set, if it is then indicates an error. jnz all_ok ; bit 7 not set so it's all OK. jmp oops_error ; deal with it. all_ok: mov [rx_byte], al ; now get byte and store it.