home *** CD-ROM | disk | FTP | other *** search
/ Ham Radio 2000 #1 / Ham Radio 2000.iso / ham2000 / packet / p_aa4re / mbb35src / mbbcom.asm < prev    next >
Encoding:
Assembly Source File  |  1990-10-14  |  7.6 KB  |  161 lines

  1. ;==========================================================================;
  2. ; Control block layout for each port -- Just labels to provide a structure ;
  3. ;                                                                          ;
  4. ;   Copyright 1986, 1987, 1988, 1990 by H. Roy Engehausen.  All rights     ;
  5. ;   reserved.                                                              ;
  6. ;                                                                          ;
  7. ;   This software may be freely distributed and used, but it may not       ;
  8. ;   under any circumstances be sold by anyone other than the author.       ;
  9. ;   It may be distributed by a commercial company as long as it is         ;
  10. ;   for no cost.                                                           ;
  11. ;                                                                          ;
  12. ;==========================================================================;
  13.  
  14.              ORG    0
  15.  
  16. com_block_beg LABEL BYTE            ; Start of com_block
  17.  
  18. com_next     DW     ?               ; Offset of next comm block
  19.  
  20. buffer_r_a   DW     ?               ; Segment of current receive buffer
  21. buffer_t_a   DW     ?               ; Segment of current transmit buffer
  22.  
  23. comnumber    DB     ?               ; Comm number - 1
  24.  
  25. chip         DB     ?               ; Chip type
  26. chip_nu      EQU      0             ;      Slot not used
  27. chip_8250    EQU      1             ;      8250 - IBM ASYNC board
  28. chip_8251    EQU      2             ;      8251 - IBM BSC board in ASYNC mode
  29. chip_8530    EQU      3             ;      8530 - PACCOMM PC-100 board
  30. chip_qrqp    EQU      4             ;      QUADRAM QuadPort
  31. chip_4apc    EQU      5             ;      4 async port card
  32.  
  33. chip_comm    DW     ?               ; Offset to common chip info
  34.  
  35. flags        DB     ?               ; Flag byte
  36. flags_tbe    EQU       10000000B    ;      Transmit buffer empty expected
  37. flags_dcd_on EQU       01000000B    ;      DCD on
  38. flags_xmt_on EQU       00100000B    ;      Transmitter on
  39. flags_xmt_h  EQU       00010000B    ;      Transmitter held
  40. ;            EQU       ....x...B    ;      Not used
  41. flags_was_e  EQU       00000100B    ;      Buffer was empty at start
  42. flags_useoff EQU       00000010B    ;      User wants handshake off
  43. flags_in_use EQU       00000001B    ;      Block in use
  44.  
  45. options      DB     ?               ; Option byte
  46. opt_fifo     EQU       10000000B    ;      FIFO mode in use
  47. opt_high_irq EQU       01000000B    ;      IRQ8-F used
  48. opt_high     EQU       00100000B    ;      High speed option
  49. opt_fd       EQU       00010000B    ;      Full duplex link
  50. opt_igerr    EQU       00001000B    ;      Ignore incoming packets in error
  51. opt_hdwhs    EQU       00000100B    ;      Hardware handshaking desired
  52. opt_brktr    EQU       00000010B    ;      Translate break to 3 control "C"
  53. opt_trbuf    EQU       00000001B    ;      Transmit buffer enabled.
  54.  
  55. data_rate    DB     ?               ; Data rate for this line
  56. last_rs      DB     ?               ; Last receive status
  57. hiv          DB     ?               ; Hardware interrupt vector number
  58. baseaddr     DW     ?               ; Base port address
  59. int_mask     DB     ?               ; Interrupt chip mask
  60. buffer_r_in  DW     ?               ; Receive buffer in offset
  61. buffer_r_out DW     ?               ; Receive buffer out offset
  62. buffer_t_in  DW     ?               ; Transmit buffer in offset
  63. buffer_t_out DW     ?               ; Transmit buffer out offset
  64.  
  65. ;--------------------------------------------------------------------------;
  66. ; This is the variable section of the COM Block -- 8530                    ;
  67. ;--------------------------------------------------------------------------;
  68.  
  69. buffer_r_seg DW     ?               ; Receive buffer segment (8530 KISS mode)
  70. buffer_t_seg DW     ?               ; Transmit buffer segment (8530 KISS mode)
  71.  
  72. timer_dcd    DW     ?               ; Time since DCD
  73. timer_xmtr   DW     ?               ; Time since last transmit event
  74.  
  75. period_xmtr  DB     ?               ; Number of transmit event in progress
  76. period_x_txd EQU    0               ;      TXD in progress
  77. period_x_tx  EQU    2               ;      Transmitter sending data
  78. period_x_crc EQU    4               ;      Awaiting end of CRC
  79.  
  80. value_p      DB     ?               ; P-persistance   -- All times in clock
  81. value_slot   DB     ?               ; Slot time          ticks
  82. value_txd    DW     ?               ; TXD
  83. value_crc    DW     ?               ; CRC wait
  84.  
  85. clock_8530   DW     ?               ; Clock rate in Khz
  86.  
  87. type_8530    DB     ?               ; 8530 card type
  88. type_8530_a  EQU    0               ; PACCOMM Type "A" card
  89. type_8530_b  EQU    1               ; PACCOMM Type "B" card
  90.  
  91. kiss_type    DB     kiss_escape     ; Host->TNC kiss packet type
  92.                                     ; Uses the first byte after FEND
  93.  
  94. kiss_flag    DB     0               ; KISS flags
  95. kiss_t_valid EQU    10000000B       ; Type is valid
  96. kiss_r_fesc  EQU    01000000B       ; FESC from host
  97.                                     ; Use 2 bits for KISS - R mode.
  98.                                     ; This is used directly for a branch table
  99. kiss_r_mode  EQU    00000110B       ; KISS receive packet mode
  100. kiss_r_mfs   EQU    00000000B       ; Send KISS FEND to start a packet
  101. kiss_r_mtype EQU    00000010B       ; Send KISS type
  102. kiss_r_mdata EQU    00000100B       ; Send KISS data
  103. kiss_r_mfe   EQU    00000110B       ; Send KISS FEND to end a packet
  104.  
  105. ;--------------------------------------------------------------------------;
  106. ; COMBLOCK size                                                            ;
  107. ;--------------------------------------------------------------------------;
  108.  
  109. com_size     EQU    $-com_block_beg ; Length of com_block
  110.  
  111. ;==========================================================================;
  112. ; Tie blocks                                                               ;
  113. ;==========================================================================;
  114.  
  115.              ORG    0               ;
  116.  
  117. tie_block    LABEL  BYTE            ;
  118. tie_size     =      0               ;
  119.  
  120. ;--------------------------------------------------------------------------;
  121. ; Tie block for 8530                                                       ;
  122. ;--------------------------------------------------------------------------;
  123.  
  124.  IF present_8530
  125.  
  126. tie2_a        DW     ?              ; --> "A" channel com_blovk
  127. tie2_b        DW     ?              ; --> "B" channel com_blovk
  128. tie2_modem    DB     ?              ; Modem control byte
  129. tie2_clock    DB     ?              ; "B" XTAL initialize switch
  130.  
  131. tie2_size     EQU    $-tie_block     ;
  132.  
  133.    IF (tie2_size GT tie_size)
  134. tie_size = tie2_size
  135.    ENDIF
  136.  
  137.  ENDIF
  138.  
  139. ;--------------------------------------------------------------------------;
  140. ; Tie block for QUADRAM Quadport or the 4 async port card                  ;
  141. ; Note:  a word of zeros terminates the list                               ;
  142. ;--------------------------------------------------------------------------;
  143.  
  144.  IF present_qrqp
  145.  
  146. tie3_a        DW     ?              ; --> "A" channel com_block
  147. tie3_b        DW     ?              ; --> "B" channel com_block
  148. tie3_c        DW     ?              ; --> "C" channel com_block
  149. tie3_d        DW     ?              ; --> "D" channel com_block
  150. tie3_e        DW     ?              ; --> "E" channel com_block
  151. tie3_f        DW     ?              ; --> "F" channel com_block
  152. tie3_g        DW     ?              ; --> "G" channel com_block
  153.  
  154. tie3_size     EQU    $-tie_block     ;
  155.  
  156.    IF (tie3_size GT tie_size)
  157. tie_size = tie3_size
  158.    ENDIF
  159.  
  160.  ENDIF
  161.