
 Motorola M68000 Assembler                                           Page   1

    1                      ***************************************************
    1+                     **************************)
    2                      *                                                  
    2+                                              *)
    3                      *                                                  
    3+                                              *)
    4                      *    Program    : Interpretation System Software fo
    4+                     r EDDE.                  *)
    5                      *                                                  
    5+                                              *)
    6                      *    Purpose    : Extract packets from the Network 
    6+                     buffer, converting them  *)
    7                      *                 to event packets and sending them
    7+                      to the Display Proc Brd *)
    8                      *                                                  
    8+                                              *)
    9                      *    Name       : Vinod E.F. REBELLO               
    9+                                              *)
   10                      *                                                  
   10+                                              *)
   11                      *    Class      : CS & E 4                         
   11+                                              *)
   12                      *                                                  
   12+                                              *)
   13                      *    Username   : VEFR                             
   13+                                              *)
   14                      *                                                  
   14+                                              *)
   15                      *    Date       : 23rd March 1990      Version 3.0 
   15+                                              *)
   16                      *                 Rev: 5th May 1990    - bugfix    
   16+                                              *)
   17                      *                 20 july 1990 - to test data on re
   17+                     boot                     *)
   18                      *                 8 oct 1990 - debugging.          
   18+                                              *)
   19                      *                 22 oct 1990 - converted to ram so
   19+                     ftware for monitor use   *)
   20                      *                                                  
   20+                                              *)
   21                      *    Supervisor : Damal K. ARVIND                  
   21+                                              *)
   22                      *                                                  
   22+                                              *)
   23                      ***************************************************
   23+                     **************************)
   24                      
   25         00060000     fifo    equ    #$60000    * Address of the interpro
   25+                     cess fifo
   26         00030000     sdaddr  equ    $30000     * Source and destination 
   26+                     address of Cent. Packet
   27         00050000     dataMW  equ    $50000     * Most significant 16bits
   27+                      of the data field.
   28         00040000     dataLW  equ    $40000     * Least significant 16 bi
   28+                     ts of the data fields.
   29         00070000     cntfd   equ    $70000     * Control field of the ce
   29+                     ntrenet packet.
   30         00070000     led     equ    $70000     * LED address
   31         00010000     cntrl   equ    $10000
 Motorola M68000 Assembler                                           Page   2

   32         00010001     cntrl2  equ    $10001     * Holding space for the p
   32+                     acket which has just
   33         00010002     sdadd   equ    $10002     * been read.
   34         00010004     data1   equ    $10004
   35         00010006     data2   equ    $10006
   36         00011002     save    equ    $11002
   37         00011004     hwcnt   equ    $11004     * Mirror register for H'w
   37+                     are control register.
   38         00012000     evmode  equ    $12000     * Flag to indicate which 
   38+                     mode, event or centrenet pkt.
   39         00013000     ct      equ    $13000
   40         00014000     sd      equ    $14000
   41         00015000     dt      equ    $15000
   42         000000AF     bhead   equ    #$af       * centrenet control field
   42+                      values to identify
   43         000000AE     bhack   equ    #$ae       * packet type.
   44         000000BF     dtpk    equ    #$bf
   45         0000001F     ltpk    equ    #$1f
   46         000000BE     dtack   equ    #$be
   47         000000FF     clr     equ    #$ff       * Clear all H'ware Flags.
   48         00000001     grnoff  equ    #$01
   49         00000002     redoff  equ    #$02
   50         00000003     rgoff   equ    #$03       * both leds off.
   51         00000004     prqoff  equ    #$04
   52         00000008     ackoff  equ    #$08
   53         0000000C     cepoff  equ    #$0c
   54         000000FE     grnon   equ    #$fe       * light green led.
   55         000000FD     redon   equ    #$fd       * light red led.
   56         000000FC     rgon    equ    #$fc       * light both leds.
   57         000000FB     prqon   equ    #$fb       * Initiate a packet reque
   57+                     st from the fifo.
   58         000000F7     ackon   equ    #$f7       * Acknowledge   
   59                      *
   60                      *
   61         00018000             org    $18000     * was $01000 when prom so
   61+                     ftware.
   62                      
   63  018000 103900011004 clrled: move.b hwcnt,d0                  * LED off
   64  018006 803C0003             or.b   rgoff,d0
   65  01800A 33C000070000         move.w d0,led
   66  018010 13C000011004         move.b d0,hwcnt
   67  018016 4E75                 rts
   68                      *
   69  018018 103900011004 grnled: move.b hwcnt,d0                * LED on
   70  01801E C03C00FE             and.b  grnon,d0
   71  018022 33C000070000         move.w d0,led
   72  018028 13C000011004         move.b d0,hwcnt
   73  01802E 4E75                 rts
   74                      
   75                      
   76                      *clrled: move.l led,a2
   77                      *        move.w off,(a2)
   78                      *        rts
   79                      *
   80                      *
   81                      *grnled: move.l led,a2
   82                      *        move.w green,(a2)
   83                      *        rts
   84                      
 Motorola M68000 Assembler                                           Page   3

   85                      
   86  018030 103900011004 pkreq:  move.b hwcnt,d0
   87  018036 C03C00FB             and.b  prqon,d0
   88  01803A 13C000011004         move.b d0,hwcnt
   89  018040 33C000070000         move.w d0,led
   90  018046 4E75                 rts
   91                      
   92  018048 103900011004 clrrq:  move.b hwcnt,d0
   93  01804E 803C0004             or.b   prqoff,d0
   94  018052 33C000070000         move.w d0,led
   95  018058 13C000011004         move.b d0,hwcnt
   96  01805E 4E75                 rts
   97                      
   98  018060 103900011004 sndack: move.b hwcnt,d0
   99  018066 C03C00F7             and.b  ackon,d0
  100  01806A 33C000070000         move.w d0,led
  101  018070 13C000011004         move.b d0,hwcnt
  102  018076 4E75                 rts
  103                      
  104  018078 103900011004 clrack: move.b hwcnt,d0
  105  01807E 803C0008             or.b   ackoff,d0
  106  018082 13C000011004         move.b d0,hwcnt
  107  018088 33C000070000         move.w d0,led
  108  01808E 4E75                 rts
  109                      
  110  018090 103900011004 redled: move.b hwcnt,d0
  111  018096 C03C00FD             and.b  redon,d0
  112  01809A 33C000070000         move.w d0,led
  113  0180A0 13C000011004         move.b d0,hwcnt
  114  0180A6 4E75                 rts
  115                      
  116                      
  117  0180A8 103900011004 bothled: move.b hwcnt,d0
  118  0180AE C03C00FC             and.b rgon,d0
  119  0180B2 33C000070000         move.w d0,led
  120  0180B8 13C000011004         move.b d0,hwcnt
  121  0180BE 4E75                 rts
  122                      
  123                      *readpk: movem.l d0/d1/a0/a1,-(a7)   * simulates th
  123+                     e fifo by providing
  124                      *        move.l  ct,a1               * a packet and
  124+                      placing it in the 
  125                      *        move.l  (a1),a0             * holding ram 
  125+                     space
  126                      *        move.w  (a0)+,d0
  127                      *        move.l  a0,(a1)
  128                      *        move.l  cntrl,a1
  129                      *        move.w  d0,(a1)
  130                      *
  131                      *        move.l  sd,a1
  132                      *        move.l  (a1),a0
  133                      *        move.w  (a0)+,d0
  134                      *        move.l  a0,(a1)
  135                      *        move.l  sdadd,a1
  136                      *        move.w  d0,(a1)
  137                      *
  138                      *        move.l  dt,a1
  139                      *        move.l  (a1),a0
  140                      *        move.l  (a0)+,d0
 Motorola M68000 Assembler                                           Page   4

  141                      *        move.l  a0,(a1)
  142                      *        move.l  data1,a1
  143                      *        move.l  d0,(a1)
  144                      *        movem.l (a7)+,d0/d1/a0/a1
  145                      *        rts
  146                      *
  147                      *
  148                      
  149  0180C0 48E78100     getpk:  movem.l d7/d0,-(a7)
  150  0180C4 1E3C0001             move.b #1,d7
  151  0180C8 4EB900018030         jsr    pkreq
  152  0180CE BE3C0000     gpwait: cmp.b  #0,d7
  153  0180D2 67000010             beq    gpclr 
  154  0180D6 4EB900018078         jsr    clrack
  155  0180DC 4EB900018018         jsr    grnled
  156  0180E2 60EA                 bra    gpwait
  157                      *        move.w ld2req,led
  158                      *        move.w evmode,d0
  159                      *        cmp.w #0,d0
  160                      *        beq gpwait
  161                      *        movem.l (a7)+,d7/d0
  162                      *        or.b  #$01,ccr       * set carry, mode cha
  162+                     nge taken place
  163                      *        rts
  164  0180E4 4E40         gpclr:   trap #0
  165  0180E6 4CDF0081              movem.l (a7)+,d7/d0
  166  0180EA 023C00FE             and.b #$fe,ccr       * clear carry, packet 
  166+                     available
  167  0180EE 4E40                 trap  #0
  168  0180F0 4E75                 rts
  169                      
  170  0180F2 48E78080     centpk: movem.l a0/d0,-(a7) 
  171  0180F6 323900011002         move.w save,d1
  172  0180FC E149                 lsl.w  #8,d1
  173  0180FE 207C00060000         move.l fifo,a0
  174  018104 303900010000         move.w cntrl,d0
  175  01810A C07C00FF             and.w  #$00ff,d0
  176  01810E 8041                 or.w   d1,d0
  177  018110 3080                 move.w d0,(a0)
  178  018112 30B900010002         move.w sdadd,(a0)
  179  018118 30B900010004         move.w data1,(a0)
  180  01811E 30B900010006         move.w data2,(a0)
  181  018124 4CDF0101             movem.l (a7)+,a0/d0
  182  018128 4E75                 rts
  183                      
  184                      *cmode:  move.w evmode,d0
  185                      *        cmp.w  #0,d0
  186                      *        bne    cmend
  187                      *        move.w both,led
  188                      *        jsr    getpk
  189                      *        bcs    cmend
  190                      *        jsr    centpk
  191                      *        cmp.w  #10,save
  192                      *        beq    wait
  193                      *        bra    cmode
  194                      *cmend:  rts
  195                      
  196  01812A 2A3900010000 eventid:move.l cntrl,d5           * extract the eve
  196+                     nt id
 Motorola M68000 Assembler                                           Page   5

  197  018130 CA7C0F0F             and.w  #$0f0f,d5
  198  018134 3805                 move.w d5,d4
  199  018136 E94C                 lsl.w  #4,d4
  200  018138 DA44                 add.w  d4,d5
  201  01813A CABC00000FF0         and.l  #$00000ff0,d5
  202  018140 283900010004         move.l data1,d4           * process info su
  202+                     ppose to be in second pk.
  203  018146 C8BCFFFFF00F         and.l  #$fffff00f,d4
  204  01814C D845                 add.w  d5,d4
  205  01814E 4E75                 rts
  206                      *
  207                      *
  208  018150 263900010004 tmstmp: move.l data1,d3           * get the timesta
  208+                     mp
  209  018156 4E75                 rts
  210                      *
  211                      *
  212  018158 2F08         sendev: move.l a0,-(a7)
  213                      *        jsr    eventid
  214                      *        jsr    tmstmp
  215  01815A 207C00060000         move.l fifo,a0
  216  018160 2083                 move.l d3,(a0)
  217  018162 2084                 move.l d4,(a0)
  218  018164 205F                 move.l (a7)+,a0
  219  018166 4E75                 rts
  220                      
  221  018168 00000005     dbase:  dc.l   $5,$1fef6c41
  222  018170 00000007             dc.l   $7,$1fef6c4b
  223  018178 00000019             dc.l   $19,$2f9f34c1
  224  018180 00000040             dc.l   $40,$1fef6c49
  225  018188 00000040             dc.l   $40,$2f9f34ca
  226  018190 00000103             dc.l   $103,$251f37c1
  227  018198 00000257             dc.l   $257,$251f37c6
  228  0181A0 00000290             dc.l   $290,$2f9f34c2
  229  0181A8 00000596             dc.l   $596,$251f37c7
  230  0181B0 00001214             dc.l   $1214,$251f37cb
  231  0181B8 00005681             dc.l   $5681,$251f37c9
  232  0181C0 00005681             dc.l   $5681,$1fe50c7a
  233  0181C8 00012143             dc.l   $12143,$2f9f34c4
  234  0181D0 00022772             dc.l   $22772,$1fe50c75
  235  0181D8 00022772             dc.l   $22772,$251f37c5
  236  0181E0 0079ABCD             dc.l   $79abcd,$1fe50c72
  237                      
  238  0181E8 7A10         txdb:   move.l #16,d5
  239  0181EA 43F900018168         lea    dbase,a1
  240  0181F0 6000000C             bra    chk
  241  0181F4 2619         more:   move.l (a1)+,d3
  242  0181F6 2819                 move.l (a1)+,d4
  243  0181F8 4EB900018158         jsr    sendev
  244  0181FE 51CDFFF4     chk:    dbra   d5,more
  245  018202 4EB900018000         jsr    clrled
  246  018208 4E75                 rts
  247                      *
  248                      *
  249                      *
  250                      
  251  01820A 4E40         ctserv: trap   #0
  252  01820C 4EB900018060         jsr    sndack
  253  018212 33FC00000001         move.w #0,evmode
 Motorola M68000 Assembler                                           Page   6

  254  01821A 4E73                 rte
  255                      
  256  01821C 4E40         evserv: trap   #0
  257  01821E 4EB900018060         jsr    sndack
  258  018224 33FCFFFF0001         move.w #$ffff,evmode
  259  01822C 4E73                 rte
  260                      
  261  01822E 4EB900018048 rfserv: jsr    clrrq         * clear interupt
  262  018234 1E3C0000             move.b #$00,d7       * clear flag
  263                      
  264                      * move fields to holding ram space
  265  018238 33F900030000         move.w sdaddr,sdadd
  266  018242 33F900050000         move.w dataMW,data1
  267  01824C 33F900040000         move.w dataLW,data2
  268  018256 33F900070000         move.w cntfd,cntrl 
  269                      
  270                      * incr interrupt counter
  271                      
  272  018260 527900011002         add.w #1,save
  273  018266 4E73                 rte
  274                      
  275                      
  276                      
  277  018268 007C0700     init:   or.w   #$0700,sr     * Disable interupts
  278  01826C 33FCFFFF0007         move.w #$ffff,led
  279  018274 13FC00FF0001         move.b #$ff,hwcnt
  280  01827C 4EB900018018         jsr    grnled        * Turn on the green LE
  280+                     D
  281  018282 33FC00000001         move.w #00,save      * A counter for number
  281+        1002          of Centrenet pk processed.
  282  01828A 33FC00000001         move.w #$00,evmode   *  current mode defaul
  282+        2000         t is CENTRNT PAK. mode
  283                      *                            * mode setup for centr
  283+                     enet packets : for develpmt.
  284                      
  285                      * TESTing  fifo
  286  018292 027CFCFF             and.w  #$fcff,sr
  287                      *        or.w   #$0500,sr     * for testing disable
  287+                      interproc handshake.
  288  018296 4E75                 rts
  289                      
  290         0001A000             org    $01a000       * was $03000
  291  01A000 4EB900018268 start:  jsr    init
  292                      
  293  01A006 4EB900018000         jsr    clrled           * the main part is 
  293+                     to check for correct 
  294                      *        jsr    txdb
  295                      
  296                      
  297  01A00C 4EB9000180C0 p1cont: jsr    getpk
  298  01A012 303900012000         move.w evmode,d0
  299  01A018 B07C0000             cmp.w  #0,d0
  300  01A01C 66000018             bne    ntest
  301  01A020 4EB9000180A8         jsr    bothled
  302  01A026 4EB900018078         jsr    clrack
  303  01A02C 4EB9000180F2         jsr    centpk
  304  01A032 4E40                 trap   #0
  305  01A034 60D6                 bra    p1cont
  306  01A036 4EB900018000 ntest:  jsr    clrled           * extract event pac
 Motorola M68000 Assembler                                           Page   7

  306+                     ket information 
  307  01A03C 4EB900018078         jsr    clrack
  308  01A042 4EB900018158         jsr    sendev
  309  01A048 60C2                 bra    p1cont
  310                      
  311  01A04A 4EB900018018 wait:   jsr    grnled
  312  01A050 4E40         wait2:  trap   #0               * was   jmp    wait
  312+                     2
  313                      
  314                      *                                * handshake
  315                      *nobhd:  jsr    readpk            * read next centr
  315+                     enet packet
  316                      *        move.l cntrl,a0          * get control fie
  316+                     ld
  317                      *        move.b (a0),d0
  318                      *        cmp.b  bhead,d0          * is packet a bur
  318+                     st header?
  319                      *        bne    halt          *nobhd             * 
  319+                     no !
  320                      *        move.l sdadd,a1          * get source & de
  320+                     st processor addresses
  321                      *        move.w (a1),d1
  322                      *        rol.w  #8,d1             * swap addresses
  323                      *nohack: jsr    readpk
  324                      *        move.b (a0),d2
  325                      *        cmp.b  bhack,d2          * is packet burst
  325+                      header ack?
  326                      *        bne    halt          *nohack            * 
  326+                     No!
  327                      *        move.w (a1),d2
  328                      *        cmp.b  d2,d1             * Do source & des
  328+                     t address match
  329                      *        bne    halt          *nohack            * 
  329+                     No!
  330                      *nodtpk: jsr    readpk            * read next centr
  330+                     enet packet
  331                      *        move.b (a0),d0
  332                      *        cmp.b  dtpk,d0           * Is this packet 
  332+                     a data packet
  333                      *        bne    halt          *nodtpk
  334                      *        jsr    eventid           * Generate event 
  334+                     identifaction
  335                      *notmsp: jsr    readpk
  336                      *        move.b (a0),d0
  337                      **        cmp.b  enddt,d0
  338                      **        beq    endpk
  339                      *        cmp.b  dtpk,d0
  340                      *        bne    halt          *notmsp
  341                      *        jsr    tmstmp            * Generate time s
  341+                     tamp
  342                      *moredt  jsr    readpk
  343                      *        move.b (a0),d0
  344                      *        cmp.b  ltpk,d0           * Last data packe
  344+                     t ?
  345                      *        bne    halt          *moredt
  346                      *nopack: jsr    readpk
  347                      *        cmp.b  dtack,(a0)        * Burst data ack 
  347+                     ?
  348                      *        bne    halt          *nopack
 Motorola M68000 Assembler                                           Page   8

  349                      *        cmp.w  (a1),d1           * source & dest m
  349+                     atch ?
  350                      *        bne    nopack
  351                      *        jsr    sendev            * pass on event l
  351+                     og
  352                      **
  353                      *        move.w green,led
  354                      *halt:   trap   #0
  355                      *
  356                      *        bra    nobhd             * repeat
  357                      
  358                      *berr:   jsr    clrled
  359                      *        jsr    redled
  360                      *berr1   jmp    berr1        *IN CASE OF BUSERROR
  361                      *adderr: jsr    clrled
  362                      *        jsr    redled
  363                      *aderr1: jmp    aderr1      *IN CASE OF ADDRERROR
  364                      *
  365                      *        org    $0
  366                      *        dc.l   $1fffe       *SETUP STACK POINTER
  367                      *        dc.l   start        *START OF PROGRAM
  368                      *        dc.l   berr         *BUSERROR VECTOR
  369                      *        dc.l   adderr       *ADDRERROR VECTOR
  370                      
  371                      *        org    $68
  372                      *        dc.l   ctserv       * Clear event flag to 
  372+                     false
  373                      
  374                      *        org    $6c
  375                      *        dc.l   evserv       * set event flag to tr
  375+                     ue
  376                      
  377                      *        org    $78
  378                      *        dc.l   rfserv       * storage fifo read se
  378+                     rvice routine.
  379                      
  380                      
  381                      *   Interrupt vectors for use with 68000 software m
  381+                     onitor.
  382                      *
  383                      
  384         0001FE48              org    $1fe48
  385  01FE48 4EF90001820A          jmp    ctserv
  386                      
  387         0001FE50              org    $1fe50
  388  01FE50 4EF90001821C          jmp    evserv
  389                      
  390         0001FE68              org    $1fe68
  391  01FE68 4EF90001822E          jmp    rfserv
  392                      
  393                               END

No faults and no warnings in this assembly.
