*
*  USER CONFIGURATION MODULE FOR THE VECTOR GRAPHIC CP/M 2.0 SYSTEMS
*  COPYRIGHT (C) 1979 VECTOR GRAPHIC INC.
*
*  THIS MODULE IS SETUP FOR THE USER WHO WANTS TO WRITE HIS OWN USER I/O
*  DRIVERS FOR THE SYSTEM.  A TOTAL OF 256 BYTES ARE ALLOCATED TO THE
*  USERAREA.  8 BYTES ARE RESERVED FOR TEMPORARY STORAGE AND 18 ARE
*  RESERVED FOR THE JUMP TABLE, LEAVING 230 BYTES FOR THE USER'S CUSTOM
*  DRIVERS.  SOME SYSTEM PORT DEFINITIONS WERE PROVIDED TO AID IN THE
*  PROPER USE OF THE BITSTREAMER II I/O BOARD.
*
***********************************************************************
*
*  DEFINE WHERE THE USER AREA BEGINS BY REQUESTING THE SYSTEM SIZE
*
MEMSIZE      REQ     'SYSTEM SIZE (IN K BYTES) :'
*
USERAREA     EQU     MEMSIZE*1024-300H    ;CALCULATE STARTING ADDRESS
*
BS.BASE      EQU     2                    ;BITSTREAMER 2 BASE ADDRESS
COM.DATA     EQU     BS.BASE+2            ;COMMUNICATIONS DATA
COM.STAT     EQU     BS.BASE+3            ;COMMUNICATIONS STATUS
SER.DATA     EQU     BS.BASE+4            ;SERIAL DATA PORT
SER.STAT     EQU     BS.BASE+5            ;SERIAL STATUS/COMMAND PORT
PAR.PORT     EQU     BS.BASE+6            ;PARALLEL STATUS/DATA PORT
*
             ORG     USERAREA             ;BEGIN CODE
*
***********************************************************************
*
*  DEFINE THE SYSTEM OPTION AND PRINTER CONFIGURATION BYTE
*  (LEASE SIGNIFICANT BIT IS SET TO NON-ZERO, DIRECTING ALL LIST
*  OUTPUT THROUGH THE USER JUMP TABLE)
*
C.APGE       EQU     80H   ;AUTOMATIC PAGING OF LIST OUTPUT
*
USRCONF      DB     1                     ;DEFINE AT NON-ZERO
*
*   THE NEXT SEVEN BYTES ARE RESERVED FOR USER TEMPORARY STORAGE.
*   THE FIRST TWO BEING THE NUMBER OF LINES PER PAGE AND THE PAGE
*   POSITION.  IF THIS AREA IS USED BY A CUSTOM DRIVER IT IS SUGGESTED
*   THAT THE RELATIVE POSITIONS (FROM THE BEGINNING OF THE USER AREA)
*   OF THESE FIRST TWO BYTES, REMAIN THE SAME, IN ORDER TO BE COMPATIBLE
*   WITH FUTURE CP/M SOFTWARE RELEASES FROM VECTOR GRAPHIC.
*
PAGESIZE     DB      56                   ;PAGE SIZE - SECOND BYTE
PAGEPOS      DB      00                   ;PAGE POSITION - THIRD BYTE
*
***********************************************************************
*
*   THE BIOS EXPECTS THE USERAREA JUMP TABLE TO BE OFFSET 8 BYTES IN,
*   FROM THE BEGINNING OF THE USER AREA.
*
             ORG     USERAREA+8           ;THIS CANNOT BE CHANGED
*
*  BEGIN ENTRY JUMP TABLE - THIS CANNOT BE CHANGED
*
             JMP     COLDBOOT             ;USER COLD BOOT INITIALIZE
             JMP     WARMBOOT             ;USER WARM BOOT INITIALIZE
             JMP     LISTSTATUS           ;LIST STATUS REQUEST
             JMP     LISTOUT              ;USER LIST OUTPUT
             JMP     PUNCH                ;USER PHYSICAL PUNCH
             JMP     READER               ;USER PHYSICAL READER
*
*  THE USER COLD BOOT IS CALLED WHEN THE SYSTEM IS COLD STARTED.
*  IT MAY CONTAIN CODE TO INITIALIZE PRINTER DRIVERS, USARTS ETC.
*
COLDBOOT     EQU     $
             RET
*
*  THE WARM BOOT ROUTINE IS CALLED WHEN THE SYSTEM IS WARM STARTED
*  BY EITHER A JUMP TO THE WARM START ENTRY AT ADDRESS ZERO OR
*  WHEN A CONTROL(C) IS TYPED BY THE USER.
*
WARMBOOT     EQU     $
             RET
*
*  THIS ROUTINE SHOULD RETURN THE STATUS OF THE CURRENT LIST DEVICE
*
*  RETURNS STATUS OF LIST DEVICE IN THE (A) REGISTER
*    "00" - DEVICE (PRINTER) IS NOT READY FOR CHARACTER
*    "FF" - CHARACTER CAN BE SENT TO THE DEVICE (PRINTER)
*
LISTSTATUS   EQU     $
             XRA     A             ;IF NOTHING ELSE PRESENT
             RET
*
*  THIS ROUTINE OUTPUTS THE CHARACTER IN THE (C) REGISTER TO THE
*  PHYSICAL DEVICE WHEN READY (A CALL TO THE "LISTSTATUS" ROUTINE
*  COULD GIVE YOU THIS INFORMATION).
*
LISTOUT      EQU     $
             RET
*
*  THE PUNCH ROUTINE IS SIMILAR TO THE LISTOUT ROUTINE
*  THE CHARACTER IS PASSED IN THE (C) REGISTER
*
PUNCH        EQU     $
             RET
*
*  THE READER ROUTINE RETURNS WITH A CHARACTER IN THE (A) REGISTER
*  WHEN AVAILABLE.  THE MOST SIGNIFICANT BIT OF THE CHARACTER
*  SHOULD BE RESET BEFORE RETURNING.  THE END-OF-FILE CONDITION IS
*  SIGNIFIED BY RETURNING A CONTROL(Z) (OR 1A HEX) IN THE (A) REGISTER.
*
READER       EQU     $
             MVI     A,1AH         ;EOF - IF NOTHING ELSE PRESENT
             RES     7,A           ;RESET MOST SIGNIFICANT BIT
             RET
*
