SECTION .data EXTERN _inbound_queue ; (defined in LAB6.C) data DB 0 ; put rcvd byte here SECTION .text ALIGN 16 BITS 32 BASE_PORT EQU 3F8h ; we have this in our lab LSR_PORT EQU BASE_PORT+5 RBR_PORT EQU BASE_PORT THR_PORT EQU BASE_PORT ; --------------------------------------------------------------------- ; void SerialPut(char ch) ; --------------------------------------------------------------------- ; This function uses programmed waiting loop I/O ; to output the ASCII character 'ch' to the UART. GLOBAL _SerialPut _SerialPut: ; ; (1) Wait for THRE = 1 ; ; (2) Output character to UART RET ; (3) Return to caller ; --------------------------------------------------------------------- ; void interrupt SerialISR(void) ; --------------------------------------------------------------------- ; This is an Interrupt Service Routine (ISR) for ; serial receive interrupts. Characters received ; are placed in a queue by calling Enqueue(char). GLOBAL _SerialISR EXTERN _QueueInsert ; (provided by LIBPC) _SerialISR: ; ; (1) Enable (higher-priority) IRQs ; ; (2) Preserve all registers ; ; (3) Get character from UART MOV [data],AL ; (4) Put character into queue PUSH DWORD data ; Param #2: address of data PUSH DWORD [_inbound_queue] ; Param #1: address of queue CALL _QueueInsert ADD ESP,8 ; ; (5) Enable lower priority interrupts ; ; (Send Non-Specific EOI to PIC) ; ; (6) Restore all registers IRET ; (7) Return to interrupted code