with CONFIGURATION; use CONFIGURATION; with TEXT_IO; use TEXT_IO; with COMMON_TO_BOTH_488; use COMMON_TO_BOTH_488; with PC_HW_488; use PC_HW_488; with TERMINAL_488; use TERMINAL_488; with UNCHECKED_CONVERSION; package body HW_SPECIFIC_TERMINAL_488 is -- package POINTER_IO is new TEXT_IO.ENUMERATION_IO(STATUS_BIT); -- use POINTER_IO; package INT_IO is new INTEGER_IO(integer); use INT_IO; THE_EVENT : PC_STATUS_TYPE; -- function CONVERT is new -- UNCHECKED_CONVERSION(SERIAL_POLL_RECORD, INTEGER_16); procedure DUMP_ERROR is begin -- dump_error if PC_RETURN_STATUS.HW_STATUS < 0 then -- if PC_RETURN_STATUS.ERROR /= 0 then -- for POINTER in STATUS_BIT loop -- if PC_RETURN_STATUS.HW_STATUS(POINTER) then -- put(POINTER); put(" "); -- end if; -- end loop; -- new_line; put("Status = "); INT_IO.put(PC_RETURN_STATUS.HW_STATUS); new_line; put("Error = "); INT_IO.put(PC_RETURN_STATUS.ERROR); new_line; -- put("Error number = "); put(PC_RETURN_STATUS.ERROR); new_line; -- if PC_RETURN_STATUS.HW_STATUS(ERR) then -- put_line(ERROR_MESSAGE(PC_RETURN_STATUS.ERROR)); -- end if; put("Count = "); put(PC_RETURN_STATUS.COUNT); new_line; new_line; end if; end DUMP_ERROR; procedure HW_SERVICE_REQUEST(SERVICE_REQUEST_INFO : SERIAL_POLL_RECORD) is -- TEMP_16 : INTEGER_16; TEMP_16 : INTEGER_16 := SERVICE_REQUEST_INFO.SERVICE; begin -- TEMP_16 := CONVERT(SERVICE_REQUEST_INFO); if SERVICE_REQUEST_INFO.REQUESTING_SERVICE then TEMP_16 := TEMP_16 + 2**6; end if; SERVICE_REQUEST(PC_RETURN_STATUS'address, TEMP_16); DUMP_ERROR; end HW_SERVICE_REQUEST; procedure HW_SEND(QUEUE : MESSAGE_LINK; STATUS : out STATUS_TYPE) is --\ This procedure will send the message that is in the front of the queue --\ that is passed. This is called after the terminal has been addressed --\ as the talker. The first time called, it will send out the receivers --\ of the message. The controller will then set the listeners and address --\ this terminal as a talker for the second time. Then this terminal will --\ send out the data of the message. begin SEND_IT(PC_RETURN_STATUS'address, QUEUE.NEXT.MESSAGE.MESSAGE'address, QUEUE.NEXT.MESSAGE.LENGTH); DUMP_ERROR; -- if PC_RETURN_STATUS.HW_STATUS(ERR) then if PC_RETURN_STATUS.HW_STATUS < 0 then STATUS := INTEGER_16(PC_RETURN_STATUS.ERROR); else STATUS := 1; end if; end HW_SEND; procedure HW_RECEIVE_MESSAGE(COUNT : out INTEGER_16; STATUS : out STATUS_TYPE) is begin RECEIVE_FROM_BUS(PC_RETURN_STATUS'address, RECEIVED_MESSAGE_PTR.MESSAGE.MESSAGE'address, DATA_BYTE_COUNT_TYPE'last, EOI_TERM); -- Largest UATL message -- RECEIVED_MESSAGE_PTR.MESSAGE.LENGTH := PC_RETURN_STATUS.COUNT; COUNT := PC_RETURN_STATUS.COUNT; DUMP_ERROR; -- if PC_RETURN_STATUS.HW_STATUS(ERR) then if PC_RETURN_STATUS.HW_STATUS < 0 then STATUS := INTEGER_16(PC_RETURN_STATUS.ERROR); else STATUS := 1; end if; end HW_RECEIVE_MESSAGE; end HW_SPECIFIC_TERMINAL_488;