
 Motorola M68000 Assembler                                           Page   1

    1                      ***************************************************
    1+                     **************************)
    2                      *                                                  
    2+                                              *)
    3                      *                                                  
    3+                                              *)
    4                      *    Program    : Display Software Monitor for EDDE
    4+                     .                        *)
    5                      *                                                  
    5+                                              *)
    6                      *    Purpose    : This the user interface software 
    6+                     to collect, store and    *)
    7                      *                 display the event information in 
    7+                     a dbase on this board.   *)
    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       : 18th July 1989       Version 6.2 
   15+                                              *)
   16                      *                 Rev. 17 July 1989    Ver 6.2  to 
   16+                     allow display of CentreNt*)
   17                      *                                      packet witho
   17+                     ut processing.           *)
   18                      *                 Rev. 12 March 1990   Bugfixing.  
   18+                                              *)
   19                      *                     5th May   199    Centrenet pa
   19+                     cket sequencing.         *)
   20                      *                    10th July  1990   Hardware Fil
   20+                     tering.                  *)
   21                      *                     3rd Oct   1990   History cmd 
   21+                     and init handshake.      *)
   22                      *                                                  
   22+                                              *)
   23                      *    Supervisor : Damal K. ARVIND                  
   23+                                              *)
   24                      *                                                  
   24+                                              *)
   25                      ***************************************************
   25+                     **************************)
   26                              incl   subr.asm
    1&                     * :*:*:*:*:*:*:*:*:*:*:*:*:*:*:*:*:*:*:*:*:*:*:*:*:
    1+                     *:*:*:*:*:*:*
    2&                     *
    3&                     * :*:*:*:*:*:*:*:*:*:*:*:*:*:*:*:*:*:*:*:*:*:*:*:*:
    3+                     *:*:*:*:*:*:*
    4&                     *
    5&                     *
    6&                     *
 Motorola M68000 Assembler                                           Page   2

    7&        00010000     romsize equ $010000
    8&        00000000     rombot  equ $000000
    9&        0000FFFF     romtop  equ $00FFFF
   10&                     
   11&        00020000     ramsize equ $020000
   12&        00020000     rambot  equ $020000
   13&        0003FFFF     ramtop  equ $03FFFF
   14&                     
   15&                     * FIFO register addresses
   16&        00060000     fifo    equ $060000
   17&                     
   18&                     * filter addresses
   19&        00050001     dlbar   equ $050001
   20&        00050000     dgbar   equ $050000
   21&        00050003     slbar   equ $050003
   22&        00050002     sgbar   equ $050002
   23&        00050005     contr   equ $050005
   24&                     
   25&                     
   26&                     * DUART register addresses
   27&        00040001     base    equ $040001
   28&        00040001     modea   equ base+0
   29&        00040003     stata   equ base+2
   30&        00040003     clka    equ base+2
   31&        00040005     cmda    equ base+4
   32&        00040007     thra    equ base+6
   33&        00040007     rhra    equ base+6
   34&        00040009     ipcr    equ base+8
   35&        00040009     acr     equ base+8
   36&        0004000B     isr     equ base+10
   37&        0004000B     imr     equ base+10
   38&        0004000D     countl  equ base+12
   39&        0004000F     counth  equ base+14
   40&        00040011     modeb   equ base+16
   41&        00040013     statb   equ base+18
   42&        00040013     clkb    equ base+18
   43&        00040015     cmdb    equ base+20
   44&        00040017     rhrb    equ base+22
   45&        00040017     thrb    equ base+22
   46&        00040019     ivr     equ base+24
   47&        0004001B     iport   equ base+26
   48&        0004001B     opcr    equ base+26
   49&        0004001D     stcnt   equ base+28
   50&        0004001F     spcnt   equ base+30
   51&        0004001D     bitset  equ base+28
   52&        0004001F     bitres  equ base+30
   53&                     
   54&                     
   55&                     
   56&                     * mode reg 1
   57&                     
   58&        00000080     rxrts   equ $80
   59&        00000000     norrts  equ $0
   60&                     
   61&        00000000     rirdy   equ $0
   62&        00000040     rifful  equ $40
   63&                     
   64&        00000000     cerr    equ $0
   65&        00000020     blerr   equ $20
 Motorola M68000 Assembler                                           Page   3

   66&                     
   67&        00000000     wthpar  equ $0
   68&        00000008     forcep  equ $8
   69&        00000010     nopar   equ $10
   70&        00000018     multi   equ $18
   71&                     
   72&        00000000     evenp   equ $0
   73&        00000004     oddp    equ $4
   74&                     
   75&        00000000     bits5   equ $0
   76&        00000001     bits6   equ $1
   77&        00000002     bits7   equ $2
   78&        00000003     bits8   equ $3
   79&                     
   80&                     * mode reg 2 
   81&                     
   82&        00000000     norop  equ $0
   83&        00000040     echo    equ $40
   84&        00000080     lloop   equ $80
   85&        000000C0     rloop   equ $C0
   86&                     
   87&        00000020     txrts   equ $20
   88&        00000000     notrts  equ $0
   89&                     
   90&        00000010     cts     equ $10
   91&        00000000     nocts   equ $0
   92&                     
   93&        00000007     stop1   equ $7
   94&        0000000F     stop2   equ $f
   95&                     
   96&                     * clk sel reg
   97&                     
   98&        000000BB     b9600   equ $bb
   99&                     
  100&                     * Command REG
  101&                     * Miscell
  102&                     
  103&        00000000     nocmd   equ $0
  104&        00000010     point1  equ $10
  105&        00000020     rstrx   equ $20
  106&        00000030     rsttx   equ $30
  107&        00000040     rsterr  equ $40
  108&        00000050     rstint  equ $50
  109&        00000060     brkon   equ $60
  110&        00000070     brkoff  equ $70
  111&                     
  112&                     * transmitter
  113&                     
  114&        00000000     tnoop   equ $0
  115&        00000004     ten     equ $4
  116&        00000008     tdis    equ $8
  117&                     
  118&                     * receiver
  119&                     
  120&        00000000     rnoop   equ $0
  121&        00000001     ren     equ $1
  122&        00000002     rdis    equ $2
  123&                     
  124&                     * interupts
 Motorola M68000 Assembler                                           Page   4

  125&        00000000     noints  equ $0
  126&                     
  127&                     * output config
  128&        00000000     allout  equ $0
  129&                     
  130&                     * status register bits
  131&                     
  132&        00000080     break   equ $80
  133&        00000040     frame   equ $40
  134&        00000020     parity  equ $20
  135&        00000010     overrun equ $10
  136&        00000008     txempty equ $8
  137&        00000004     txready equ $4
  138&        00000002     ffull equ $2
  139&        00000001     rxready equ $1
  140&                     
  141&                     ** Derived memory addresses
  142&                     *vecsize equ $200
  143&                     *stack   equ ramtop-vecsize-1
  144&                     
  145&                     *
  146&        00000000     null	equ $00
  147&        0000000D     cr	equ $0d
  148&        0000000A     lf	equ $0a
  149&        00000020     space	equ $20
  150&        00000007     bell	equ $07
  151&        00000009     tab	equ $09
  152&                     *
  153&        0000001C     netbrk	equ $1c		* Control-\
  154&                     
  155&                     
  156&        00030000             org  $30000
  157&                     
  158&                     *
  159&                     * :*:*:*:*:*:*:*:*:*:*:*:*:*:*:*:*:*:*:*:*:*:*:*:*:
  159+                     *:*:*:*:*:*:*
  160&                     *
  161&                     * INCHR: inputs a character from port 1
  162&                     *        returns with carry set if not available
  163&                     *
  164& 030000 083900000004 inchr:  btst   #0,stata	* Rx ready?
  165& 030008 67000018             beq    inchr1	* no, return with carry
  166& 03000C 103900040007 nchr:   move.b rhra,d0	* get char
  167& 030012 083900000004         btst.b #0,stata
  168& 03001A 66F0                 bne    nchr
  169& 03001C 023C00FE             and.b  #$0fe,ccr	* clear carry no error
  170& 030020 4E75                 rts		* return
  171& 030022 003C0001     inchr1: or.b #$01,ccr		* set carry
  172& 030026 4E75                 rts		* return
  173&                     *
  174&                     * INCH: inputs a character from port 1
  175&                     *	no echo, char in D0
  176&                     *
  177& 030028 4EB900030000 inch:   jsr inchr	* get character
  178& 03002E 65F8                 bcs inch		* if not available, try again
  179& 030030 4E75                 rts		* return
  180&                     *
  181&                     * INCHR2: as INCH for port 2
  182&                     *
 Motorola M68000 Assembler                                           Page   5

  183& 030032 083900000004 inchr2:	btst #0,statb_* Rx ready?
  184& 03003A 67000018     	beq inch21	* no, return with carry
  185& 03003E 103900040017 ichr2: 	move.b rhrb,d0	* get data
  186& 030044 083900000004        btst.b #0,statb
  187& 03004C 66F0                bne ichr2
  188& 03004E 023C00FE     	and.b #$0fe,ccr	* clear carry no error
  189& 030052 4E75         	rts
  190& 030054 003C0001     inch21:	or.b #$01,ccr	* error - set carry
  191& 030058 4E75         	rts
  192&                     *
  193&                     * INCH2: as INCH for port 2
  194&                     *
  195& 03005A 4EB900030032 inch2:	jsr inchr2	* try for char
  196& 030060 65F8         	bcs inch2	* loop if no char available
  197& 030062 4E75         	rts
  198&                     *
  199&                     * INCHU: inputs a character to D0, [a-z] converted 
  199+                     to [A-Z]
  200&                     *	 <LF> converted to <CR>, no echo, uses INCH, regi
  200+                     ster D0 used
  201&                     *
  202& 030064 4EB900030028 inchu:  jsr inch	* get a character
  203& 03006A B03C0061     upcse:  cmp.b #$61,d0	* is it less than "a"?
  204& 03006E 6D000010             blt inchu1	* yes, continue
  205& 030072 B03C007A             cmp.b #$7a,d0	* is it greater than "z"?
  206& 030076 6E000008             bgt inchu1	* yes, continue
  207& 03007A 903C0020             sub.b #$20,d0	* subtract offset
  208& 03007E 4E75                 rts		* return
  209& 030080 B03C000A     inchu1: cmp.b #lf,d0	* is it LF?
  210& 030084 66000006             bne inchu3	* no, continue
  211& 030088 103C000D             move.b #cr,d0	* char is CR
  212& 03008C 4E75         inchu3: rts		* return
  213&                     
  214&                     * OUTCH: output a character using duart port 1
  215&                     *	 character in D0, all registers unaffected
  216&                     *
  217& 03008E 083900020004 outch: btst #2,stata	* Tx ready?
  218& 030096 67F6                beq outch	* no, try again
  219& 030098 13FC00040004        move.b   #ten,cmda
  220& 0300A0 13C000040007        move.b d0,thra	* output character
  221& 0300A6 13FC00010004        move.b   #ren,cmda
  222& 0300AE 4E75                rts		* return
  223&                     *
  224&                     * OUTCH2: as OUTCH for auxiliary RS232 port
  225&                     *
  226& 0300B0 083900020004 outch2:	btst #2,statb	* Tx ready?
  227& 0300B8 67F6         	beq outch2	* no - loop
  228& 0300BA 13FC00040004      move.b   #ten,cmdb
  229& 0300C2 13C000040017 	move.b d0,thrb	* send char
  230& 0300C8 13FC00010004      move.b   #ren,cmdb
  231& 0300D0 4E75         	rts
  232&                     *
  233&                     * PDATA: outputs a string starting at A4, length in
  233+                      D2
  234&                     *	 uses OUTCH 
  235&                     *
  236& 0300D2 2F00         pdata: move.l d0,-(sp)		* save D0
  237& 0300D4 6000000A            bra pdatst	* go to count test
  238& 0300D8 101C         pdatlp:move.b (a4)+,d0	* get op char
 Motorola M68000 Assembler                                           Page   6

  239& 0300DA 4EB90003008E        jsr outch	* print char
  240& 0300E0 51C9FFF6     pdatst:dbra d1,pdatlp	* decrement D2, repeat loop i
  240+                     f not zero
  241& 0300E4 201F                move.l (sp)+,d0		* restore D0
  242& 0300E6 4E75                rts		* return
  243&                     *
  244&                     * NEWLIN: output #cr,lf; uses OUTCH and D0
  245&                     *
  246& 0300E8 103C000D     newlin:move.b #cr,d0	* get CR
  247& 0300EC 4EB90003008E        jsr outch	* output char
  248& 0300F2 103C000A            move.b #lf,d0	* get LF
  249& 0300F6 4EB90003008E        jsr outch	* output char
  250& 0300FC 4E75                rts		* return
  251&                     *
  252&                     * NEWLN2: output two newlines
  253&                     *
  254& 0300FE 4EB9000300E8 newln2:jsr newlin	* do #cr,lf; fall through
  255& 030104 4EB9000300E8        jsr newlin
  256& 03010A 4E75                rts
  257&                     
  258&                     *
  259&                     * PBELL: echo bell character, uses OUTCH and D0
  260&                     *
  261& 03010C 2F00         pbell:  move.l d0,-(a7)
  262& 03010E 103C0007             move.b #bell,d0	* 
  263& 030112 4EB90003008E         jsr    outch	* output bell
  264& 030118 201F                 move.l (a7)+,d0
  265& 03011A 4E75                 rts		* return
  266&                     
  267&                     * :*:*:*:*:*:*:*:*:*:*:*:*:*:*:*:*:*:*:*:*:*:*:*:*:
  267+                     *:*:*:*:*:*:*
  268&                     *
  269&                     * PSPACx: prints "x" spaces; uses OUTCH and D0
  270&                     *
  271& 03011C 103C0020     pspac1: move.b #space,d0	* get space
  272& 030120 4EB90003008E         jsr outch	* output char
  273& 030126 4E75                 rts		* return
  274& 030128 4EB90003011C pspac7: jsr pspac1	* fall through
  275& 03012E 4EB90003011C pspac6: jsr pspac1     *
  276& 030134 4EB90003011C pspac5:	jsr pspac1	* 
  277& 03013A 4EB90003011C pspac4:	jsr pspac1	*
  278& 030140 4EB90003011C pspac3: jsr pspac1	*
  279& 030146 4EB90003011C pspac2: jsr pspac1	*
  280& 03014C 4EB90003011C         jsr pspac1
  281& 030152 4E75                 rts
  282&                     *
  283&                     * PEQUAL: prints an "="
  284&                     *
  285& 030154 103C003D     pequal:	move.b #$3d,d0	*
  286& 030158 4EB90003008E 	jsr outch	* output "="
  287& 03015E 4E75         	rts		* return
  288&                     *
  289&                     * POKMS: prints an OK message
  290&                     *
  291& 030160 2F00         pokms:	move.l d0,-(sp)		* save D0
  292& 030162 4EB90003011C 	jsr pspac1	* print space
  293& 030168 103C002D     	move.b #$2d,d0	*
  294& 03016C 4EB90003008E 	jsr outch	* print '-'
  295& 030172 4EB90003011C 	jsr pspac1	* print space
 Motorola M68000 Assembler                                           Page   7

  296& 030178 103C004F     	move.b #$4f,d0	*
  297& 03017C 4EB90003008E 	jsr outch	* print 'O'
  298& 030182 103C004B     	move.b #$4b,d0	*
  299& 030186 4EB90003008E 	jsr outch	* print 'K'
  300& 03018C 201F         	move.l (sp)+,d0		* restore D0
  301& 03018E 4E75         	rts		* return
  302&                     *
  303&                     * LOHEX: print LS four bits in D0 as hex digit
  304&                     *
  305& 030190 C03C000F     lohex:	and.b #$0f,d0	* clear top 4 bits
  306& 030194 B03C000A     	cmp.b #10,d0	* greater than 10?
  307& 030198 6C00000E     	bge lohex1	* yes, continue
  308& 03019C D03C0030     	add.b #$30,d0	* add char offset
  309& 0301A0 4EB90003008E lohex2:	jsr outch	* output char
  310& 0301A6 4E75         	rts		* return
  311& 0301A8 D03C0037     lohex1:	add.b #$41-10,d0	* add "A"-10
  312& 0301AC 60F2         	bra lohex2	* continue
  313&                     *
  314&                     * HIHEX: print MS four bits of D0 as hexadecimal di
  314+                     git
  315&                     *
  316& 0301AE E918         hihex:	rol.b #4,d0	* swap nibbles
  317& 0301B0 4EB900030190 	jsr lohex	* print it
  318& 0301B6 4E75         	rts		* return
  319&                     *
  320&                     * CH2HEX: print value in D0 as two hex digits
  321&                     *
  322& 0301B8 2F00         ch2hex:	move.l d0,-(sp)		* save value
  323& 0301BA 4EB9000301AE 	jsr hihex	* print ms 4 bits
  324& 0301C0 201F         	move.l (sp)+,d0		* restore value
  325& 0301C2 4EB900030190 	jsr lohex	* print ls 4 bits
  326& 0301C8 4E75         	rts		* return
  327&                     *
  328&                     * CH6HEX: print value in D1 as 6 hex digits
  329&                     *         uses D0 register
  330&                     *
  331& 0301CA 2001         ch6hex:	move.l d1,d0
  332& 0301CC E088         	lsr.l #8,d0	*
  333& 0301CE E088         	lsr.l #8,d0	* move top byte to lsb of d0
  334& 0301D0 4EB9000301B8 	jsr ch2hex	* print it and drop through
  335&                     *
  336&                     * CH4HEX: print value in D1 as 4 hex digits
  337&                     *	  uses D0 register
  338&                     *
  339& 0301D6 3001         ch4hex:	move.w d1,d0	* get msb	
  340& 0301D8 E048         	lsr.w #8,d0	* move msb to lsb of d0
  341& 0301DA 4EB9000301B8 	jsr ch2hex	* print it
  342& 0301E0 1001         	move.b d1,d0	* get lsb and drop through
  343& 0301E2 4EB9000301B8         jsr ch2hex
  344& 0301E8 4E75                 rts
  345&                     *
  346&                     * CH8HEX: print value in D1 as 8 hex digits
  347&                     *
  348& 0301EA 2F01         ch8hex:	move.l d1,-(sp)	* save value
  349& 0301EC E089         	lsr.l #8,d1
  350& 0301EE E089         	lsr.l #8,d1	* get msw to lsw
  351& 0301F0 4EB9000301D6 	jsr ch4hex	* print msw
  352& 0301F6 221F         	move.l (sp)+,d1	* restore value
  353& 0301F8 4EB9000301D6 	jsr ch4hex	* print lsw and space
 Motorola M68000 Assembler                                           Page   8

  354& 0301FE 4E75         	rts
  355&                     *
  356&                     * SCH8HX: print value in D1 as 8 hex digits, and SP
  356+                     ACE
  357&                     *
  358& 030200 4EB9000301EA sch8hx:	jsr ch8hex	* print value
  359& 030206 4EB90003011C 	jsr pspac1	* print space and fall through
  360& 03020C 4E75         	rts
  361&                     *
  362&                     * SCH6HX: print value in D1 as 6 hex digits, and SP
  362+                     ACE
  363&                     *
  364& 03020E 4EB9000301CA sch6hx:	jsr ch6hex	* print number
  365& 030214 4EB90003011C 	jsr pspac1	* space
  366& 03021A 4E75         	rts
  367&                     *
  368&                     * SCH4HX: print value in D1 as hex digits, and SPAC
  368+                     E
  369&                     *
  370& 03021C 4EB9000301D6 sch4hx:	jsr ch4hex	* print value
  371& 030222 4EB90003011C 	jsr pspac1	* print 1 space
  372& 030228 4E75         	rts		* return
  373&                     *
  374&                     * SCH2HX: print value in D0 as hex digits, and spac
  374+                     e
  375&                     *
  376& 03022A 4EB9000301B8 sch2hx:	jsr ch2hex	* print value
  377& 030230 4EB90003011C 	jsr pspac1	* print 1 space
  378& 030236 4E75         	rts		* return
  379&                     **
  380&                     ** CHKEVN: checks if D1 even, if so rts with carry 
  380+                     clear
  381&                     ** 	  if not, prints message and rts with carry set
  382&                     **
  383&                     *chkevn:	btst #0,d1	* test d1 bottom bit
  384&                     *	beq even	* branch if even
  385&                     *	jsr pbell	* sound bell
  386&                     *	lea oddms,a4	* pointer to message
  387&                     *	move.l #oddmn-oddms,d2	* msg length
  388&                     *	jsr pdata	* print message
  389&                     *	or.b #$01,ccr	* set carry
  390&                     *	rts
  391&                     *even:	and.b #$0fe,ccr	* unset carry
  392&                     *	rts
  393&                     *
  394&                     * IN1HEX: get 1 hexadecimal character into D0* sets
  394+                      carry if <CR>
  395&                     *
  396& 030238 4EB900030064 in1hex:	jsr inchu	* get upper-case character
  397& 03023E B03C0030     	cmp.b #$30,d0	* is it less than "0"?
  398& 030242 6D00003A     	blt in1er1	* yes, possible error
  399& 030246 B03C0039     	cmp.b #$39,d0	* is it greater than "9"?
  400& 03024A 6E000012     	bgt in1er2	* yes, possible error
  401& 03024E 4EB90003008E 	jsr outch	* echo char
  402& 030254 903C0030     	sub.b #$30,d0	* subtract offset
  403& 030258 023C00FE     	and.b #$0fe,ccr		* clear carry bit
  404& 03025C 4E75         	rts		* return
  405& 03025E B03C0041     in1er2:	cmp.b #$41,d0	* is it less than "A"?
  406& 030262 6D000022     	blt in1err	* yes, error
 Motorola M68000 Assembler                                           Page   9

  407& 030266 B03C0046     	cmp.b #$46,d0	* is it greater than "F"?
  408& 03026A 6E00001A     	bgt in1err	* yes, error
  409& 03026E 4EB90003008E 	jsr outch	* output char
  410& 030274 903C0037     	sub.b #$41-10,d0	* subtract char offset
  411& 030278 023C00FE     	and.b #$0fe,ccr		* clear carry
  412& 03027C 4E75         	rts		* return
  413& 03027E B03C000D     in1er1:	cmp.b #cr,d0	* is it CR?
  414& 030282 6700000A     	beq in1cr	* yes, continue
  415& 030286 4EB90003010C in1err:	jsr pbell	* output bell
  416& 03028C 60AA         	bra in1hex	* try again
  417& 03028E 4EB90003008E in1cr:	jsr outch	* echo character
  418& 030294 003C0001     	or.b #$01,ccr		* set carry
  419& 030298 4E75         	rts		* return
  420&                     *
  421&                     * SIN2HX: print space, and get 2 hex digits into D0
  421+                     ; set carry if <CR>
  422&                     *
  423& 03029A 4EB90003011C sin2hx:	jsr pspac1	* print space and drop through
  424&                     *
  425&                     * IN2HEX: get 2 hex digits into D0* return with car
  425+                     ry set if <CR>
  426&                     *
  427& 0302A0 4EB900030238 in2hex:	jsr in1hex	* get first hex digit
  428& 0302A6 6500002C     	bcs in2hx9	* return if carry set
  429& 0302AA 2F01         in2hax:	move.l d1,-(sp)		* save D1
  430& 0302AC C03C000F     	and.b #$0f,d0	* clear ms nibble
  431& 0302B0 E918         	rol.b #4,d0	* swap nibbles
  432& 0302B2 2F00         	move.l d0,-(sp)		* save D0
  433& 0302B4 4EB900030238 	jsr in1hex	* get second hex digit
  434& 0302BA 65000014     	bcs in2hx8	* return if carry set
  435& 0302BE 1200         	move.b d0,d1	* save LS nibble
  436& 0302C0 201F         	move.l (sp)+,d0		* get MS nibble
  437& 0302C2 C23C000F     	and.b #$0f,d1	* clear MS bits
  438& 0302C6 D001         	add.b d1,d0	* add nibbles
  439& 0302C8 221F         	move.l (sp)+,d1		* restore D1
  440& 0302CA 023C00FE     	and.b #$0fe,ccr		* clear carry bit
  441& 0302CE 4E75         	rts		* return
  442& 0302D0 201F         in2hx8:	move.l (sp)+,d0		*
  443& 0302D2 201F         	move.l (sp)+,d0		* clean up stack
  444& 0302D4 003C0001     in2hx9: or.b #$01,ccr		* set carry
  445& 0302D8 4E75         	rts		* return
  446&                     *
  447&                     * SIN4HX: output a space, and input 4 hex chars
  448&                     *
  449& 0302DA 4EB90003011C sin4hx:	jsr pspac1	* print a space* fall through
  450&                     *
  451&                     * IN4HEX: inputs 4 hex chars to D1* returns with ca
  451+                     rry set if <CR>
  452&                     *
  453& 0302E0 4EB9000302A0 in4hex:	jsr in2hex	* get 2 hex digits
  454& 0302E6 65000012     	bcs in4hx	* return if carry
  455& 0302EA E148         	lsl.w #8,d0	* shift it up to msb
  456& 0302EC 3200         	move.w d0,d1	* save in d1
  457& 0302EE 4EB9000302A0 	jsr in2hex	* get 2 hex digits
  458& 0302F4 65000004     	bcs in4hx	* return if carry
  459& 0302F8 1200         	move.b d0,d1	* move to lsb
  460& 0302FA 4E75         in4hx:	rts		* return
  461&                     *
  462&                     * SIN6HX: output a space, and input 6 hex chars to 
 Motorola M68000 Assembler                                           Page  10

  462+                     D1, msb cleared
  463&                     *
  464& 0302FC 4EB90003011C sin6hx:	jsr pspac1	* print a space & fall through
  465&                     *
  466&                     * IN6HEX: inputs 6 hex chars to D1* returns with ca
  466+                     rry set if <CR>
  467&                     * 	  msb of D1 cleared
  468&                     *
  469& 030302 4281         in6hex:	clr.l d1	* initialize
  470& 030304 4EB9000302A0 	jsr in2hex	* get 2 hex digits
  471& 03030A 65EE         	bcs in4hx	* return if carry
  472& 03030C 1200         	move.b d0,d1
  473& 03030E E189         	lsl.l #8,d1	*
  474& 030310 E189         	lsl.l #8,d1	* shift to correct d1 byte
  475& 030312 60CC         	bra in4hex	* get rest
  476&                     *
  477&                     * SIN8HX: output a space, and input 8 hex chars to 
  477+                     D1
  478&                     *
  479& 030314 4EB90003011C sin8hx:	jsr pspac1	* print a space & fall through
  480&                     *
  481&                     * IN8HEX: inputs 8 hex chars to D1. Return with car
  481+                     ry set if <CR>
  482&                     *
  483& 03031A 4EB9000302E0 in8hex:	jsr in4hex	* get 4 digits to D1
  484& 030320 65D8                 bcs in4hx	* return if carry set
  485& 030322 E189                 lsl.l #8,d1
  486& 030324 E189                 lsl.l #8,d1	* shift to msw
  487& 030326 60B8                 bra in4hex	* get rest
  488&                     *
  489&                     * HINCH: gets a character - if lnkflg = 00 gets cha
  489+                     r from network,
  490&                     * echos and acknowledges it; if lnkflg <> 00 gets c
  490+                     har from
  491&                     * auxiliary RS232 port;
  492&                     * char got to d0, all other registers unaffected, c
  492+                     lears top bit of char
  493&                     *
  494& 030328 4EB90003005A hinch:	jsr inch2	* get char from aux RS232
  495& 03032E C03C007F     	and.b #$7f,d0	* clear top bit
  496& 030332 4E75         	rts		* return
  497&                     *
  498&                     * HINCHR: gets an UPPER-CASE character from network
  498+                      interface to D0
  499&                     *         <LF> converted to <CR>, uses HINCH routin
  499+                     e
  500&                     *
  501& 030334 4EB900030328 hinchr:	jsr hinch	* get character
  502& 03033A B03C0061     	cmp.b #$61,d0	* is it less than "a"?
  503& 03033E 6D000010     	blt hincu1	* yes, continue
  504& 030342 B03C007A     	cmp.b #$7a,d0	* is it greater than "z"?
  505& 030346 6E000008     	bgt hincu1	* yes, continue
  506& 03034A 903C0020     	sub.b #$20,d0	* subtract character offset
  507& 03034E 4E75         	rts		* return
  508& 030350 B03C000A     hincu1:	cmp.b #lf,d0	* is it <LF>?
  509& 030354 66000006     	bne hincu3	* no, continue
  510& 030358 103C000D     	move.b #cr,d0	*  character is <CR>
  511& 03035C 4E75         hincu3:	rts		* return
  512&                     *
 Motorola M68000 Assembler                                           Page  11

  513&                     * HIN1HX: gets a hexadecimal character from network
  513+                      interface to D0
  514&                     *         uses HINCHR routine, return with carry se
  514+                     t if <CR>
  515&                     *         other characters ignored
  516&                     *
  517& 03035E 4EB900030334 hin1hx:	jsr hinchr	* get character
  518& 030364 B03C0030     	cmp.b #$30,d0	* is it less than "0"?
  519& 030368 6D00002E     	blt hin1e1	* yes, possible error
  520& 03036C B03C0039     	cmp.b #$39,d0	* is it greater than "9"?
  521& 030370 6E00000C     	bgt hin1e2	* yes, possible error
  522& 030374 903C0030     	sub.b #$30,d0	* subtract offset
  523& 030378 023C00FE     	and.b #$0fe,ccr		* clear carry
  524& 03037C 4E75         	rts		* return
  525& 03037E B03C0041     hin1e2:	cmp.b #$41,d0	* is it less than "A"?
  526& 030382 6D000022     	blt hin1er	* yes, error
  527& 030386 B03C0046     	cmp.b #$46,d0	* is it greater than "F"?
  528& 03038A 6E00001A     	bgt hin1er	* yes, error
  529& 03038E 903C0037     	sub.b #$41-10,d0	* subtract offset
  530& 030392 023C00FE     	and.b #$0fe,ccr		* clear carry
  531& 030396 4E75         	rts		* return
  532& 030398 B03C000D     hin1e1:	cmp.b #cr,d0	* is it <CR>?
  533& 03039C 66000008     	bne hin1er	* no, error
  534& 0303A0 003C0001     	or.b #$01,ccr		* set carry
  535& 0303A4 4E75         	rts		* return
  536& 0303A6 60B6         hin1er:	bra hin1hx	* try again
  537&                     *
  538&                     * HIN2HX: gets 2 hexadecimal characters into D0 fro
  538+                     m network
  539&                     *         All other registers preserved
  540&                     *         return with carry set if <CR>
  541&                     *
  542& 0303A8 4EB90003035E hin2hx:	jsr hin1hx	* get 1 hex char
  543& 0303AE 65000026     	bcs hin2h9	* if carry set, return
  544& 0303B2 2F01         	move.l d1,-(sp)		* save D1
  545& 0303B4 C03C000F     	and.b #$0f,d0	* clear ms nibble
  546& 0303B8 E918         	rol.b #4,d0	* swap nibbles
  547& 0303BA 2F00         	move.l d0,-(sp)		* save D0 (1st char)
  548& 0303BC 4EB90003035E 	jsr hin1hx	* get second hex char
  549& 0303C2 65000014     	bcs hin2h8	* return if carry set
  550& 0303C6 1200         	move.b d0,d1	* save ls nibble
  551& 0303C8 201F         	move.l (sp)+,d0		* restore D0
  552& 0303CA C23C000F     	and.b #$0f,d1	* clear ms nibble
  553& 0303CE D001         	add.b d1,d0	* combine nibbles
  554& 0303D0 221F         	move.l (sp)+,d1		* restore D1
  555& 0303D2 023C00FE     	and.b #$0fe,ccr		* clear carry
  556& 0303D6 4E75         hin2h9:	rts		*
  557& 0303D8 201F         hin2h8:	move.l (sp)+,d0		*
  558& 0303DA 201F         	move.l (sp)+,d0		* clean up stack
  559& 0303DC 003C0001     	or.b #$01,ccr		* set carry
  560& 0303E0 4E75         	rts		* return
  561&                     *
  562&                     * HIN4HX: gets 4 hex characters from network into D
  562+                     1
  563&                     *         uses HIN2HX routine, returns with carry s
  563+                     et if <CR>
  564&                     *
  565& 0303E2 4EB9000303A8 hin4hx:	jsr hin2hx	* get 2 chars
  566& 0303E8 65000012     	bcs hin4hr	* return if carry
 Motorola M68000 Assembler                                           Page  12

  567& 0303EC 1200         	move.b d0,d1	
  568& 0303EE E149         	lsl.w #8,d1	* shift to msb of d1
  569& 0303F0 4EB9000303A8 	jsr hin2hx	* get 2 chars
  570& 0303F6 65000004     	bcs hin4hr	* return if carry
  571& 0303FA 1200         	move.b d0,d1	* move to lsb
  572& 0303FC 4E75         hin4hr:	rts		* return
  573&                     *
  574&                     *
  575&                     *
  576&                     * DECPT: prints a 24 bit number in D2 as a signed d
  576+                     ecimal
  577&                     *
  578& 0303FE 05F5E100     decval: dc.l  100000000,10000000,100000,10000,1000,
  578+ 030402 00989680     100,10,1
  579& 03041E 2F09         decpt:  move.l  a1,-(a7)
  580& 030420 7207                 move.l #$07,d1	* count
  581& 030422 43F9000303FE         lea    decval,a1
  582& 030428 2619                 move.l (a1)+,d3	* compare value
  583& 03042A 103C002F     declp1: move.b #$2f,d0	* digit offset
  584& 03042E 5200         declp2: add.b #1,d0	* increment digit
  585& 030430 9483                 sub.l d3,d2	* subtract compare value
  586& 030432 64FA                 bcc declp2	* repeat if not negative
  587& 030434 D483                 add.l d3,d2	* overshoot, restore value
  588& 030436 10C0                 move.b d0,(a0)+
  589& 030438 2619                 move.l (a1)+,d3	* divide by 10
  590& 03043A 51C9FFEE             dbra d1,declp1	* decrement count and repeat
  590+                      if not zero
  591& 03043E 225F                 move.l (a7)+,a1
  592& 030440 4E75                 rts		* return
  593&                     
  594&                     *
  595&                     	end
   27                      *
   28         00070000     led     equ     $70000                 * General Pu
   28+                     rpose Reg. address.
   29         000000FF     clr     equ    #$ff                    * Clear all 
   29+                     H'ware Flags.
   30         00000001     grnoff  equ    #$01
   31         00000002     rroff   equ    #$02
   32         00000003     rgoff   equ    #$03                    * both led a
   32+                     nd read req off.
   33         00000004     ctpoff  equ    #$04
   34         00000008     evpoff  equ    #$08
   35         0000000C     cepoff  equ    #$0c
   36         000000FE     grnon   equ    #$fe                    * light led.
   37         000000FD     rron    equ    #$fd                    * read req t
   37+                     o fifo.
   38         000000FC     rgon    equ    #$fc                    * read req a
   38+                     nd green led on
   39         000000FB     ctpon   equ    #$fb                    * C Pks 
   40         000000F7     evpon   equ    #$f7                    * Normal eve
   40+                     nts 
   41         0003FDF8     stack   equ    #$03fdf8
   42         00020000     time    equ    #$020000                * Time stamp
   42+                      hours,mins,sec etc
   43         0002000C     m1      equ    #$02000c                * for curren
   43+                     tly displaying event.
   44         0002000D     m2      equ    #$02000d                
   45         0002000E     m3      equ    #$02000e
 Motorola M68000 Assembler                                           Page  13

   46         0002000F     m4      equ    #$02000f
   47         00020010     m5      equ    #$020010
   48         00020012     status  equ     $020012                *  Address o
   48+                     f Mode status register.
   49         00020013     stats2  equ     $020013                *  Address o
   49+                     f operational stats reg.
   50         00020014     mode    equ     $020014                * Address of
   50+                      mode flag.
   51         00020016     scbnds  equ     $020016                * Mem mirror
   51+                      reg addresses for filter
   52         00020018     dtbnds  equ     $020018                * registers 
   52+                     and control field.
   53         00020021     filctl  equ     $020021
   54         00020023     hwcnt   equ     $020023                * H'ware Mir
   54+                     ror Register.For Led,fifo etc
   55         00020080     dbadrw  equ    #$020080                *  address o
   55+                     f Database write addr ptr.
   56         00020084     dbadrr  equ    #$020084                *     "    "
   56+                          "     read   "    " .
   57         00020088     dbase   equ    #$020088                *  database 
   57+                     start address.
   58         0002FF00     dbfull  equ    #$02ff00                *  database 
   58+                     upper limit.
   59         0000001B     esc     equ    #$1b
   60         0000005B     lbk     equ    #$5b
   61         00000030     ascii0  equ    $30
   62         D693A400     hr      equ    #3600000000             * these 3 ar
   62+                     e constant used to
   63         23C34600     tmin    equ    #600000000              * convert he
   63+                     x timestamp to user
   64         03938700     min     equ    #60000000               * readable t
   64+                     ime.
   65         00000005     tstpak1 equ    #$5                     * Value of t
   65+                     he packets used for the
   66         1FEF6C41     tstpak2 equ    #$1fef6c41              * initialisa
   66+                     tion handshake between boards
   67                      
   68                      
   69                      * :*:*:*:*:*:*:*:*:*:*:*:*:*:*:*:*:*:*:*:*:*:*:*:*:
   69+                     *:*:*:*:*:*:*
   70                      *
   71                      * Program messages
   72                      *
   73  030442 0D           promms:	dc.b	cr,lf,'PDSEMB>'
   74  03044C 00000000     prommn:	ds.w	0                                *
   75  03044C 0D           iconms:	dc.b	cr,lf,' XX:Unknown Event   '
   76  030462 20                   dc.b       ' PA:Prcs. Activated '
   77  030476 20                   dc.b       ' PT:Prcs.Terminated '
   78  03048A 20                   dc.b       ' PD:Process Dead    '
   79  03049E 0D                   dc.b	cr,lf,' PB:Process Blocked '
   80  0304B4 20                   dc.b       ' PH:Process Halted  '
   81  0304C8 20                   dc.b       ' PR:Prcs. Restarted '
   82  0304DC 20                   dc.b       ' ..:Process Active  '
   83  0304F0 0D                   dc.b	cr,lf,' PS:Prcs. Suspended ' 
   84  030506 20                   dc.b       ' OF:Opening File    '
   85  03051A 20                   dc.b       ' CF:Closing File    '
   86  03052E 20                   dc.b       ' U1:User Defined #1 '
   87  030542 0D                   dc.b	cr,lf,' T_:Tx to process _ ' 
   88  030558 20                   dc.b       ' R_:Rx from prcs. _ '
 Motorola M68000 Assembler                                           Page  14

   89  03056C 20                   dc.b       ' W_:Synch. with _   '
   90  030580 20                   dc.b       ' U2:User Defined #2 '
   91  030594 00000000     iconmn:	ds.w	0
   92  030594 0D           helpms:	dc.b	cr,lf,'A : Event Line Monitoring  '
   93  0305B1 47                   dc.b       'G : gandalf/aux RS232 Prt '
   94  0305CB 51                   dc.b       'Q : Quit                   '
   95  0305E6 0D                   dc.b	cr,lf,'D : System Diagnostics     '
   96  030603 48                   dc.b       'H : System HALT           '
   97  03061D 52                   dc.b       'R : REBOOT - Clears Dbase  '
   98  030638 0D                   dc.b	cr,lf,'E : Event Log Monitoring   '
   99  030655 49                   dc.b       'I : Icon Help - Line Mntr '
  100  03066F 53                   dc.b       'S : Screen Lock/Unlock     '
  101  03068A 0D                   dc.b	cr,lf,'F : Hware Filtering addrs  '
  102  0306A7 50                   dc.b       'P : Print Screen          '
  103  0306C1 5A                   dc.b       'Z : Restart - Prsrvs Dbase '
  104  0306DC 00000000     helpmn:	ds.w	0
  105                      
  106                      
  107  0306DC 54           intro1: dc.b   'The POSIE Distributed System'
  108  0306F8 00000000     intro1n:ds.w   0
  109  0306F8 45           intro2: dc.b   'EDDE - Event Monitor'
  110  03070C 00000000     intro2n:ds.w   0
  111  03070C 56           intro3: dc.b   'Version  2.0'
  112  030718 00000000     intro3n:ds.w   0
  113  030718 20           intro4: dc.b   ' July  1990'
  114  030724 00000000     intro4n:ds.w   0
  115  030724 44           intro5: dc.b   'Department of Computer Science'
  116  030742 00000000     intro5n:ds.w   0
  117  030742 55           intro6: dc.b   'University of Edinburgh.'
  118  03075A 00000000     intro6n:ds.w   0
  119                      
  120  03075A 2A           lin1:   dc.b   '** Event Line Monitoring. **'
  121  030776 00000000     lin1n:  ds.w   0
  122  030776 6C           topl:   dc.b   'lqqqqqqwqqqwqqqqw'
  123  030787 71                   dc.b   'qqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqq
  123+ 030788 71           qqqqqqqqqqqqqqq'
  124  0307B9 77                   dc.b   'wqqqk'
  125  0307BE 00000000     topln:  ds.w   0
  126  0307BE 74           midl:   dc.b   'tqqqqqqnqqqnqqqqn'
  127  0307CF 71                   dc.b   'qqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqq
  127+ 0307D0 71           qqqqqqqqqqqqqqq'
  128  030801 6E                   dc.b   'nqqqu'
  129  030806 00000000     midln:  ds.w   0
  130  030806 6D           botl:   dc.b   'mqqqqqqvqqqvqqqqv'
  131  030817 71                   dc.b   'qqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqq
  131+ 030818 71           qqqqqqqqqqqqqqq'
  132  030849 76                   dc.b   'vqqqj'
  133  03084E 00000000     botln:  ds.w   0
  134  03084E 50           mtxt:   dc.b   'Pro.No Idt LtEv             Previou
  134+ 03084F 72           s Activites/Events'
  135  030883 20                   dc.b   '              BNo'
  136  030894 00000000     mtxtn:  ds.w   0
  137                      
  138  030894 2A           log1:   dc.b   '*** Event Log Monitoring ***'
  139  0308B0 00000000     log1n:  ds.w   0
  140  0308B0 6C           tlog:   dc.b   'lqqqqqqqqqqqqqqqqwqqqqqqwqqqw'
  141  0308CD 71                   dc.b   'qqqqqqwqqqwqqqqqqqqqqqqqqqqqqqqqqqq
  141+ 0308CE 71           qqqqqqqk'
  142  0308F8 00000000     tlogn:  ds.w   0
 Motorola M68000 Assembler                                           Page  15

  143  0308F8 74           mlog:   dc.b   'tqqqqqqqqqqqqqqqqnqqqqqqnqqqn'
  144  030915 71                   dc.b   'qqqqqqnqqqnqqqqqqqqqqqqqqqqqqqqqqqq
  144+ 030916 71           qqqqqqqu'
  145  030940 00000000     mlogn:  ds.w   0
  146  030940 6D           blog:   dc.b   'mqqqqqqqqqqqqqqqqvqqqqqqvqqqv'
  147  03095D 71                   dc.b   'qqqqqqvqqqvqqqqqqqqqqqqqqqqqqqqqqqq
  147+ 03095E 71           qqqqqqqj'
  148  030988 00000000     blogn:  ds.w   0
  149  030988 20           log1t:  dc.b   '  Time  Stamp     From  On    To   
  149+ 030989 20           On          '       
  150  0309B7 20                   dc.b   ' Process  Event'
  151  0309C6 00000000     log1tn: ds.w   0
  152  0309C6 20           log2t:  dc.b   ' Hr:Mn: Seconds  Procss Brd Procss 
  152+ 0309C7 48           Brd'
  153  0309EC 00000000     log2tn: ds.w   0
  154                      
  155  0309EC 20           ctxt1p: dc.b   ' Int. Sys. Brd.                    
  155+ 0309ED 49                 '
  156  030A15 43                   dc.b   'Ctrl Source Destn.   Data'
  157  030A2E 00000000     ctxt1n: ds.w   0
  158  030A2E 53           ctxt2p: dc.b   'Sequence Numbers                   
  158+ 030A2F 65                 '
  159  030A57 20                   dc.b   ' Fd   Addr   Addr    Field'
  160  030A72 00000000     ctxt2n: ds.w   0
  161                      
  162  030A72 4D           mstat:  dc.b   'Monitor Status : '
  163  030A84 00000000     mstatn: ds.w   0
  164  030A84 2A           hltp:   dc.b   '** HALTED **      '
  165  030A96 00000000     hltpn:  ds.w   0
  166  030A96 53           sclkp:  dc.b   'Screen Locked     '
  167  030AA8 00000000     sclkpn: ds.w   0
  168  030AA8 41           actp:   dc.b   'ACTIVE            '
  169  030ABA 00000000     actpn:  ds.w   0
  170  030ABA 50           prntp:  dc.b   'Printing Screen   '
  171  030ACC 00000000     prntpn  ds.w   0
  172  030ACC 57           wat:    dc.b   'WAITING for event '
  173  030ADE 00000000     watn:   ds.w   0
  174  030ADE 2A           err:    dc.b   '** SYSTEM ERROR **'
  175  030AF0 00000000     errn:   ds.w   0
  176  030AF0 2A           dbfp:   dc.b   '* Database FULL * '
  177  030B02 00000000     dbfpn:  ds.w   0
  178  030B02 55           ev0:    dc.b   'Unknown - failed to identify'
  179  030B1E 00000000     ev0n:   ds.w   0
  180  030B1E 50           ev1:    dc.b   'Process Activated           '
  181  030B3A 00000000     ev1n:   ds.w   0
  182  030B3A 50           ev2:    dc.b   'Process Terminated          '
  183  030B56 00000000     ev2n:   ds.w   0
  184  030B56 50           ev3:    dc.b   'Process Blocked             '
  185  030B72 00000000     ev3n:   ds.w   0
  186  030B72 50           ev4:    dc.b   'Process Dead                '
  187  030B8E 00000000     ev4n:   ds.w   0
  188  030B8E 50           ev5:    dc.b   'Process Halted              '
  189  030BAA 00000000     ev5n:   ds.w   0
  190  030BAA 50           ev6:    dc.b   'Process Suspended           '
  191  030BC6 00000000     ev6n    ds.w   0
  192  030BC6 50           ev7:    dc.b   'Process Restarted           '
  193  030BE2 00000000     ev7n    ds.w   0
  194  030BE2 50           ev8:    dc.b   'Process Active              '
  195  030BFE 00000000     ev8n:   ds.w   0
 Motorola M68000 Assembler                                           Page  16

  196  030BFE 50           ev9:    dc.b   'Process Transmitting        '
  197  030C1A 00000000     ev9n:   ds.w   0
  198  030C1A 50           ev10:   dc.b   'Process Receiving           '
  199  030C36 00000000     ev10n:  ds.w   0
  200  030C36 57           ev11:   dc.b   'Waiting for Synchronisation '
  201  030C52 00000000     ev11n:  ds.w   0
  202  030C52 4F           ev12:   dc.b   'Opening File                '
  203  030C6E 00000000     ev12n:  ds.w   0
  204  030C6E 43           ev13:   dc.b   'Closing File                '
  205  030C8A 00000000     ev13n:  ds.w   0
  206  030C8A 55           ev14:   dc.b   'User Defined #1             '
  207  030CA6 00000000     ev14n:  ds.w   0
  208  030CA6 55           ev15:   dc.b   'User Defined #2             '
  209  030CC2 00000000     ev15n:  ds.w   0
  210  030CC2 0D           lfinms: dc.b   cr,lf,'Load finished',cr,lf
  211  030CD4 00000000     lfinmn: ds.w   0
  212  030CD4 0D           labtms: dc.b   cr,lf,'Load aborted',cr,lf,bell
  213  030CE6 00000000     labtmn: ds.w   0
  214                      * agnp: dc.b   cr,lf
  215  030CE6 0D           diagnp: dc.b   cr,lf,'                      The POS
  215+ 030CE7 0A           IE Distributed Event Monitor.'
  216  030D22 0D                   dc.b   cr,lf
  217  030D24 0D           diag1:  dc.b   cr,lf,'                        A CS&
  217+ 030D25 0A           E 4th Year Honours Project'
  218                      
  219  030D5D 0D           diag2:  dc.b   cr,lf,'        This project develope
  219+ 030D5E 0A           d into a dual processor'
  220  030D93 20                   dc.b   ' board system aimed'
  221  030DA6 0D                   dc.b   cr,lf,'     at capturing interproces
  221+ 030DA7 0A           s communication '
  222  030DD5 70                   dc.b   'packets, interpreting them and'
  223  030DF3 0D                   dc.b   cr,lf,'     logging, in chronologica
  223+ 030DF4 0A           l order, the events which '
  224  030E2C 6F                   dc.b   'occur within a system.'
  225  030E42 0D                   dc.b   cr,lf
  226  030E44 0D                   dc.b   cr,lf,'        Current System Versio
  226+ 030E45 0A           n :  2.0'
  227  030E6B 0D                   dc.b   cr,lf
  228  030E6D 0D                   dc.b   cr,lf,'          The system is confi
  228+ 030E6E 0A           gured to interface with '
  229  030EA4 74                   dc.b   'the departmental'
  230  030EB4 0D                   dc.b   cr,lf,'          Centrenet network o
  230+ 030EB5 0A           perating in Burst '
  231  030EE5 50                   dc.b   'Protocol Mode.'
  232  030EF3 0D                   dc.b   cr,lf
  233  030EF5 0D                   dc.b   cr,lf,'          Board 1 :   Hardwar
  233+ 030EF6 0A           e - Centrenet Interface,'
  234  030F2C 20                   dc.b   ' Interpretation'
  235  030F3B 0D                   dc.b   cr,lf,'                             
  235+ 030F3C 0A               Processor and '
  236  030F6C 61                   dc.b   'associated buffering (FIFO).'
  237  030F88 0D                   dc.b   cr,lf,'                      Softwar
  237+ 030F89 0A           e - Currently a simple '
  238  030FBE 69                   dc.b   'interpretation routine'
  239  030FD4 0D                   dc.b   cr,lf,'                             
  239+ 030FD5 0A               which expects '
  240  031005 75                   dc.b   'useful info in first 2 packets'
  241  031023 0D                   dc.b   cr,lf,'          Board2  :   Hardwar
  241+ 031024 0A           e - Interprocess Buffer,'
 Motorola M68000 Assembler                                           Page  17

  242  03105A 20                   dc.b   ' Display Processor and'
  243  031070 0D                   dc.b   cr,lf,'                             
  243+ 031071 0A               Communications.'
  244  0310A2 0D                   dc.b   cr,lf,'                      Softwar
  244+ 0310A3 0A           e - Wyse Screen handling,'
  245  0310DA 20                   dc.b   ' Comms, CLI and'
  246  0310E9 0D                   dc.b   cr,lf,'                             
  246+ 0310EA 0A               Event database '
  247  03111B 62                   dc.b   'bookkeeping.'
  248  031128 00000000     diagnn: ds.w   0
  249  031128 20           gandp:  dc.b   ' ** Aux RS232 Link To The Gandalf *
  249+ 031129 2A           * '
  250  03114D 0D                   dc.b   cr,lf,'Control \ to return to Monito
  250+ 03114E 0A           r. '
  251  031170 00000000     gandpn: ds.w   0
  252                      
  253  031170 0D           cnt1p:  dc.b   cr,lf,'                        EDDE 
  253+ 031171 0A           - The POSIE event Monitor.'
  254  0311A9 0D                   dc.b   cr,lf,cr,lf
  255  0311AD 0D                   dc.b   cr,lf,'                 The monitor 
  255+ 0311AE 0A           is currently configured to display '
  256  0311F0 00000000     cnt1pn: ds.w   0
  257  0311F0 0D           eip:    dc.b   cr,lf
  258  0311F2 0D                   dc.b   cr,lf,'                             
  258+ 0311F3 0A            EVENT INFORMATION'
  259  031224 00000000     eipn:   ds.w   0
  260  031224 0D           cpp:    dc.b   cr,lf,cr,lf,'                       
  260+ 031225 0A                  '
  261  031246 43           cpps:   dc.b   'CENTRENET PACKETS'
  262  031258 00000000     cppn:   ds.w   0
  263  031258 0D           cnt2p:  dc.b   cr,lf
  264  03125A 0D                   dc.b   cr,lf,'                 and a change
  264+ 03125B 0A            from this mode of operation to'
  265  031298 0D                   dc.b   cr,lf,'                 displaying'
  266  0312B6 00000000     cnt2pn: ds.w   0
  267  0312B6 0D           cnt3p:  dc.b   cr,lf,cr,lf,'                 requir
  267+ 0312B7 0A           es the current database to be deleted !'
  268  0312F8 0D                   dc.b   cr,lf
  269  0312FA 0D                   dc.b   cr,lf,'                    C - to ch
  269+ 0312FB 0A           ange mode of operation or'
  270  031332 0D                   dc.b   cr,lf,'                    Q - to re
  270+ 031333 0A           turn.'
  271  031356 00000000     cnt3pn: ds.w   0
  272  031356 0D           cnt4p:  dc.b   cr,lf,cr,lf,'                 Previo
  272+ 031357 0A           us Request Still '
  273  031382 55                   dc.b   'Uncompleted.'
  274  03138E 0D                   dc.b   cr,lf,'                  Please QUIT
  274+ 03138F 0A            and Try This Option Again.'
  275  0313C8 00000000     cnt4pn: ds.w   0
  276                      
  277                      
  278                      *
  279                      *
  280                      
  281  0313C8 2F00         moveto: move.l d0,-(a7)                * move the c
  281+                     ursor on WYSE to position
  282  0313CA 103C001B             move.b esc,d0                  * x,y on the
  282+                      screen. 2 ascii coded values
  283  0313CE 4EB90003008E         jsr    outch                   * required e
 Motorola M68000 Assembler                                           Page  18

  283+                     .g. 5 = $3035 and 17 = $3137
  284  0313D4 103C005B             move.b lbk,d0
  285  0313D8 4EB90003008E         jsr    outch
  286  0313DE E15A                 rol.w  #8,d2
  287  0313E0 1002                 move.b d2,d0
  288  0313E2 4EB90003008E         jsr    outch
  289  0313E8 E04A                 lsr.w  #8,d2
  290  0313EA 1002                 move.b d2,d0
  291  0313EC 4EB90003008E         jsr    outch
  292  0313F2 103C003B             move.b #59,d0       *  ;
  293  0313F6 4EB90003008E         jsr    outch
  294  0313FC E15B                 rol.w  #8,d3
  295  0313FE 1003                 move.b d3,d0
  296  031400 4EB90003008E         jsr    outch
  297  031406 E04B                 lsr.w  #8,d3
  298  031408 1003                 move.b d3,d0
  299  03140A 4EB90003008E         jsr    outch
  300  031410 103C0048             move.b #72,d0       *  H
  301  031414 4EB90003008E         jsr    outch
  302  03141A 201F                 move.l (a7)+,d0
  303  03141C 4E75                 rts
  304                      
  305  03141E 48E77008     upst:   movem.l d1/d2/d3/a4,-(a7)      * Update mon
  305+                     itor status and display
  306  031422 343C3033             move.w #$3033,d2               * current st
  306+                     atus.
  307  031426 363C3631             move.w #$3631,d3
  308  03142A 4EB9000313C8         jsr    moveto
  309  031430 083900000002         btst   #0,stats2
  310  031438 67000014             beq    ht
  311  03143C 49F900030ADE         lea    err,a4
  312  031442 7212                 move.l #errn-err,d1            * Error stat
  312+                     us
  313  031444 4EB9000300D2         jsr    pdata
  314  03144A 600000C4             bra    upe
  315  03144E 083900020002 ht:     btst   #2,stats2
  316  031456 67000014             beq    ptn
  317  03145A 49F900030A84         lea    hltp,a4
  318  031460 7212                 move.l #hltpn-hltp,d1          * Halt statu
  318+                     s
  319  031462 4EB9000300D2         jsr    pdata
  320  031468 600000A6             bra    upe
  321  03146C 083900040002 ptn:    btst   #4,stats2
  322  031474 67000014             beq    nht
  323  031478 49F900030ABA         lea    prntp,a4
  324  03147E 7212                 move.l #prntpn-prntp,d1        * Printing s
  324+                     creen status
  325  031480 4EB9000300D2         jsr    pdata
  326  031486 60000088             bra    upe
  327  03148A 083900010002 nht:    btst   #1,stats2
  328  031492 67000014             beq    nsl
  329  031496 49F900030A96         lea    sclkp,a4
  330  03149C 7212                 move.l #sclkpn-sclkp,d1        * Screen loc
  330+                     k status
  331  03149E 4EB9000300D2         jsr    pdata
  332  0314A4 6000006A             bra    upe
  333  0314A8 083900060002 nsl:    btst   #6,stats2               * Warning wh
  333+        0013         en database memory 
  334  0314B0 67000014             beq    ac0                     * allocation
 Motorola M68000 Assembler                                           Page  19

  334+                      used up.
  335  0314B4 49F900030AF0         lea    dbfp,a4
  336  0314BA 7212                 move.l #dbfpn-dbfp,d1
  337  0314BC 4EB9000300D2         jsr    pdata
  338  0314C2 6000004C             bra    upe
  339  0314C6 083900030002 ac0:    btst   #3,stats2
  340  0314CE 67000014             beq    ac1
  341  0314D2 49F900030ACC         lea    wat,a4
  342  0314D8 7212                 move.l #watn-wat,d1            * Wait for e
  342+                     vent i.e. all entries
  343  0314DA 4EB9000300D2         jsr    pdata                   * in the dat
  343+                     a base have been displayed.
  344  0314E0 6000002E             bra    upe
  345  0314E4 083900050002 ac1:    btst   #5,stats2
  346  0314EC 67000014             beq    ac2
  347  0314F0 49F900031246         lea    cpps,a4                 * Displaying
  347+                      centrenet packets, i.e
  348  0314F6 7212                 move.l #cppn-cpps,d1           * no event/i
  348+                     nformation is being extracted
  349  0314F8 4EB9000300D2         jsr    pdata                   * from the I
  349+                     PC messages.
  350  0314FE 60000010             bra    upe
  351  031502 49F900030AA8 ac2:    lea    actp,a4
  352  031508 7212                 move.l #actpn-actp,d1          * Monitor ac
  352+                     tive status
  353  03150A 4EB9000300D2         jsr    pdata
  354  031510 4CDF100E     upe     movem.l (a7)+,d1/d2/d3/a4
  355  031514 4E75                 rts
  356                      
  357                      *********** Interupt Servers ***********
  358                      
  359  031516 48E780C0     ffserv: movem.l d0/a0/a1,-(a7)         * Continual 
  359+                     background process to
  360  03151A 103900020023         move.b hwcnt,d0                * read the F
  360+                     ifo. It is in fact an
  361  031520 803C0002             or.b   rroff,d0                * service ro
  361+                     utine which places the
  362  031524 13C000020023         move.b d0,hwcnt                * incoming p
  362+                     acket in the next free
  363  03152A 13C000070000         move.b d0,led
  364  031530 303900060000         move.w fifo,d0                 * address in
  364+                      the database.
  365  031536 227C00020080         move.l dbadrw,a1
  366  03153C 2051                 move.l (a1),a0
  367  03153E 30C0                 move.w d0,(a0)+
  368  031540 2288                 move.l a0,(a1)
  369  031542 B1FC0002FF00         cmp.l  dbfull,a0               * Check for 
  369+                     db being full
  370  031548 66000014             bne    notful
  371  03154C 0A3900400002         eori.b #$40,stats2             * set db ful
  371+        0013         l flag
  372  031554 4EB90003141E         jsr    upst
  373  03155A 60000018             bra    ffexit
  374  03155E 103900020023 notful: move.b hwcnt,d0
  375  031564 C03C00FD             and.b  rron,d0
  376  031568 13C000020023         move.b d0,hwcnt
  377  03156E 13C000070000         move.b d0,led
  378  031574 4CDF0301     ffexit: movem.l (a7)+,d0/a0/a1
  379  031578 4E73                 rte
 Motorola M68000 Assembler                                           Page  20

  380                      
  381  03157A 48E78080     acksrv: movem.l a0/d0,-(a7)            * Service ro
  381+                     utine to complete handshake
  382  03157E 103900020023         move.b hwcnt,d0                * with inter
  382+                     pretation processor.
  383  031584 803C000C             or.b   cepoff,d0               * if dbfull 
  383+                     dont make read req.
  384  031588 13C000070000         move.b d0,led
  385  03158E 13C000020023         move.b d0,hwcnt
  386  031594 303900020014         move.w mode,d0
  387  03159A B03C0000             cmp.b  #0,d0
  388  03159E 67000012             beq    acont
  389  0315A2 0A3900200002         eori.b #$20,stats2
  390  0315AA 33FC00000002         move.w #0,mode
  391  0315B2 4CDF0101     acont:  movem.l (a7)+,a0/d0
  392  0315B6 4E73                 rte
  393                      
  394                      ****************************************
  395                      
  396  0315B8 103900020023 clrled: move.b hwcnt,d0                  * LED off
  397  0315BE 803C0001             or.b   grnoff,d0
  398  0315C2 13C000070000         move.b d0,led
  399  0315C8 13C000020023         move.b d0,hwcnt
  400  0315CE 4E75                 rts
  401                      *
  402  0315D0 103900020023 grnled: move.b hwcnt,d0                * LED on
  403  0315D6 C03C00FE             and.b  grnon,d0
  404  0315DA 13C000070000         move.b d0,led
  405  0315E0 13C000020023         move.b d0,hwcnt
  406  0315E6 4E75                 rts
  407                      
  408  0315E8 48E73000     home:   movem.l d2/d3,-(a7)            * move curso
  408+                     r to position 1,1
  409  0315EC 343C0031             move.w #ascii0+1,d2
  410  0315F0 363C0031             move.w #ascii0+1,d3
  411  0315F4 4EB9000313C8         jsr    moveto
  412  0315FA 4CDF000C             movem.l (a7)+,d2/d3
  413  0315FE 4E75                 rts
  414                      
  415  031600 2F00         wind:   move.l d0,-(a7)                * Building b
  415+                     lock routine to define
  416  031602 103C001B             move.b esc,d0                  * windows.
  417  031606 4EB90003008E         jsr    outch
  418  03160C 103C005B             move.b lbk,d0
  419  031610 4EB90003008E         jsr    outch
  420  031616 E15A                 rol.w  #8,d2
  421  031618 1002                 move.b d2,d0
  422  03161A 4EB90003008E         jsr    outch
  423  031620 E04A                 lsr.w  #8,d2
  424  031622 1002                 move.b d2,d0
  425  031624 4EB90003008E         jsr    outch
  426  03162A 103C003B             move.b #59,d0
  427  03162E 4EB90003008E         jsr    outch
  428  031634 E15B                 rol.w  #8,d3
  429  031636 1003                 move.b d3,d0
  430  031638 4EB90003008E         jsr    outch
  431  03163E E04B                 lsr.w  #8,d3
  432  031640 1003                 move.b d3,d0
  433  031642 4EB90003008E         jsr    outch
 Motorola M68000 Assembler                                           Page  21

  434  031648 103C0072             move.b #114,d0
  435  03164C 4EB90003008E         jsr    outch
  436  031652 201F                 move.l (a7)+,d0
  437  031654 4E75                 rts
  438                      
  439                      
  440  031656 48E73000     windf2: movem.l d2/d3,-(a7)            * defines si
  440+                     ze of window, from line 1-22.
  441  03165A 343C3031             move.w  #$3031,d2
  442  03165E 363C3232             move.w  #$3232,d3
  443  031662 4EB900031600         jsr     wind
  444  031668 4CDF000C             movem.l (a7)+,d2/d3
  445  03166C 4E75                 rts
  446                      
  447  03166E 48E73000     windf:  movem.l d2/d3,-(a7)            * defines th
  447+                     e full screen window.
  448  031672 343C3031             move.w  #$3031,d2
  449  031676 363C3234             move.w  #$3234,d3
  450  03167A 4EB900031600         jsr     wind
  451  031680 4CDF000C             movem.l (a7)+,d2/d3
  452  031684 4E75                 rts
  453                      
  454  031686 2F00         cls:    move.l d0,-(a7)                * clear full
  454+                      screen routine.
  455  031688 4EB9000315E8         jsr    home
  456  03168E 103C001B             move.b esc,d0
  457  031692 4EB90003008E         jsr    outch
  458  031698 103C005B             move.b lbk,d0
  459  03169C 4EB90003008E         jsr    outch
  460  0316A2 103C0032             move.b #ascii0+2,d0       *  2
  461  0316A6 4EB90003008E         jsr    outch
  462  0316AC 103C0034             move.b #ascii0+4,d0       *  4
  463  0316B0 4EB90003008E         jsr    outch
  464  0316B6 103C004C             move.b #76,d0       *  L
  465  0316BA 4EB90003008E         jsr    outch
  466  0316C0 201F                 move.l (a7)+,d0
  467  0316C2 4E75                 rts
  468                      
  469  0316C4 2F00         smthsc: move.l d0,-(a7)                * enable/dis
  469+                     able Smooth scroll
  470  0316C6 103C001B             move.b esc,d0                  *     00/04 
  470+                     in d2 as param.
  471  0316CA 4EB90003008E         jsr    outch
  472  0316D0 103C005B             move.b lbk,d0
  473  0316D4 4EB90003008E         jsr    outch
  474  0316DA 103C003F             move.b #63,d0
  475  0316DE 4EB90003008E         jsr    outch
  476  0316E4 103C0034             move.b #$34,d0
  477  0316E8 4EB90003008E         jsr    outch
  478  0316EE 103C0068             move.b #104,d0
  479  0316F2 D002                 add.b  d2,d0
  480  0316F4 4EB90003008E         jsr    outch
  481  0316FA 201F                 move.l (a7)+,d0
  482  0316FC 4E75                 rts
  483                      
  484  0316FE 2F00         attr:   move.l  d0,-(a7)               * To allow c
  484+                     haracter attributes
  485  031700 103C001B             move.b  esc,d0                 * for the te
  485+                     xt which follows.
 Motorola M68000 Assembler                                           Page  22

  486  031704 4EB90003008E         jsr     outch                  * Attribute 
  486+                     value must be d2.
  487  03170A 103C005B             move.b  lbk,d0
  488  03170E 4EB90003008E         jsr     outch
  489  031714 E15A                 rol.w   #8,d2
  490  031716 1002                 move.b  d2,d0
  491  031718 4EB90003008E         jsr     outch
  492  03171E E04A                 lsr.w   #8,d2
  493  031720 1002                 move.b  d2,d0
  494  031722 4EB90003008E         jsr     outch
  495  031728 103C0070             move.b  #112,d0
  496  03172C 4EB90003008E         jsr     outch
  497  031732 201F                 move.l  (a7)+,d0
  498  031734 4E75                 rts
  499                      
  500  031736 2F02         clratt: move.l  d2,-(a7)               * Clear text
  500+                      attributes.
  501  031738 343C0000             move.w  #$0,d2
  502  03173C 4EB9000316FE         jsr     attr
  503  031742 241F                 move.l  (a7)+,d2
  504  031744 4E75                 rts
  505                      
  506                      
  507  031746 48E77008     prtstt: movem.l d1/d2/d3/a4,-(a7)      * Print Moni
  507+                     tor status prompt
  508  03174A 343C3033             move.w #$3033,d2
  509  03174E 363C3434             move.w #$3434,d3
  510  031752 4EB9000313C8         jsr    moveto
  511  031758 49F900030A72         lea    mstat,a4
  512  03175E 7212                 move.l #mstatn-mstat,d1
  513  031760 4EB9000300D2         jsr    pdata
  514  031766 4CDF100E             movem.l (a7)+,d1/d2/d3/a4
  515  03176A 4E75                 rts
  516                      
  517  03176C 4EB90003166E intscn: jsr    windf                   * Draws the 
  517+                     Introduction screen.
  518  031772 4EB900031686         jsr    cls
  519  031778 49F9000306DC         lea    intro1,a4
  520  03177E 721C                 move.l #intro1n-intro1,d1
  521  031780 343C0034             move.w #ascii0+4,d2
  522  031784 363C3235             move.w #$3235,d3
  523  031788 4EB9000313C8         jsr    moveto
  524  03178E 343C3038             move.w #$3038,d2
  525  031792 4EB9000316FE         jsr    attr
  526  031798 4EB9000300D2         jsr    pdata
  527  03179E 4EB900031736         jsr    clratt
  528  0317A4 49F9000306F8         lea    intro2,a4
  529  0317AA 7214                 move.l #intro2n-intro2,d1
  530  0317AC 343C0036             move.w #ascii0+6,d2
  531  0317B0 363C3239             move.w #$3239,d3           *  32
  532  0317B4 4EB9000313C8         jsr    moveto
  533  0317BA 343C3130             move.w #$3130,d2
  534  0317BE 4EB9000316FE         jsr    attr
  535  0317C4 4EB9000300D2         jsr    pdata
  536  0317CA 4EB900031736         jsr    clratt
  537  0317D0 49F90003070C         lea    intro3,a4
  538  0317D6 720C                 move.l #intro3n-intro3,d1
  539  0317D8 343C3039             move.w #$3039,d2
  540  0317DC 363C3334             move.w #$3334,d3
 Motorola M68000 Assembler                                           Page  23

  541  0317E0 4EB9000313C8         jsr    moveto
  542  0317E6 4EB9000300D2         jsr    pdata
  543  0317EC 49F900030718         lea    intro4,a4
  544  0317F2 720C                 move.l #intro4n-intro4,d1
  545  0317F4 343C3130             move.w #$3130,d2
  546  0317F8 363C3335             move.w #$3335,d3
  547  0317FC 4EB9000313C8         jsr    moveto
  548  031802 4EB9000300D2         jsr    pdata
  549  031808 49F900030724         lea    intro5,a4
  550  03180E 721E                 move.l #intro5n-intro5,d1
  551  031810 343C3133             move.w #$3133,d2
  552  031814 363C3235             move.w #$3235,d3
  553  031818 4EB9000313C8         jsr    moveto
  554  03181E 4EB9000300D2         jsr    pdata
  555  031824 49F900030742         lea    intro6,a4
  556  03182A 7218                 move.l #intro6n-intro6,d1
  557  03182C 343C3135             move.w #$3135,d2
  558  031830 363C3238             move.w #$3238,d3
  559  031834 4EB9000313C8         jsr    moveto
  560  03183A 4EB9000300D2         jsr    pdata
  561  031840 4EB9000315E8         jsr    home 
  562  031846 4EB90003010C         jsr    pbell
  563  03184C 4E75                 rts
  564                      
  565  03184E 2F00         grmode: move.l d0,-(a7)                * Put WYSE i
  565+                     n Graphics mode.
  566  031850 103C001B             move.b esc,d0
  567  031854 4EB90003008E         jsr    outch
  568  03185A 303C0028             move   #40,d0     *   (
  569  03185E 4EB90003008E         jsr    outch
  570  031864 303C0030             move   #ascii0,d0
  571  031868 4EB90003008E         jsr    outch
  572  03186E 201F                 move.l (a7)+,d0
  573  031870 4E75                 rts
  574                      
  575  031872 2F00         nmode:  move.l d0,-(a7)                * Returns WY
  575+                     SE to Normal Font mode.
  576  031874 103C001B             move.b esc,d0
  577  031878 4EB90003008E         jsr    outch
  578  03187E 303C0028             move   #40,d0
  579  031882 4EB90003008E         jsr    outch
  580  031888 103C0042             move.b #66,d0    *    B
  581  03188C 4EB90003008E         jsr    outch
  582  031892 201F                 move.l (a7)+,d0
  583  031894 4E75                 rts
  584                      
  585  031896 2F00         movec:  move.l d0,-(a7)                * Cursor to 
  585+                     column stored in ascii code
  586  031898 103C001B             move.b esc,d0                  * with tens 
  586+                     in d2 and units in d3.
  587  03189C 4EB90003008E         jsr    outch
  588  0318A2 103C005B             move.b lbk,d0
  589  0318A6 4EB90003008E         jsr    outch
  590  0318AC 1002                 move.b d2,d0
  591  0318AE 4EB90003008E         jsr    outch
  592  0318B4 1003                 move.b d3,d0
  593  0318B6 4EB90003008E         jsr    outch
  594  0318BC 103C0047             move.b #71,d0    *   G
  595  0318C0 4EB90003008E         jsr    outch
 Motorola M68000 Assembler                                           Page  24

  596  0318C6 201F                 move.l (a7)+,d0
  597  0318C8 4E75                 rts
  598                      
  599                      ***************************************************
  599+                     *********
  600                      **      Routines to display the Event Line Monitori
  600+                     ng Screen
  601                      
  602  0318CA 48E7B000     ptxtln: movem.l d0/d2/d3,-(a7)         * draws grap
  602+                     hics chars for the text
  603  0318CE 143C0030             move.b #$30,d2                 * lines in t
  603+                     he graphics window.
  604  0318D2 163C0035             move.b #$35,d3
  605  0318D6 4EB900031896         jsr    movec
  606  0318DC 103C0078             move.b #120,d0       *  x
  607  0318E0 4EB90003008E         jsr    outch
  608  0318E6 143C0031             move.b #$31,d2
  609  0318EA 163C0032             move.b #$32,d3
  610  0318EE 4EB900031896         jsr    movec
  611  0318F4 4EB90003008E         jsr    outch
  612  0318FA 163C0036             move.b #$36,d3
  613  0318FE 4EB900031896         jsr    movec
  614  031904 4EB90003008E         jsr    outch
  615  03190A 143C0032             move.b #$32,d2
  616  03190E 163C0031             move.b #$31,d3
  617  031912 4EB900031896         jsr    movec
  618  031918 4EB90003008E         jsr    outch
  619  03191E 143C0037             move.b #$37,d2
  620  031922 163C0032             move.b #$32,d3
  621  031926 4EB900031896         jsr    movec
  622  03192C 4EB90003008E         jsr    outch
  623  031932 163C0036             move.b #$36,d3
  624  031936 4EB900031896         jsr    movec
  625  03193C 4EB90003008E         jsr    outch
  626  031942 4CDF000D             movem.l (a7)+,d0/d2/d3
  627  031946 4E75                 rts
  628                      
  629  031948 49F90003084E ttxtln: lea    mtxt,a4                 * Prints hea
  629+                     dings for columns in 
  630  03194E 7246                 move.l #mtxtn-mtxt,d1          * the graphi
  630+                     cs window.
  631  031950 343C3035             move.w #$3035,d2
  632  031954 363C3036             move.w #$3036,d3
  633  031958 4EB9000313C8         jsr    moveto
  634  03195E 4EB900031872         jsr    nmode
  635  031964 4EB9000300D2         jsr    pdata
  636  03196A 4EB90003184E         jsr    grmode
  637  031970 4EB9000318CA         jsr    ptxtln
  638  031976 4E75                 rts
  639                      
  640                      
  641  031978 4EB900031656 linsc1: jsr    windf2                  * Draws the 
  641+                     top half of the
  642  03197E 4EB900031686         jsr    cls                     * Graphics w
  642+                     indow 
  643  031984 49F90003075A         lea    lin1,a4
  644  03198A 721C                 move.l #lin1n-lin1,d1
  645  03198C 343C0032             move.w #ascii0+2,d2
  646  031990 363C3235             move.w #$3235,d3
 Motorola M68000 Assembler                                           Page  25

  647  031994 4EB9000313C8         jsr    moveto
  648  03199A 343C3038             move.w #$3038,d2
  649  03199E 4EB9000316FE         jsr    attr
  650  0319A4 4EB9000300D2         jsr    pdata
  651  0319AA 4EB900031736         jsr    clratt
  652  0319B0 4EB900031746         jsr    prtstt
  653  0319B6 49F900030776         lea    topl,a4
  654  0319BC 7248                 move.l #topln-topl,d1
  655  0319BE 343C0034             move.w #ascii0+4,d2
  656  0319C2 363C0035             move.w #ascii0+5,d3
  657  0319C6 4EB9000313C8         jsr    moveto
  658  0319CC 4EB90003184E         jsr    grmode
  659  0319D2 4EB9000300D2         jsr    pdata
  660  0319D8 343C0035             move.w #ascii0+5,d2
  661  0319DC 363C0031             move.w #ascii0+1,d3
  662  0319E0 4EB9000313C8         jsr    moveto
  663  0319E6 4EB900031948         jsr    ttxtln
  664  0319EC 49F9000307BE         lea    midl,a4
  665  0319F2 7248                 move.l #midln-midl,d1
  666  0319F4 343C0036             move.w #ascii0+6,d2
  667  0319F8 363C0035             move.w #ascii0+5,d3
  668  0319FC 4EB9000313C8         jsr    moveto
  669  031A02 4EB9000300D2         jsr    pdata
  670  031A08 4E75                 rts
  671                      
  672  031A0A 2F00         nxtln:  move.l d0,-(a7)                * moves the 
  672+                     cursor down one line.
  673  031A0C 103C001B             move.b esc,d0
  674  031A10 4EB90003008E         jsr    outch
  675  031A16 103C005B             move.b lbk,d0
  676  031A1A 4EB90003008E         jsr    outch
  677  031A20 103C0045             move.b #69,d0
  678  031A24 4EB90003008E         jsr    outch
  679  031A2A 201F                 move.l (a7)+,d0
  680  031A2C 4E75                 rts
  681                      
  682                      
  683  031A2E 303C000B     linsc2: move.w #11,d0                  * Draws the 
  683+                     second half the 
  684  031A32 6000000E             bra    tent                    * graphics d
  684+                     isplay window.
  685  031A36 4EB900031A0A more:   jsr    nxtln
  686  031A3C 4EB9000318CA         jsr    ptxtln
  687  031A42 51C8FFF2     tent:   dbra   d0,more
  688  031A46 49F900030806         lea    botl,a4
  689  031A4C 7248                 move.l #botln-botl,d1
  690  031A4E 343C3138             move.w #$3138,d2
  691  031A52 363C0035             move.w #ascii0+5,d3
  692  031A56 4EB9000313C8         jsr    moveto
  693  031A5C 4EB9000300D2         jsr    pdata
  694  031A62 4EB900031872         jsr    nmode
  695  031A68 4E75                 rts
  696                      
  697  031A6A 48E73000     wind1a: movem.l d2/d3,-(a7)            * Sets up th
  697+                     e graphics display
  698  031A6E 343C3038             move.w  #$3038,d2              * Window
  699  031A72 363C3137             move.w  #$3137,d3
  700  031A76 4EB900031600         jsr     wind
  701  031A7C 4CDF000C             movem.l (a7)+,d2/d3
 Motorola M68000 Assembler                                           Page  26

  702  031A80 4E75                 rts
  703                      
  704  031A82 48E73000     wind1:  movem.l d2/d3,-(a7)
  705  031A86 343C3037             move.w  #$3037,d2
  706  031A8A 363C3137             move.w  #$3137,d3
  707  031A8E 4EB900031600         jsr     wind
  708  031A94 4CDF000C             movem.l (a7)+,d2/d3
  709  031A98 4E75                 rts
  710                      
  711  031A9A 48E73000     wind2a: movem.l d2/d3,-(a7)
  712  031A9E 343C3139             move.w  #$3139,d2
  713  031AA2 363C3234             move.w  #$3234,d3
  714  031AA6 4EB900031600         jsr     wind
  715  031AAC 4CDF000C             movem.l (a7)+,d2/d3
  716  031AB0 4E75                 rts
  717                      
  718  031AB2 48E73000     wind2:  movem.l d2/d3,-(a7)
  719  031AB6 343C3139             move.w  #$3139,d2
  720  031ABA 363C3232             move.w  #$3232,d3
  721  031ABE 4EB900031600         jsr     wind
  722  031AC4 4CDF000C             movem.l (a7)+,d2/d3
  723  031AC8 4E75                 rts
  724                      
  725  031ACA 48E73000     wind3:  movem.l d2/d3,-(a7)
  726  031ACE 343C3233             move.w  #$3233,d2
  727  031AD2 363C3234             move.w  #$3234,d3
  728  031AD6 4EB900031600         jsr     wind
  729  031ADC 4CDF000C             movem.l (a7)+,d2/d3
  730  031AE0 4E75                 rts
  731                      
  732                      *
  733                      * :*:*:*:*:*:*:*:*:*:*:*:*:*:*:*:*:*:*:*:*:*:*:*:*:
  733+                     *:*:*:*:*:*:*
  734                      *
  735                      * Initialisation routines
  736                      *
  737                      * :*:*:*:*:*:*:*:*:*:*:*:*:*:*:*:*:*:*:*:*:*:*:*:*:
  737+                     *:*:*:*:*:*:*
  738                      *
  739                      *
  740                      * 68681 initialization : 9600 baud,8 data bits,1 st
  740+                     op bit,
  741                      * no parity check and for interupt interface with p
  741+                     rocessor.
  742                      *
  743  031AE2 48E7C0C0     duart:	movem.l d0/d1/a0/a1,-(a7)   * save registers
  744  031AE6 13FC00000004 	move.b	#noints,imr	* clear all interrupt enables
  745  031AEE 207C00031B2E 	move.l	#tablx,a0   * get init parameters
  746  031AF4 203C00000015 	move.l	#lengtx,d0  * get number of parameters
  747                      *
  748  031AFA 60000008     	bra sk0inix        * do loop test
  749  031AFE 2258         lp0inix:	move.l (a0)+,a1   * get register address
  750  031B00 2218         	move.l (a0)+,d1     * parity etc.
  751                      *
  752  031B02 1281         	move.b	d1,(a1)   	* put command
  753  031B04 51C8FFF8     sk0inix:	dbra	d0,lp0inix * loop test
  754                      *
  755                      *
  756                      *
 Motorola M68000 Assembler                                           Page  27

  757  031B08 13FC00040004      move.b    #ten,cmda
  758  031B10 13FC00040004      move.b    #ten,cmdb
  759  031B18 13FC00010004      move.b    #ren,cmda
  760  031B20 13FC00010004      move.b    #ren,cmdb
  761  031B28 4CDF0303          movem.l   (a7)+,d0/d1/a0/a1_*restore registers
  762  031B2C 4E75         	rts
  763                      *
  764                      * set mode of channel A - 7 bits, no parity, 1 stop
  764+                      bit 9600 baud
  765                      *  no hsking
  766                      *
  767  031B2E 00040005     tablx:dc.l   cmda,point1
  768  031B36 00040001          dc.l   modea,norrts+rirdy+cerr+nopar+bits8
  769  031B3E 00040001          dc.l   modea,norop+notrts+nocts+stop1
  770                      *
  771                      * Set mode of Channel B - 7 bits, no parity, 1 stop
  771+                      bit, 9600 baud
  772                      * no hsking
  773                      *
  774  031B46 00040015          dc.l   cmdb,point1
  775  031B4E 00040011          dc.l   modeb,norrts+rirdy+cerr+nopar+bits8
  776  031B56 00040011          dc.l   modeb,norop+notrts+nocts+stop1
  777                      *
  778                      * set output port config register
  779                      *
  780  031B5E 0004001B          dc.l   opcr,allout
  781                      *
  782                      * Reset and enable channel A
  783                      *
  784  031B66 00040005          dc.l    cmda,rstrx
  785  031B6E 00040005          dc.l    cmda,rsttx_* reset transmitter
  786  031B76 00040005          dc.l    cmda,rsterr
  787  031B7E 00040005          dc.l    cmda,rstint
  788  031B86 00040005          dc.l    cmda,brkoff+tdis+ren
  789  031B8E 00040003          dc.l    clka,b9600
  790                      *
  791                      * Reset and enable channel b
  792                      *
  793  031B96 00040015          dc.l   cmdb,rstrx
  794  031B9E 00040015          dc.l   cmdb,rsttx
  795  031BA6 00040015          dc.l   cmdb,rsterr
  796  031BAE 00040015          dc.l   cmdb,rstint
  797  031BB6 00040015          dc.l   cmdb,brkoff+tdis+ren
  798  031BBE 00040013          dc.l   clkb,b9600
  799                      *
  800                      * Setup output pins
  801                      *
  802  031BC6 0004000B          dc.l   imr,$02 
  803  031BCE 0004001D          dc.l   bitset,$ff
  804         00000015     lengtx equ   (*-tablx)/8
  805  031BD6 4E75              rts
  806                      
  807                      * :*:*:*:*:*:*:*:*:*:*:*:*:*:*:*:*:*:*:*:*:*:*:*:*:
  807+                     *:*:*:*:*:*:*
  808                      *
  809                      *
  810                      * 68681 initialization : 9600 baud,8 data bits,1 st
  810+                     op bit,
  811                      * no parity checkand for a polling interface with p
 Motorola M68000 Assembler                                           Page  28

  811+                     rocessor
  812                      *
  813  031BD8 48E7C0C0     redrt:	movem.l d0/d1/a0/a1,-(a7)   * save registers
  814  031BDC 13FC00000004 	move.b	#noints,imr	* clear all interrupt enables
  815  031BE4 207C00031C24 	move.l	#table,a0   * get init parameters
  816  031BEA 203C00000015 	move.l	#length,d0  * get number of parameters
  817                      *
  818  031BF0 60000008     	bra sk0init        * do loop test
  819  031BF4 2258         lp0init:	move.l (a0)+,a1   * get register address
  820  031BF6 2218         	move.l (a0)+,d1     * parity etc.
  821                      *
  822  031BF8 1281         	move.b	d1,(a1)   	* put command
  823  031BFA 51C8FFF8     sk0init:	dbra	d0,lp0init * loop test
  824                      *
  825                      *
  826                      *
  827  031BFE 13FC00040004      move.b    #ten,cmda
  828  031C06 13FC00040004      move.b    #ten,cmdb
  829  031C0E 13FC00010004      move.b    #ren,cmda
  830  031C16 13FC00010004      move.b    #ren,cmdb
  831  031C1E 4CDF0303          movem.l   (a7)+,d0/d1/a0/a1_*restore registers
  832  031C22 4E75         	rts
  833                      *
  834                      * set mode of channel A - 7 bits, no parity, 1 stop
  834+                      bit 9600 baud
  835                      *  no hsking
  836                      *
  837  031C24 0004000B     table:dc.l   imr,noints
  838  031C2C 00040005          dc.l   cmda,point1
  839  031C34 00040001          dc.l   modea,norrts+rirdy+cerr+nopar+bits8
  840  031C3C 00040001          dc.l   modea,norop+notrts+nocts+stop1
  841                      *
  842                      * Set mode of Channel B - 7 bits, no parity, 1 stop
  842+                      bit, 9600 baud
  843                      * no hsking
  844                      *
  845  031C44 00040015          dc.l   cmdb,point1
  846  031C4C 00040011          dc.l   modeb,norrts+rirdy+cerr+nopar+bits8
  847  031C54 00040011          dc.l   modeb,norop+notrts+nocts+stop1
  848                      *
  849                      * set output port config register
  850                      *
  851  031C5C 0004001B          dc.l   opcr,allout
  852                      *
  853                      * Reset and enable channel A
  854                      *
  855  031C64 00040005          dc.l    cmda,rstrx
  856  031C6C 00040005          dc.l    cmda,rsttx_* reset transmitter
  857  031C74 00040005          dc.l    cmda,rsterr
  858  031C7C 00040005          dc.l    cmda,rstint
  859  031C84 00040005          dc.l    cmda,brkoff+tdis+ren
  860  031C8C 00040003          dc.l    clka,b9600
  861                      *
  862                      * Reset and enable channel b
  863                      *
  864  031C94 00040015          dc.l   cmdb,rstrx
  865  031C9C 00040015          dc.l   cmdb,rsttx
  866  031CA4 00040015          dc.l   cmdb,rsterr
  867  031CAC 00040015          dc.l   cmdb,rstint
 Motorola M68000 Assembler                                           Page  29

  868  031CB4 00040015          dc.l   cmdb,brkoff+tdis+ren
  869  031CBC 00040013          dc.l   clkb,b9600
  870                      *
  871                      * Setup output pins
  872                      *
  873  031CC4 0004001D          dc.l   bitset,$ff
  874         00000015     length equ   (*-table)/8
  875  031CCC 4E75              rts
  876                      
  877  031CCE 33F900020018 fset:   move.w dtbnds,dgbar            * Routine to
  877+        00050000      set Hardware Filter Regs
  878  031CD8 33F900020016         move.w scbnds,sgbar
  879  031CE2 13F900020021         move.b filctl,contr
  880  031CEC 4E75                 rts
  881                      
  882  031CEE 4EB9000315B8 sinit:  jsr    clrled                  * Initialise
  882+                     s the event database.
  883  031CF4 207C00020080         move.l dbadrw,a0
  884  031CFA 20BC00020088         move.l dbase,(a0)    * test on dbase2
  885  031D00 207C00020084         move.l dbadrr,a0
  886  031D06 20BC00020088         move.l dbase,(a0)
  887  031D0C 4E75                 rts
  888                      
  889  031D0E 007C0700     init:   or.w   #$0700,sr               * disable al
  889+                     l interrupts
  890  031D12 4EB900031CEE         jsr    sinit                   * clears dat
  890+                     abase registers.
  891  031D18 13FC00200002         move.b #$20,stats2             * clears mon
  891+        0013         itor status register
  892  031D20 13FC00000002         move.b #0,status               * clears mon
  892+        0012         itor mode register
  893  031D28 33FC00000002         move.w #0,mode                 * clears cha
  893+        0014         nge operation mode flag.
  894  031D30 13FC00FD0007         move.b rron,led                * initiate d
  894+        0000         atabase entry of 
  895  031D38 13FC00FD0002         move.b rron,hwcnt              * event pack
  895+        0023         ets.
  896  031D40 4EB900031AE2         jsr    duart                   * duart init
  896+                     ialise in interupt mode
  897  031D46 33FCFF000002         move.w #$ff00,scbnds           * set filter
  897+        0016          H'ware source bound
  898  031D4E 33FCFF000002         move.w #$ff00,dtbnds           *           
  898+        0018                 destination
  899  031D56 13FC00DD0002         move.b #$dd,filctl             * control re
  899+        0021         g for filter.
  900  031D5E 4EB900031CCE         jsr    fset                    * set Filter
  900+                      H'ware to mirror reg values
  901                      *        jsr    inchu                   * press a k
  901+                     ey to start
  902  031D64 7404                 move.l #4,d2                   * smooth scr
  902+                     oll currently disabled
  903  031D66 4EB9000316C4         jsr    smthsc
  904  031D6C 027CFCFF             and.w  #$fcff,sr               * enable lev
  904+                     el 5 and above interrupts
  905  031D70 4E75                 rts
  906                      
  907                      * :*:*:*:*:*:*:*:*:*:*:*:*:*:*:*:*:*:*:*:*:*:*:*:*:
  907+                     *:*:*:*:*:*:*
  908                      *
 Motorola M68000 Assembler                                           Page  30

  909                      * Main command interpreter routine
  910                      *
  911                      * :*:*:*:*:*:*:*:*:*:*:*:*:*:*:*:*:*:*:*:*:*:*:*:*:
  911+                     *:*:*:*:*:*:*
  912                      *
  913                      
  914  031D72 48E78C00     cpstt:  movem.l  d0/d4/d5,-(a7)        * Get cursor
  914+                      position.
  915  031D76 383C0030             move.w  #$30,d4                * Need two c
  915+                     ommunication with
  916  031D7A 3A3C0030             move.w  #$30,d5                * the WYSE.
  917  031D7E 3C3C0000             move.w  #00,d6
  918  031D82 3E3C0000             move.w  #00,d7
  919  031D86 103C001B             move.b  esc,d0
  920  031D8A 4EB90003008E         jsr     outch
  921  031D90 303C005B             move    lbk,d0
  922  031D94 4EB90003008E         jsr     outch
  923  031D9A B43C0036             cmp.b   #$36,d2
  924  031D9E 6600006E             bne     printc
  925  031DA2 1002                 move.b  d2,d0
  926  031DA4 4EB90003008E         jsr     outch
  927  031DAA 103C006E             move.b  #110,d0
  928  031DAE 4EB90003008E         jsr     outch
  929  031DB4 4EB900030028         jsr     inch     * the esc
  930  031DBA 4EB900030028         jsr     inch     * [
  931  031DC0 4EB900030028         jsr     inch     * P0
  932  031DC6 1C00                 move.b  d0,d6
  933  031DC8 4EB900030028         jsr     inch
  934  031DCE B03C003B             cmp.b   #59,d0   * ;
  935  031DD2 6700000C             beq     yval
  936  031DD6 1A06                 move.b  d6,d5
  937  031DD8 1C00                 move.b  d0,d6
  938  031DDA 4EB900030028         jsr     inch
  939  031DE0 4EB900030028 yval:   jsr     inch
  940  031DE6 1E00                 move.b  d0,d7
  941  031DE8 4EB900030028         jsr     inch
  942  031DEE B03C0052             cmp.b   #82,d0   * R
  943  031DF2 6700000C             beq     nval
  944  031DF6 1807                 move.b  d7,d4
  945  031DF8 1E00                 move.b  d0,d7
  946  031DFA 4EB900030028         jsr     inch
  947  031E00 E14C         nval:   lsl.w   #8,d4
  948  031E02 E14D                 lsl.w   #8,d5
  949  031E04 DC45                 add.w   d5,d6
  950  031E06 DE44                 add.w   d4,d7
  951  031E08 4CDF0031             movem.l (a7)+,d0/d4/d5
  952  031E0C 4E75                 rts
  953  031E0E 103C003F     printc: move.b  #63,d0                 Tell WYSE to
  953+                      print screen.
  954  031E12 4EB90003008E         jsr     outch
  955  031E18 103C0031             move.b  #$31,d0
  956  031E1C 4EB90003008E         jsr     outch
  957  031E22 103C0035             move.b  #$35,d0
  958  031E26 4EB90003008E         jsr     outch
  959  031E2C 4EB900030064         jsr     inchu
  960  031E32 4EB900030064         jsr     inchu
  961  031E38 4EB900030064         jsr     inchu
  962  031E3E 4EB900030064         jsr     inchu
  963  031E44 4EB900030064         jsr     inchu
 Motorola M68000 Assembler                                           Page  31

  964  031E4A 1400                 move.b  d0,d2
  965  031E4C 4EB900030064         jsr     inchu
  966  031E52 4CDF0031             movem.l (a7)+,d0/d4/d5
  967  031E56 4E75                 rts
  968                      
  969  031E58 48E73000     tstwd:  movem.l d2/d3,-(a7)            * Reset the 
  969+                     Windows after key
  970  031E5C 083900040002         btst    #4,status              * pressed ro
  970+        0012         utines.
  971  031E64 6700000C             beq     tst5
  972  031E68 4EB900031656         jsr     windf2
  973  031E6E 60000040             bra     tted
  974  031E72 083900050002 tst5:   btst    #5,status
  975  031E7A 6700000C             beq     tst6
  976  031E7E 4EB900031656         jsr     windf2
  977  031E84 6000002A             bra     tted
  978  031E88 083900060002 tst6:   btst    #6,status
  979  031E90 6700000C             beq     tst7
  980  031E94 4EB900031A82         jsr     wind1
  981  031E9A 60000014             bra     tted
  982  031E9E 083900070002 tst7:   btst    #7,status
  983  031EA6 67000008             beq     tted
  984  031EAA 4EB900031A6A         jsr     wind1a
  985  031EB0 3406         tted:   move.w  d6,d2
  986  031EB2 3607                 move.w  d7,d3
  987  031EB4 4EB9000313C8         jsr     moveto
  988  031EBA 143C0004             move.b  #04,d2
  989  031EBE 4EB9000316C4         jsr     smthsc
  990  031EC4 4CDF000C             movem.l (a7)+,d2/d3
  991  031EC8 4E75                 rts
  992                      
  993  031ECA 48E73000     lpromt: movem.l d2/d3,-(a7)            * Move curso
  993+                     r to user prompt.
  994  031ECE 4EB900031ACA         jsr    wind3
  995  031ED4 343C3233             move.w #$3233,d2
  996  031ED8 363C3031             move.w #$3031,d3
  997  031EDC 4EB9000313C8         jsr    moveto
  998  031EE2 4EB900031A0A         jsr    nxtln
  999  031EE8 4CDF000C             movem.l (a7)+,d2/d3
 1000  031EEC 4E75                 rts
 1001                      
 1002  031EEE 48E74008     lprom:  movem.l d1/a4,-(a7)            * Print user
 1002+                     /monitor prompt
 1003  031EF2 4EB900031ECA         jsr    lpromt
 1004  031EF8 49F900030442         lea    promms,a4	*
 1005  031EFE 720A                 move.l #prommn-promms,d1	* get message leng
 1005+                     th
 1006  031F00 4EB9000300D2         jsr    pdata	* print prompt
 1007  031F06 4CDF1002             movem.l (a7)+,d1/a4
 1008  031F0A 4E75                 rts
 1009                      
 1010  031F0C 4EB90003008E eline:  jsr     outch                  * Change mod
 1010+                     e to event line monitoring
 1011  031F12 4EB900031EEE         jsr     lprom
 1012  031F18 4EB900031E58         jsr     tstwd
 1013  031F1E 13FC00400002         move.b  #$40,status
 1014  031F26 4CDF000F             movem.l (a7)+,d0/d1/d2/d3
 1015  031F2A 4E73                 rte
 1016                      
 Motorola M68000 Assembler                                           Page  32

 1017  031F2C 4EB90003008E elog:   jsr     outch                  * Change mod
 1017+                     e to event log monitoring.
 1018  031F32 4EB900031EEE         jsr     lprom
 1019  031F38 4EB900031E58         jsr     tstwd
 1020  031F3E 13FC00800002         move.b  #$80,status
 1021  031F46 4CDF000F             movem.l (a7)+,d0/d1/d2/d3
 1022  031F4A 4E73                 rte
 1023                      
 1024  031F4C 4EB90003008E shdg:   jsr     outch                  * Change mod
 1024+                     e to display version
 1025  031F52 4EB900031EEE         jsr     lprom                  * of hardwar
 1025+                     e and software in use
 1026  031F58 4EB900031E58         jsr     tstwd
 1027  031F5E 13FC00100002         move.b  #$10,status
 1028  031F66 4CDF000F             movem.l (a7)+,d0/d1/d2/d3
 1029  031F6A 4E73                 rte
 1030                      
 1031  031F6C 4EB90003008E fltch:  jsr     outch                  * Change mod
 1031+                     e to Allow the filter latches to be
 1032  031F72 4EB900031EEE         jsr     lprom                  * to be upda
 1032+                     ted. 
 1033  031F78 4EB900031E58         jsr     tstwd
 1034  031F7E 13FC00200002         move.b  #$20,status
 1035  031F86 4CDF000F             movem.l (a7)+,d0/d1/d2/d3
 1036  031F8A 4E73                 rte
 1037                      
 1038  031F8C 4EB90003008E rset:   jsr     outch                  * change mod
 1038+                     e to reset sequence
 1039  031F92 4EB900031EEE         jsr     lprom
 1040  031F98 4EB900031E58         jsr     tstwd
 1041                      *        or.w    #$0700,sr
 1042  031F9E 4EB900031D0E         jsr     init
 1043  031FA4 13FC00000002         move.b  #$00,status
 1044  031FAC 4CDF000F             movem.l (a7)+,d0/d1/d2/d3
 1045  031FB0 4E73                 rte
 1046                      *
 1047                      *
 1048                      * Load program from remote device
 1049                      *
 1050  031FB2 4EB90003008E ploadr: jsr outch	* echo command char
 1051  031FB8 4EB900030328 pload1:	jsr hinch	* get char from network
 1052  031FBE B03C0053     	cmp.b #$53,d0	* is it "S"?
 1053  031FC2 66F4         	bne pload1	* no, try again
 1054  031FC4 4EB90003008E 	jsr outch	* output "S"
 1055  031FCA 4EB900030328 	jsr hinch	* get record type no (1,2 or 9)
 1056  031FD0 B03C0031     	cmp.b #$31,d0	* is it 1?
 1057  031FD4 67000016     	beq shadd	* yes, short address version
 1058  031FD8 B03C0032     	cmp.b #$32,d0	* is it 2?
 1059  031FDC 6700004A     	beq lngadd	* yes, long address version
 1060  031FE0 B03C0039     	cmp.b #$39,d0	* is it 9?
 1061  031FE4 67000064     	beq windup	* yes, download ending
 1062  031FE8 6000007C     	bra lprm70	* abort if any other character
 1063  031FEC 4EB9000303A8 shadd:	jsr hin2hx	* get record length
 1064  031FF2 65000072     	bcs lprm70	* prompt if <CR>
 1065  031FF6 4282         	clr.l d2
 1066  031FF8 1400         	move.b d0,d2	* record length in D2
 1067  031FFA 5982         	sub.l #4,d2	* adjust it to count data only
 1068  031FFC 4283         	clr.l d3	* clear address pointer
 1069  031FFE 4EB9000303E2 shad2:	jsr hin4hx	* get address
 Motorola M68000 Assembler                                           Page  33

 1070  032004 65000060     	bcs lprm70	* prompt if <CR>
 1071  032008 3601         	move.w d1,d3	* put addr in pointer
 1072  03200A 2843         	move.l d3,a4	* move it to a4
 1073  03200C 4EB9000303A8 getbyt:	jsr hin2hx	* get data byte
 1074  032012 65000052     	bcs lprm70	* prompt if <CR>
 1075  032016 18C0         	move.b d0,(a4)+	* put in memory
 1076  032018 51CAFFF2     	dbra d2,getbyt	* repeat as rqd
 1077  03201C 4EB9000303A8 	jsr hin2hx	* throw away checksum
 1078  032022 65000042     	bcs lprm70	* prompt if <CR>
 1079  032026 6090         	bra pload1	* get next record
 1080  032028 4EB9000303A8 lngadd:	jsr hin2hx	* get record length
 1081  03202E 65000036     	bcs lprm70	* prompt if <CR>
 1082  032032 4282         	clr.l d2
 1083  032034 1400         	move.b d0,d2	* record length into d2
 1084  032036 5B82         	sub.l #5,d2	* adjust to count data only
 1085  032038 4283         	clr.l d3
 1086  03203A 4EB9000303A8 	jsr hin2hx	* get msb of addr to d0
 1087  032040 65000024     	bcs lprm70	* prompt if <CR>
 1088  032044 1600         	move.b d0,d3	* put it in d3
 1089  032046 4843         	swap d3		* move it to correct byte of d3
 1090  032048 60B4         	bra shad2	* continue
 1091  03204A 4EB9000303E2 windup:	jsr hin4hx
 1092  032050 4EB9000303E2 	jsr hin4hx	* throw away 4 bytes
 1093  032056 49F900030CC2 	lea lfinms,a4	* load finished message
 1094  03205C 7212         	move.l #lfinmn-lfinms,d1
 1095  03205E 4EB9000300D2 lprm69:	jsr pdata	* print message
 1096  032064 4E75                rts
 1097                      *      bra lprom	* goto prompt
 1098  032066 49F900030CD4 lprm70: lea labtms,a4	* load aborted message
 1099  03206C 7212                 move.l #labtmn-labtms,d1
 1100  03206E 60EE                 bra lprm69
 1101                      *
 1102                      * RSLINK: links to auxiliary RS232 port, allows dow
 1102+                     nloading
 1103                      * 
 1104  032070 49F900031128 rslink: lea    gandp,a4
 1105  032076 7248                 move.l #gandpn-gandp,d1
 1106  032078 4EB9000300D2         jsr    pdata
 1107  03207E 1038000D             move.b cr,d0
 1108  032082 4EB9000300B0         jsr    outch2
 1109                      *	jsr outch	* echo char
 1110  032088 4EB900030032 rsloop:	jsr inchr2	* get char from aux RS232
 1111  03208E 6400001C     	bcc gotch	* branch if char available
 1112  032092 4EB900030000 	jsr inchr	* get char from terminal
 1113  032098 65EE         	bcs rsloop	* loop if no char available
 1114  03209A B03C001C     	cmp.b #netbrk,d0	* is it NETWORK BREAK char?
 1115  03209E 66000004     	bne rscont	* branch if not
 1116  0320A2 4E75              rts
 1117                      *bra lprom	* goto prompt
 1118  0320A4 4EB9000300B0 rscont:	jsr outch2	* send char to aux RS232 port
 1119  0320AA 60DC         	bra rsloop	* loop
 1120  0320AC B03C0000     gotch:	cmp.b #00,d0	* is it null char?
 1121  0320B0 67D6         	beq rsloop	* if so discard and loop
 1122  0320B2 B03C001C     	cmp.b #netbrk,d0	* is it NETWORK BREAK char?
 1123  0320B6 6700FEFA     	beq ploadr	* if so, go to program downloader
 1124  0320BA 4EB90003008E 	jsr outch	* otherwise send to terminal
 1125  0320C0 60C6         	bra rsloop	* and loop
 1126                      
 1127  0320C2 4EB900031656 gand:   jsr     windf2                 * Setup gand
 Motorola M68000 Assembler                                           Page  34

 1127+                     alf link.
 1128  0320C8 4EB900031686         jsr     cls
 1129  0320CE 143C0004             move.b  #04,d2
 1130  0320D2 4EB9000316C4         jsr     smthsc
 1131  0320D8 4EB900032070         jsr     rslink
 1132  0320DE 13FC00020002         move.b  #$02,status
 1133  0320E6 4EB900031EEE         jsr     lprom
 1134  0320EC 4EB900031E58         jsr     tstwd
 1135  0320F2 4CDF000F             movem.l (a7)+,d0/d1/d2/d3
 1136  0320F6 4E73                 rte
 1137                      
 1138  0320F8 4EB90003008E quit:   jsr     outch                  * Change mod
 1138+                     e the quit mode.
 1139  0320FE 13FC00040002         move.b  #$04,status
 1140                      *        jsr     setst
 1141  032106 4EB900031EEE         jsr     lprom
 1142  03210C 4EB900031E58         jsr     tstwd
 1143  032112 4CDF000F             movem.l (a7)+,d0/d1/d2/d3
 1144  032116 4E73                 rte
 1145                      
 1146  032118 4EB900031EEE lpromx: jsr lprom                     * No action t
 1146+                     o mode update
 1147  03211E 4EB900031E58         jsr     tstwd                 * since retur
 1147+                     n pressed.- escape
 1148  032124 4CDF000F             movem.l (a7)+,d0/d1/d2/d3     * from key bo
 1148+                     ard handling routines.
 1149  032128 4E73                 rte
 1150                      
 1151                      
 1152  03212A 143C0000     iconi:  move.b #00,d2
 1153  03212E 4EB9000316C4         jsr    smthsc
 1154  032134 4EB90003008E         jsr    outch                  * Icon help
 1155  03213A 4EB900031AB2         jsr    wind2
 1156  032140 343C3139             move.w #$3139,d2
 1157  032144 363C3031             move.w #$3031,d3
 1158  032148 4EB9000313C8         jsr    moveto
 1159  03214E 2F0C                 move.l a4,-(a7)
 1160  032150 49F90003044C         lea    iconms,a4	* get message pointer
 1161  032156 223C00000148         move.l #iconmn-iconms,d1	* get message leng
 1161+                     th
 1162  03215C 4EB9000300D2         jsr    pdata	* print it
 1163  032162 4EB900031EEE         jsr    lprom
 1164  032168 4EB900031E58         jsr     tstwd
 1165  03216E 285F                 move.l (a7)+,a4
 1166  032170 4CDF000F             movem.l (a7)+,d0/d1/d2/d3
 1167  032174 4E73                 rte
 1168                      
 1169  032176 7600         hisnum: move.l #0,d3                 * register for
 1169+                      relative flag
 1170  032178 7400                 move.l #0,d2                 * register for
 1170+                      accumulation of value.
 1171  03217A 7000                 move.l #0,d0
 1172  03217C 4EB90003011C         jsr    pspac1
 1173  032182 4EB900030064 hnext:  jsr    inchu
 1174  032188 B03C000D             cmp.b  #cr,d0
 1175  03218C 67000036             beq    hnexit                * rts if cr pr
 1175+                     essed
 1176  032190 B03C002D             cmp.b  #$2d,d0               * check if is 
 1176+                     `-'
 Motorola M68000 Assembler                                           Page  35

 1177  032194 67000024             beq    relat
 1178  032198 B03C0030             cmp.b  #$30,d0               * is it less t
 1178+                     han 0
 1179  03219C 6DE4                 blt    hnext
 1180  03219E B03C0039             cmp.b  #$39,d0
 1181  0321A2 6EDE                 bgt    hnext
 1182  0321A4 4EB90003008E         jsr    outch
 1183  0321AA 903C0030             sub.b  #$30,d0
 1184  0321AE 2202                 move.l d2,d1
 1185  0321B0 E78A                 lsl.l  #3,d2
 1186  0321B2 E389                 lsl.l  #1,d1
 1187  0321B4 D481                 add.l  d1,d2
 1188  0321B6 D480                 add.l  d0,d2
 1189  0321B8 60C8                 bra    hnext
 1190  0321BA 4EB90003008E relat:  jsr    outch
 1191  0321C0 1600                 move.b d0,d3
 1192  0321C2 60BE                 bra    hnext
 1193  0321C4 4E75         hnexit: rts
 1194                      
 1195  0321C6 4EB90003008E histor: jsr    outch                * output char
 1196  0321CC 48E700C0             movem.l a0/a1,-(a7)
 1197  0321D0 4EB900032176         jsr    hisnum               * input index v
 1197+                     alue to start display from
 1198  0321D6 207C00020084         move.l dbadrr,a0
 1199  0321DC 223C00020088         move.l dbase,d1
 1200  0321E2 B63C002D             cmp.b  #$2d,d3
 1201  0321E6 66000020             bne    habs
 1202  0321EA 2010                 move.l (a0),d0              * put read db a
 1202+                     ddress ptr in d0.
 1203  0321EC 9081                 sub.l  d1,d0                * find db size 
 1203+                     for read packets.
 1204  0321EE E688                 lsr.l  #3,d0                * find the numb
 1204+                     er of packets read.
 1205  0321F0 9082                 sub.l  d2,d0                * move ptr back
 1205+                      this number of places
 1206  0321F2 B0BC00000000         cmp.l  #0,d0
 1207  0321F8 6E000004             bgt    hplus
 1208  0321FC 7000                 move.l #0,d0
 1209  0321FE E788         hplus:  lsl.l  #3,d0                * convert back 
 1209+                     to bytes
 1210  032200 D081                 add.l  d1,d0                * add dbase to 
 1210+                     value
 1211  032202 2010                 move.l (a0),d0              * write to poin
 1211+                     ter.
 1212  032204 6000001A             bra    hisext
 1213  032208 227C00020080 habs:   move.l dbadrw,a1            * get write poi
 1213+                     nter
 1214  03220E 2011                 move.l (a1),d0
 1215  032210 9081                 sub.l  d1,d0                * find number o
 1215+                     f bytes in db
 1216  032212 E688                 lsr.l  #3,d0                * find number o
 1216+                     f packets in db
 1217  032214 B082                 cmp.l  d2,d0                * is inputed va
 1217+                     lue larger than number in db
 1218  032216 6D000008             blt    hisext
 1219  03221A E78A                 lsl.l  #3,d2 
 1220  03221C D481                 add.l  d1,d2
 1221  03221E 2082                 move.l d2,(a0)
 1222  032220 4EB900031EEE hisext: jsr    lprom
 Motorola M68000 Assembler                                           Page  36

 1223  032226 4EB900031E58         jsr    tstwd
 1224  03222C 4CDF0300             movem.l (a7)+,a0/a1
 1225  032230 4CDF000F             movem.l (a7)+,d0/d1/d2/d3
 1226  032234 4E73                 rte
 1227                      
 1228  032236 4EB90003008E pscrn:  jsr    outch                  * Print scree
 1228+                     n      
 1229  03223C 0A3900100002         eori.b #$10,stats2
 1230  032244 4EB90003141E         jsr    upst
 1231  03224A 4EB900031EEE         jsr    lprom
 1232                      *prtst:  move.b #0,d2
 1233                      *       jsr    cpstt
 1234                      *       cmp.b  #$30,d2
 1235                      *       bne    prtst
 1236                      *       move.b esc,d0
 1237                      *       jsr    outch
 1238                      *       move.b lbk,d0
 1239                      *       jsr    outch
 1240                      *       move.b #105,d0
 1241                      *       jsr    outch
 1242  032250 4EB900031E58         jsr     tstwd
 1243  032256 4CDF000F             movem.l (a7)+,d0/d1/d2/d3
 1244  03225A 4E73                 rte
 1245                      
 1246  03225C 0A3900040002 tlah:   eori.b #$04,stats2            * Cause monit
 1246+        0013         or to halt.
 1247  032264 4EB90003008E         jsr    outch
 1248  03226A 4EB90003141E         jsr    upst
 1249  032270 4EB900031EEE         jsr    lprom
 1250  032276 4EB900031E58         jsr    tstwd
 1251  03227C 4CDF000F             movem.l (a7)+,d0/d1/d2/d3
 1252  032280 4E73                 rte
 1253                      
 1254  032282 0A3900020002 lkscrn: eori.b #$02,stats2            * Cause scree
 1254+        0013         n display to freeze.
 1255  03228A 4EB90003008E         jsr    outch
 1256  032290 4EB90003141E         jsr    upst
 1257  032296 4EB900031EEE         jsr    lprom
 1258  03229C 4EB900031E58         jsr     tstwd
 1259  0322A2 4CDF000F             movem.l (a7)+,d0/d1/d2/d3
 1260  0322A6 4E73                 rte
 1261                      
 1262  0322A8 4EB90003008E rstart: jsr    outch                  * initate a s
 1262+                     oft reset
 1263  0322AE 4EB900031EEE         jsr    lprom
 1264  0322B4 4EB900031E58         jsr     tstwd
 1265  0322BA 207C00020084         move.l  dbadrr,a0
 1266  0322C0 20BC00020088         move.l  dbase,(a0)
 1267  0322C6 13FC00000002         move.b  #00,status
 1268  0322CE 4CDF000F             movem.l (a7)+,d0/d1/d2/d3
 1269  0322D2 4E73                 rte
 1270                      
 1271  0322D4 4EB90003008E centnt: jsr    outch
 1272  0322DA 4EB900031656         jsr    windf2
 1273  0322E0 4EB900031686         jsr    cls
 1274  0322E6 343C3033             move.w #$3033,d2
 1275  0322EA 363C3031             move.w #$3031,d3
 1276  0322EE 4EB9000313C8         jsr    moveto
 1277  0322F4 2F0C                 move.l a4,-(a7)
 Motorola M68000 Assembler                                           Page  37

 1278  0322F6 49F900031170         lea    cnt1p,a4
 1279  0322FC 223C00000080         move.l #cnt1pn-cnt1p,d1
 1280  032302 4EB9000300D2         jsr    pdata
 1281  032308 083900050002         btst   #5,stats2
 1282  032310 67000014             beq    norm1
 1283  032314 49F900031224         lea    cpp,a4
 1284  03231A 7234                 move.l #cppn-cpp,d1
 1285  03231C 4EB9000300D2         jsr    pdata
 1286  032322 60000010             bra    cont1
 1287  032326 49F9000311F0 norm1:  lea    eip,a4
 1288  03232C 7234                 move.l #eipn-eip,d1
 1289  03232E 4EB9000300D2         jsr    pdata
 1290  032334 49F900031258 cont1:  lea    cnt2p,a4
 1291  03233A 725E                 move.l #cnt2pn-cnt2p,d1
 1292  03233C 4EB9000300D2         jsr    pdata
 1293  032342 083900050002         btst   #5,stats2
 1294  03234A 67000014             beq    norm2
 1295  03234E 49F9000311F0         lea    eip,a4
 1296  032354 7234                 move.l #eipn-eip,d1
 1297  032356 4EB9000300D2         jsr    pdata
 1298  03235C 60000010             bra    cont2
 1299  032360 49F900031224 norm2:  lea    cpp,a4
 1300  032366 7234                 move.l #cppn-cpp,d1
 1301  032368 4EB9000300D2         jsr    pdata
 1302  03236E 49F9000312B6 cont2:  lea    cnt3p,a4
 1303  032374 223C000000A0         move.l #cnt3pn-cnt3p,d1
 1304  03237A 4EB9000300D2         jsr    pdata
 1305  032380 303900020014         move.w mode,d0
 1306  032386 B07C0000             cmp.w  #0,d0
 1307  03238A 67000010             beq    charp
 1308  03238E 49F900031356         lea    cnt4p,a4
 1309  032394 7272                 move.l #cnt4pn-cnt4p,d1
 1310  032396 4EB9000300D2         jsr    pdata
 1311  03239C 4EB900030064 charp:  jsr    inchu
 1312  0323A2 B03C000D             cmp.b  #cr,d0            * is it <cr>?
 1313  0323A6 67F4                 beq    charp
 1314  0323A8 B03C0043             cmp.b  #$43,d0           * is it 'C'? Conti
 1314+                     nue.
 1315  0323AC 67000012             beq    chmod
 1316  0323B0 B03C0051             cmp.b  #$51,d0           * is it 'Q'? Quit.
 1317  0323B4 67000048             beq    cterm
 1318  0323B8 4EB90003010C         jsr    pbell
 1319  0323BE 60DC                 bra    charp
 1320                      
 1321  0323C0 33FCFFFF0002 chmod:  move.w #$ffff,mode           * Set mode cha
 1321+        0014         nge flag. Cleared when other
 1322  0323C8 103900020023         move.b hwcnt,d0
 1323  0323CE 083900050002         btst   #5,stats2         * Board acknowledg
 1323+        0013         es the change of operation.
 1324  0323D6 67000016             beq    zip
 1325  0323DA C03C00F7             and.b  evpon,d0
 1326  0323DE 13C000020023         move.b d0,hwcnt
 1327  0323E4 13C000070000         move.b d0,led
 1328  0323EA 60000012             bra    cterm
 1329  0323EE C03C00FB     zip:    and.b  ctpon,d0
 1330  0323F2 13C000020023         move.b d0,hwcnt
 1331  0323F8 13C000070000         move.b d0,led
 1332                      *
 1333                      **czip:   or.w   #$0500,sr        * disable keyboar
 Motorola M68000 Assembler                                           Page  38

 1333+                     d and buffer interrupts while 
 1334                      *        jsr    sinit           * resetting db.
 1335                      **        and.w  #$fcff,sr       * enable interrupt
 1335+                     s again. 5 upwards.
 1336  0323FE 4EB900031ECA cterm:  jsr    lpromt
 1337  032404 243C00000CA2         move.l #3234,d2
 1338  03240A 263C00000BDE         move.l #3038,d3
 1339  032410 4EB9000313C8         jsr    moveto
 1340  032416 4EB90003008E         jsr    outch
 1341  03241C 4EB900031EEE         jsr    lprom
 1342  032422 4EB900031E58         jsr    tstwd
 1343  032428 13FC00000002         move.b #00,status
 1344  032430 285F                 move.l (a7)+,a4
 1345  032432 4CDF000F             movem.l (a7)+,d0/d1/d2/d3
 1346  032436 4E73                 rte
 1347                      **
 1348                      *
 1349  032438 48E7F000     chinp:  movem.l d0/d1/d2/d3,-(a7)     * Get charact
 1349+                     er from Duart
 1350  03243C 2F00                 move.l d0,-(a7)               * converted i
 1350+                     t to upper case.
 1351                      *       move.b  #00,d2                * Take the ne
 1351+                     cessary action by
 1352                      *       jsr     smthsc                * setting the
 1352+                      status registers.
 1353  03243E 143C0036             move.b #$36,d2                * The monitor
 1353+                      will then change
 1354  032442 4EB900031D72         jsr    cpstt                  * mode at spe
 1354+                     cific times.
 1355  032448 4EB900031ECA         jsr    lpromt
 1356  03244E 343C3234             move.w #$3234,d2
 1357  032452 363C3038             move.w #$3038,d3
 1358  032456 4EB9000313C8         jsr    moveto
 1359  03245C 201F                 move.l (a7)+,d0
 1360                      *       jsr    upcse
 1361  03245E 4EB900030064         jsr    inchu	* get an upper-case character
 1362  032464 B03C000D             cmp.b  #cr,d0	* is it <CR>?
 1363  032468 6700FCAE             beq    lpromx	* yes, goto prompt
 1364  03246C B03C003F             cmp.b  #$3f,d0	* is it "?"?
 1365  032470 670000C2             beq    query	* yes, goto query
 1366  032474 B03C0041             cmp.b  #$41,d0	* is it "A"?
 1367  032478 6700FA92             beq    eline	* yes, goto event line monitor
 1368  03247C B03C0042             cmp.b  #$42,d0 * is it "B"?
 1369  032480 6700FD44             beq    histor  * yes goto Database History 
 1369+                     routine
 1370  032484 B03C0043             cmp.b  #$43,d0 * is it "C"?
 1371  032488 6700FE4A             beq    centnt * yes goto change monitor mod
 1371+                     e
 1372  03248C B03C0044             cmp.b  #$44,d0	* is it "D"?
 1373  032490 6700FABA             beq    shdg	* yes, goto system diagnostics
 1374  032494 B03C0045             cmp.b  #$45,d0	* is it "E"?
 1375  032498 6700FA92             beq    elog	* yes, goto event log monitor
 1376  03249C B03C0046             cmp.b  #$46,d0	* is it "F"?
 1377  0324A0 6700FACA             beq    fltch	* yes, goto filter change     
 1377+                      
 1378  0324A4 B03C0047             cmp.b  #$47,d0	* is it "G"?
 1379  0324A8 6700FC18             beq    gand	* yes, goto gandalf interface
 1380  0324AC B03C0048             cmp.b  #$48,d0	* is it "H"?
 1381  0324B0 6700FDAA             beq    tlah	* yes, goto halt routine
 Motorola M68000 Assembler                                           Page  39

 1382  0324B4 B03C0049             cmp.b  #$49,d0	* is it "I"?
 1383  0324B8 6700FC70             beq    iconi	* yes, goto icon info for even
 1383+                     t line monitor
 1384  0324BC B03C0050             cmp.b  #$50,d0	* is it "P"?
 1385  0324C0 6700FD74             beq    pscrn	* yes, goto print screen routi
 1385+                     ne
 1386  0324C4 B03C0051             cmp.b  #$51,d0	* is it "Q"?
 1387  0324C8 6700FC2E             beq    quit	* yes, goto quit routine
 1388  0324CC B03C0052             cmp.b  #$52,d0	* is it "R"?
 1389  0324D0 6700FABA             beq    rset	* yes, goto REBOOT routine
 1390  0324D4 B03C0053             cmp.b  #$53,d0	* is it "S"?
 1391  0324D8 6700FDA8             beq    lkscrn	* yes, goto lock screen routi
 1391+                     ne
 1392  0324DC B03C005A             cmp.b  #$5a,d0	* is it "Z"?
 1393  0324E0 6700FDC6             beq    rstart	* yes, goto restart routine
 1394                      *
 1395                      * character not found
 1396                      *
 1397  0324E4 4EB90003010C         jsr    pbell	* char not found, print bell
 1398  0324EA 4CDF000F             movem.l (a7)+,d0/d1/d2/d3
 1399  0324EE 4E73                 rte
 1400                      
 1401  0324F0 48E7A000     akey:   movem.l d0/d2,-(a7)            * Has a key 
 1401+                     been pressed if so
 1402  0324F4 027CF8FF             and.w   #$f8ff,sr           * what is and t
 1402+                     ake the appropriate action.
 1403                      *       jsr     inchr
 1404                      *       bcs     nokey
 1405                      *       jsr     chinp
 1406  0324F8 70FF                 move.l  #$ffffffff,d0       * A delay
 1407  0324FA 51C8FFFE     zz:     dbra    d0,zz
 1408  0324FE 007C0400             or.w    #$0400,sr           * disable level
 1408+                      4 and below interrupts
 1409  032502 143C0004             move.b  #04,d2
 1410  032506 4EB9000316C4         jsr     smthsc
 1411  03250C 4CDF0005             movem.l (a7)+,d0/d2
 1412  032510 4E75                 rts
 1413                      
 1414                      *
 1415                      * Command Jump table
 1416                      *
 1417  032512 143C0000     lprom1: move.b  #00,d2
 1418  032516 4EB9000316C4         jsr     smthsc
 1419  03251C 4EB90003008E         jsr    outch	* echo character   
 1420  032522 4EB900031EEE         jsr    lprom	* goto prompt
 1421  032528 4EB900031E58         jsr     tstwd
 1422  03252E 4CDF000F             movem.l (a7)+,d0/d1/d2/d3
 1423  032532 4E73                 rte
 1424                      *
 1425                      * QUERY: print help message* uses D1, D0
 1426                      *
 1427  032534 143C0000     query:  move.b #00,d2
 1428  032538 4EB9000316C4         jsr    smthsc
 1429  03253E 4EB90003008E         jsr    outch	* output character
 1430  032544 4EB900031AB2         jsr    wind2
 1431  03254A 343C3139             move.w #$3139,d2
 1432  03254E 363C3031             move.w #$3031,d3
 1433  032552 4EB9000313C8         jsr    moveto
 1434  032558 2F0C                 move.l a4,-(a7)
 Motorola M68000 Assembler                                           Page  40

 1435  03255A 49F900030594         lea    helpms,a4	* get message pointer
 1436  032560 223C00000148         move.l #helpmn-helpms,d1	* get message leng
 1436+                     th
 1437  032566 4EB9000300D2         jsr    pdata	* print it
 1438  03256C 4EB900031EEE         jsr    lprom
 1439  032572 4EB900031E58         jsr    tstwd
 1440  032578 285F                 move.l (a7)+,a4
 1441  03257A 4CDF000F             movem.l (a7)+,d0/d1/d2/d3
 1442  03257E 4E73                 rte
 1443                      
 1444                      ***************************************************
 1444+                     **********
 1445                      *       Routines for Event Log Monitoring.
 1446                      
 1447                      **   Graphics routines to draw the graphical window
 1447+                     .
 1448                      
 1449  032580 48E7B000     ptlgln: movem.l d0/d2/d3,-(a7)       * draws the ve
 1449+                     rtical lines between
 1450  032584 143C0030             move.b #$30,d2               * columns
 1451  032588 163C0035             move.b #$35,d3
 1452  03258C 4EB900031896         jsr    movec
 1453  032592 103C0078             move.b #120,d0       *  x
 1454  032596 4EB90003008E         jsr    outch
 1455  03259C 143C0032             move.b #$32,d2
 1456  0325A0 163C0032             move.b #$32,d3
 1457  0325A4 4EB900031896         jsr    movec
 1458  0325AA 4EB90003008E         jsr    outch
 1459  0325B0 163C0039             move.b #$39,d3
 1460  0325B4 4EB900031896         jsr    movec
 1461  0325BA 4EB90003008E         jsr    outch
 1462  0325C0 143C0033             move.b #$33,d2
 1463  0325C4 163C0033             move.b #$33,d3
 1464  0325C8 4EB900031896         jsr    movec
 1465  0325CE 4EB90003008E         jsr    outch
 1466  0325D4 143C0034             move.b #$34,d2
 1467  0325D8 163C0030             move.b #$30,d3
 1468  0325DC 4EB900031896         jsr    movec
 1469  0325E2 4EB90003008E         jsr    outch
 1470  0325E8 163C0034             move.b #$34,d3
 1471  0325EC 4EB900031896         jsr    movec
 1472  0325F2 4EB90003008E         jsr    outch
 1473  0325F8 143C0037             move.b #$37,d2
 1474  0325FC 163C0036             move.b #$36,d3
 1475  032600 4EB900031896         jsr    movec
 1476  032606 4EB90003008E         jsr    outch
 1477  03260C 4CDF000D             movem.l (a7)+,d0/d2/d3
 1478  032610 4E75                 rts
 1479                      
 1480  032612 303C000A     evlg2:  move.w #10,d0             * Draws the lower
 1480+                      half of the graphics
 1481  032616 6000000E             bra    lgnt               * window for even
 1481+                     t log monitoring
 1482  03261A 4EB900031A0A lgre:   jsr    nxtln
 1483  032620 4EB900032580         jsr    ptlgln
 1484  032626 51C8FFF2     lgnt:   dbra   d0,lgre
 1485  03262A 49F900030940         lea    blog,a4
 1486  032630 7248                 move.l #blogn-blog,d1
 1487  032632 343C3138             move.w #$3138,d2
 Motorola M68000 Assembler                                           Page  41

 1488  032636 363C0035             move.w #ascii0+5,d3
 1489  03263A 4EB9000313C8         jsr    moveto
 1490  032640 4EB9000300D2         jsr    pdata
 1491  032646 4EB900031872         jsr    nmode
 1492  03264C 4E75                 rts
 1493                      
 1494  03264E 083900050002 tlogln: btst   #5,stats2
 1495  032656 6600000E             bne    cp1
 1496  03265A 49F900030988         lea    log1t,a4          * Draws the top ha
 1496+                     lf of the graphics
 1497  032660 723E                 move.l #log1tn-log1t,d1  * window.
 1498  032662 6000000A             bra    prev1
 1499  032666 49F9000309EC cp1:    lea    ctxt1p,a4
 1500  03266C 7242                 move.l #ctxt1n-ctxt1p,d1
 1501  03266E 343C3035     prev1:  move.w #$3035,d2
 1502  032672 363C3036             move.w #$3036,d3
 1503  032676 4EB9000313C8         jsr    moveto
 1504  03267C 4EB900031872         jsr    nmode
 1505  032682 4EB9000300D2         jsr    pdata
 1506  032688 4EB90003184E         jsr    grmode
 1507  03268E 4EB900032580         jsr    ptlgln
 1508  032694 083900050002         btst   #5,stats2
 1509  03269C 6600000E             bne    cp2
 1510  0326A0 49F9000309C6         lea    log2t,a4
 1511  0326A6 7226                 move.l #log2tn-log2t,d1
 1512  0326A8 6000000A             bra    prev2
 1513  0326AC 49F900030A2E cp2:    lea    ctxt2p,a4
 1514  0326B2 7244                 move.l #ctxt2n-ctxt2p,d1
 1515  0326B4 343C3036     prev2:  move.w #$3036,d2
 1516  0326B8 4EB9000313C8         jsr    moveto
 1517  0326BE 4EB900031872         jsr    nmode
 1518  0326C4 4EB9000300D2         jsr    pdata
 1519  0326CA 4EB90003184E         jsr    grmode
 1520  0326D0 4EB900032580         jsr    ptlgln
 1521  0326D6 4E75                 rts
 1522                      
 1523                      
 1524                      
 1525  0326D8 4EB900031656 evlg1:  jsr    windf2               * Sets up scree
 1525+                     n for event log monitoring
 1526  0326DE 4EB900031686         jsr    cls                  * displays scre
 1526+                     en heading
 1527  0326E4 49F900030894         lea    log1,a4
 1528  0326EA 721C                 move.l #log1n-log1,d1
 1529  0326EC 343C0032             move.w #ascii0+2,d2
 1530  0326F0 363C3235             move.w #$3235,d3
 1531  0326F4 4EB9000313C8         jsr    moveto
 1532  0326FA 343C3038             move.w #$3038,d2
 1533  0326FE 4EB9000316FE         jsr    attr
 1534  032704 4EB9000300D2         jsr    pdata
 1535  03270A 4EB900031736         jsr    clratt
 1536  032710 4EB900031746         jsr    prtstt
 1537  032716 49F9000308B0         lea    tlog,a4
 1538  03271C 7248                 move.l #tlogn-tlog,d1
 1539  03271E 343C0034             move.w #ascii0+4,d2
 1540  032722 363C0035             move.w #ascii0+5,d3
 1541  032726 4EB9000313C8         jsr    moveto
 1542  03272C 4EB90003184E         jsr    grmode
 1543  032732 4EB9000300D2         jsr    pdata
 Motorola M68000 Assembler                                           Page  42

 1544  032738 343C0035             move.w #ascii0+5,d2
 1545  03273C 363C0031             move.w #ascii0+1,d3
 1546  032740 4EB9000313C8         jsr    moveto
 1547  032746 4EB90003264E         jsr    tlogln
 1548  03274C 49F9000308F8         lea    mlog,a4
 1549  032752 7248                 move.l #mlogn-mlog,d1
 1550  032754 343C0037             move.w #ascii0+7,d2
 1551  032758 363C0035             move.w #ascii0+5,d3
 1552  03275C 4EB9000313C8         jsr    moveto
 1553  032762 4EB9000300D2         jsr    pdata
 1554  032768 4E75                 rts
 1555                      
 1556                      ***************************************************
 1556+                     *******
 1557                      ***      Routines to interpret the event packet and
 1557+                      convert 
 1558                      ***      to a human readable format and display it.
 1559                      
 1560  03276A 48E7D080     gttmp:  movem.l d0/d1/d3/a0,-(a7)     * This routin
 1560+                     e converts the timestamp
 1561  03276E 207C00020000         move.l  time,a0               * to hrs, min
 1561+                     , secs and usec.
 1562  032774 20FC00000000         move.l  #00,(a0)+
 1563  03277A 20FC00000000         move.l  #00,(a0)+
 1564  032780 20BC00000000         move.l  #00,(a0)
 1565  032786 207C00020000         move.l  time,a0
 1566  03278C 103C002F             move.b  #$2f,d0
 1567  032790 5200         dhr:    add.b   #1,d0
 1568  032792 94BCD693A400         sub.l   hr,d2
 1569  032798 64F6                 bcc     dhr
 1570  03279A D4BCD693A400         add.l   hr,d2
 1571  0327A0 10C0                 move.b  d0,(a0)+
 1572  0327A2 103C002F             move.b  #$2f,d0
 1573  0327A6 5200         dtmin:  add.b   #1,d0
 1574  0327A8 94BC23C34600         sub.l   tmin,d2
 1575  0327AE 64F6                 bcc     dtmin
 1576  0327B0 D4BC23C34600         add.l   tmin,d2
 1577  0327B6 10C0                 move.b  d0,(a0)+
 1578  0327B8 103C002F             move.b  #$2f,d0
 1579  0327BC 5200         dmin:   add.b   #1,d0
 1580  0327BE 94BC03938700         sub.l   min,d2
 1581  0327C4 64F6                 bcc     dmin
 1582  0327C6 D4BC03938700         add.l   min,d2
 1583  0327CC 10C0                 move.b  d0,(a0)+
 1584  0327CE 4EB90003041E         jsr     decpt
 1585  0327D4 4CDF010B             movem.l (a7)+,d0/d1/d3/a0
 1586  0327D8 4E75                 rts
 1587                      
 1588  0327DA 48E7A080     prtms:  movem.l d0/d2/a0,-(a7)       * this routine
 1588+                      prints the timestamp
 1589  0327DE 207C00020000         move.l  time,a0              * the lefthand
 1589+                      side column.
 1590  0327E4 1018                 move.b  (a0)+,d0
 1591  0327E6 4EB90003008E         jsr     outch
 1592  0327EC 103C003A             move.b  #58,d0
 1593  0327F0 4EB90003008E         jsr     outch
 1594  0327F6 1018                 move.b  (a0)+,d0
 1595  0327F8 4EB90003008E         jsr     outch
 1596  0327FE 1018                 move.b  (a0)+,d0
 Motorola M68000 Assembler                                           Page  43

 1597  032800 4EB90003008E         jsr     outch
 1598  032806 103C003A             move.b  #58,d0
 1599  03280A 4EB90003008E         jsr     outch
 1600  032810 1018                 move.b  (a0)+,d0
 1601  032812 4EB90003008E         jsr     outch
 1602  032818 1018                 move.b  (a0)+,d0 
 1603  03281A 4EB90003008E         jsr     outch
 1604  032820 103C002E             move.b  #46,d0
 1605  032824 4EB90003008E         jsr     outch
 1606  03282A 143C0005             move.b  #05,d2
 1607  03282E 1018         pts:    move.b  (a0)+,d0
 1608  032830 4EB90003008E         jsr     outch
 1609  032836 51CAFFF6             dbra    d2,pts
 1610  03283A 4CDF0105             movem.l (a7)+,d0/d2/a0
 1611  03283E 4E75                 rts
 1612                      
 1613  032840 48E76008     ptev:   movem.l d1/d2/a4,-(a7)    * Identifies the 
 1613+                     one of 16 events
 1614  032844 C43C000F             and.b   #$0f,d2           * and print the c
 1614+                     orresponding message
 1615  032848 B43C0000             cmp.b   #0,d2
 1616  03284C 6600000E             bne     ne0
 1617  032850 49F900030B02         lea     ev0,a4
 1618  032856 721C                 move.l  #ev0n-ev0,d1
 1619  032858 60000122             bra     eeq
 1620  03285C B43C0001     ne0:    cmp.b   #1,d2
 1621  032860 6600000E             bne     ne1
 1622  032864 49F900030B1E         lea     ev1,a4
 1623  03286A 721C                 move.l  #ev1n-ev1,d1
 1624  03286C 6000010E             bra     eeq
 1625  032870 B43C0002     ne1:    cmp.b   #2,d2
 1626  032874 6600000E             bne     ne2
 1627  032878 49F900030B3A         lea     ev2,a4
 1628  03287E 721C                 move.l  #ev2n-ev2,d1
 1629  032880 600000FA             bra     eeq
 1630  032884 B43C0003     ne2:    cmp.b   #3,d2
 1631  032888 6600000E             bne     ne3
 1632  03288C 49F900030B56         lea     ev3,a4
 1633  032892 721C                 move.l  #ev3n-ev3,d1
 1634  032894 600000E6             bra     eeq
 1635  032898 B43C0004     ne3:    cmp.b   #4,d2
 1636  03289C 6600000E             bne     ne4
 1637  0328A0 49F900030B72         lea     ev4,a4
 1638  0328A6 721C                 move.l  #ev4n-ev4,d1
 1639  0328A8 600000D2             bra     eeq
 1640  0328AC B43C0005     ne4:    cmp.b   #5,d2
 1641  0328B0 6600000E             bne     ne5
 1642  0328B4 49F900030B8E         lea     ev5,a4
 1643  0328BA 721C                 move.l  #ev5n-ev5,d1
 1644  0328BC 600000BE             bra     eeq
 1645  0328C0 B43C0006     ne5:    cmp.b   #6,d2
 1646  0328C4 6600000E             bne     ne6
 1647  0328C8 49F900030BAA         lea     ev6,a4
 1648  0328CE 721C                 move.l  #ev6n-ev6,d1
 1649  0328D0 600000AA             bra     eeq
 1650  0328D4 B43C0007     ne6:    cmp.b   #7,d2
 1651  0328D8 6600000E             bne     ne7
 1652  0328DC 49F900030BC6         lea     ev7,a4
 1653  0328E2 721C                 move.l  #ev7n-ev7,d1
 Motorola M68000 Assembler                                           Page  44

 1654  0328E4 60000096             bra     eeq
 1655  0328E8 B43C0008     ne7:    cmp.b   #8,d2
 1656  0328EC 6600000E             bne     ne8
 1657  0328F0 49F900030BE2         lea     ev8,a4
 1658  0328F6 721C                 move.l  #ev8n-ev8,d1
 1659  0328F8 60000082             bra     eeq
 1660  0328FC B43C0009     ne8:    cmp.b   #9,d2
 1661  032900 6600000E             bne     ne9
 1662  032904 49F900030BFE         lea     ev9,a4
 1663  03290A 721C                 move.l  #ev9n-ev9,d1
 1664  03290C 6000006E             bra     eeq
 1665  032910 B43C000A     ne9:    cmp.b   #10,d2
 1666  032914 6600000E             bne     ne10
 1667  032918 49F900030C1A         lea     ev10,a4
 1668  03291E 721C                 move.l  #ev10n-ev10,d1
 1669  032920 6000005A             bra     eeq
 1670  032924 B43C000B     ne10:   cmp.b   #11,d2
 1671  032928 6600000E             bne     ne11
 1672  03292C 49F900030C36         lea     ev11,a4
 1673  032932 721C                 move.l  #ev11n-ev11,d1
 1674  032934 60000046             bra     eeq
 1675  032938 B43C000C     ne11:   cmp.b   #12,d2
 1676  03293C 6600000E             bne     ne12
 1677  032940 49F900030C52         lea     ev12,a4
 1678  032946 721C                 move.l  #ev12n-ev12,d1
 1679  032948 60000032             bra     eeq
 1680  03294C B43C000D     ne12:   cmp.b   #13,d2
 1681  032950 6600000E             bne     ne13
 1682  032954 49F900030C6E         lea     ev13,a4
 1683  03295A 721C                 move.l  #ev13n-ev13,d1
 1684  03295C 6000001E             bra     eeq
 1685  032960 B43C000E     ne13:   cmp.b   #14,d2
 1686  032964 6600000E             bne     ne14
 1687  032968 49F900030C8A         lea     ev14,a4
 1688  03296E 721C                 move.l  #ev14n-ev14,d1
 1689  032970 6000000A             bra     eeq
 1690  032974 49F900030CA6 ne14:   lea     ev15,a4
 1691  03297A 721C                 move.l  #ev15n-ev15,d1
 1692  03297C 4EB9000300D2 eeq:    jsr     pdata
 1693  032982 4CDF1006             movem.l (a7)+,d1/d2/a4
 1694  032986 4E75                 rts
 1695                      
 1696                      **
 1697                      ** LOHEX: print LS four bits in D0 as hex digit
 1698                      **
 1699                      *lohex:  and.b   #$0f,d0	* clear top 4 bits
 1700                      *        cmp.b   #10,d0	* greater than 10?
 1701                      *        bge     lohex1	* yes, continue
 1702                      *        add.b   #$30,d0	* add char offset
 1703                      *lohex2: jsr     outch	* output char
 1704                      *        rts     * return
 1705                      *lohex1: add.b   #$41-10,d0	* add "A"-10
 1706                      *        bra     lohex2	* continue
 1707                      **
 1708                      ** HIHEX: print MS four bits of D0 as hexadecimal d
 1708+                     igit
 1709                      **
 1710                      *hihex: rol.b    #4,d0	* swap nibbles
 1711                      *       jsr      lohex	* print it
 Motorola M68000 Assembler                                           Page  45

 1712                      *       rts		* return
 1713                      
 1714                      *
 1715                      * CH2HX2: print the two nibble values in D0 as two 
 1715+                     hex digits
 1716                      *         at the two cursor positions
 1717                      
 1718  032988 2F00         ch2hx2:move.l   d0,-(sp)		* save value
 1719  03298A 4EB9000301AE        jsr      hihex	* print ms 4 bits
 1720  032990 201F                move.l   (sp)+,d0		* restore value
 1721  032992 143C0034             move.b  #$34,d2
 1722  032996 163C0032             move.b  #$32,d3
 1723  03299A 4EB900031896        jsr      movec
 1724  0329A0 4EB900030190        jsr      lohex	* print ls 4 bits
 1725  0329A6 4E75                rts		* return
 1726                      *
 1727  0329A8 2F00         sdb:    move.l  d0,-(a7)          * Prints out the 
 1727+                     source and destination 
 1728  0329AA 2002                 move.l  d2,d0             * 4-bit address i
 1728+                     n hex
 1729  0329AC E848                 lsr.w   #4,d0
 1730  0329AE 143C0033             move.b  #$33,d2
 1731  0329B2 163C0031             move.b  #$31,d3
 1732  0329B6 4EB900031896         jsr     movec
 1733  0329BC 4EB900032988         jsr     ch2hx2
 1734  0329C2 201F                 move.l  (a7)+,d0
 1735  0329C4 4E75                 rts
 1736                      
 1737  0329C6 000003E8     dval:   dc.l    1000,100,10,1
 1738  0329D6 48E7F000     ptpn:   movem.l d0/d1/d2/d3,-(a7)      * prints out
 1738+                      the process id in decimal.
 1739  0329DA 7203                 move.l  #$03,d1             * max val = 102
 1739+                     3
 1740  0329DC 43F9000329C6         lea     dval,a1
 1741  0329E2 2619                 move.l  (a1)+,d3
 1742  0329E4 103C002F     pn1:    move.b  #$2f,d0
 1743  0329E8 5200         pn2:    add.b   #1,d0
 1744  0329EA 9483                 sub.l   d3,d2
 1745  0329EC 64FA                 bcc     pn2
 1746  0329EE D483                 add.l   d3,d2
 1747  0329F0 4EB90003008E         jsr     outch
 1748  0329F6 2619                 move.l  (a1)+,d3
 1749  0329F8 51C9FFEA             dbra    d1,pn1
 1750  0329FC 4CDF000F             movem.l (a7)+,d0/d1/d2/d3
 1751  032A00 4E75                 rts
 1752                      
 1753  032A02 48E76000     ptsp:   movem.l d1/d2,-(a7)         * print the sou
 1753+                     rce process id
 1754  032A06 7216                 move.l  #22,d1
 1755  032A08 E2AA                 lsr.l   d1,d2
 1756  032A0A C4BC000003FF         and.l   #$03ff,d2
 1757  032A10 4EB9000329D6         jsr     ptpn
 1758  032A16 4CDF0006             movem.l (a7)+,d1/d2
 1759  032A1A 4E75                 rts
 1760                      
 1761  032A1C 48E76000     ptdp:   movem.l d1/d2,-(a7)         * print the des
 1761+                     tination process id
 1762  032A20 720C                 move.l  #12,d1
 1763  032A22 E2AA                 lsr.l   d1,d2
 Motorola M68000 Assembler                                           Page  46

 1764  032A24 C4BC000003FF         and.l   #$03ff,d2
 1765  032A2A 4EB9000329D6         jsr     ptpn
 1766  032A30 4CDF0006             movem.l (a7)+,d1/d2
 1767  032A34 4E75                 rts
 1768                      
 1769  032A36 48E73000     evlog:  movem.l d2/d3,-(a7)       * logs an event t
 1769+                     o the screen
 1770  032A3A 143C0030             move.b  #$30,d2
 1771  032A3E 163C0037             move.b  #$37,d3
 1772  032A42 4EB900031896         jsr     movec
 1773  032A48 2400                 move.l  d0,d2             * EVENT PACKETS i
 1773+                     n D0 and D1.
 1774  032A4A 4EB90003276A         jsr     gttmp             * convert timesta
 1774+                     mp
 1775  032A50 4EB9000327DA         jsr     prtms             * print timestamp
 1776  032A56 143C0032             move.b  #$32,d2
 1777  032A5A 163C0034             move.b  #$34,d3
 1778  032A5E 4EB900031896         jsr     movec
 1779  032A64 2401                 move.l  d1,d2
 1780  032A66 4EB900032A02         jsr     ptsp              * print source pr
 1780+                     oc id
 1781  032A6C 143C0033             move.b  #$33,d2
 1782  032A70 163C0035             move.b  #$35,d3
 1783  032A74 4EB900031896         jsr     movec
 1784  032A7A 2401                 move.l  d1,d2
 1785  032A7C 4EB900032A1C         jsr     ptdp              * print destinati
 1785+                     on proc id
 1786                      *       move.l  d1,d2
 1787  032A82 4EB9000329A8         jsr     sdb
 1788  032A88 143C0034             move.b  #$34,d2
 1789  032A8C 163C0036             move.b  #$36,d3
 1790  032A90 4EB900031896         jsr     movec
 1791  032A96 2401                 move.l  d1,d2
 1792  032A98 4EB900032840         jsr     ptev              * print type of e
 1792+                     vent
 1793  032A9E 4CDF000C             movem.l (a7)+,d2/d3
 1794  032AA2 4E75                 rts
 1795                      ***************************************************
 1795+                     *************
 1796                      
 1797  032AA4 4EB9000324F0 chst2:  jsr    akey               * Checks the stat
 1797+                     us register and take
 1798  032AAA 083900000002         btst   #0,stats2          * necessary actio
 1798+        0013         n
 1799  032AB2 66000912             bne    error              * error condition
 1799+                      - flag error and hang
 1800  032AB6 083900010002         btst   #1,stats2
 1801  032ABE 66E4                 bne    chst2              * Halt - cycle un
 1801+                     til condition cleared
 1802  032AC0 083900020002         btst   #2,stats2          * also interupts 
 1802+        0013         should be disabled.
 1803  032AC8 66DA                 bne    chst2              * screen lock - c
 1803+                     ycle until condition cleared
 1804                      *        btst   #3,stats2          * Waiting for ev
 1804+                     ent- wait until another event
 1805                      *        bne    chst2              * arrives.
 1806                      *        btst   #4,stats2
 1807                      *        bne    chst2
 1808  032ACA 4E75                 rts
 Motorola M68000 Assembler                                           Page  47

 1809                      
 1810  032ACC 48E7C0C0     fetchv: movem.l d0/d1/a0/a1,-(a7)
 1811  032AD0 4CDF0303             movem.l (a7)+,d0/d1/a0/a1
 1812  032AD4 4E75                 rts
 1813                      
 1814  032AD6 48E7B000     lgln:   movem.l d0/d2/d3,-(a7)      * Scrolls insid
 1814+                     e the graphics window
 1815  032ADA 4EB900031A6A         jsr    wind1a               * to allow new 
 1815+                     events to be printed
 1816  032AE0 343C3137             move.w #$3137,d2            * of the window
 1816+                     .
 1817  032AE4 363C3031             move.w #$3031,d3
 1818  032AE8 4EB9000313C8         jsr    moveto
 1819  032AEE 103C000A             move.b #lf,d0
 1820  032AF2 4EB90003008E         jsr    outch
 1821  032AF8 103C000D             move.b #cr,d0
 1822  032AFC 4EB90003008E         jsr    outch
 1823  032B02 4EB90003184E         jsr    grmode
 1824  032B08 4EB900032580         jsr    ptlgln
 1825  032B0E 4EB900031872         jsr    nmode
 1826  032B14 4CDF000D             movem.l (a7)+,d0/d2/d3
 1827  032B18 4E75                 rts
 1828                      
 1829  032B1A 48E7F800     ptctpk: movem.l d0/d1/d2/d3/d4,-(a7)
 1830  032B1E 3800                 move.w  d0,d4              * backup MSLong 
 1830+                     word.
 1831  032B20 343C0031             move.w  #$31,d2            * move to begini
 1831+                     ng of the line
 1832  032B24 363C0032             move.w  #$32,d3            * to print seque
 1832+                     nce number.
 1833  032B28 4EB900031896         jsr     movec              *  jump to posit
 1833+                     ion.
 1834  032B2E E088                 lsr.l   #8,d0              * Shift out dest
 1834+                     . addr.
 1835  032B30 E088                 lsr.l   #8,d0              * Shift out sour
 1835+                     ce address.
 1836  032B32 3400                 move.w  d0,d2              * backup again.
 1837  032B34 E04A                 lsr.w   #8,d2
 1838  032B36 4EB9000329D6         jsr     ptpn               * Prints value i
 1838+                     n decimal.
 1839  032B3C 343C0034             move.w  #$34,d2
 1840  032B40 363C0038             move.w  #$38,d3
 1841  032B44 4EB900031896         jsr     movec
 1842  032B4A 4EB9000301B8         jsr     ch2hex              * Print the con
 1842+                     trol field of the centnt Pk.
 1843  032B50 4EB90003013A         jsr     pspac4
 1844  032B56 3004                 move.w  d4,d0
 1845  032B58 E048                 lsr.w   #8,d0               * Print the sou
 1845+                     rce addr of the Centrenet Pk.
 1846  032B5A 4EB9000301B8         jsr     ch2hex
 1847  032B60 4EB90003013A         jsr     pspac4
 1848  032B66 1004                 move.b  d4,d0               * Print the des
 1848+                     tination address of the C Pk.
 1849  032B68 4EB9000301B8         jsr     ch2hex
 1850  032B6E 4EB900030140         jsr     pspac3
 1851  032B74 4EB9000301EA         jsr     ch8hex              * Print the dat
 1851+                     a field held in D1.
 1852  032B7A 4CDF001F             movem.l (a7)+,d0/d1/d2/d3/d4
 1853  032B7E 4E75                 rts
 Motorola M68000 Assembler                                           Page  48

 1854                      
 1855  032B80 48E7C080     anypks: movem.l a0/d0/d1,-(a7)     * Routine will c
 1855+                     lear carry flag if there are 
 1856  032B84 207C00020080         move.l  dbadrw,a0          * valid entries 
 1856+                     in the database still to be
 1857  032B8A 2018                 move.l  (a0)+,d0           * displayed.
 1858  032B8C 2210                 move.l  (a0),d1
 1859  032B8E 9081                 sub.l   d1,d0
 1860  032B90 B0BC00000008         cmp.l   #08,d0
 1861  032B96 6C00000A             bge     yes 
 1862                      * Test for end of database memory space. Set flag a
 1862+                     nd disable fifo interupt.
 1863                      *
 1864  032B9A 003C0001             or.b    #$01,ccr
 1865  032B9E 60000006             bra     exi
 1866  032BA2 023C00FE     yes:    and.b   #$fe,ccr            * Clear the car
 1866+                     ry flag
 1867  032BA6 4CDF0103     exi:    movem.l (a7)+,a0/d0/d1
 1868  032BAA 4E75                 rts
 1869                      
 1870                      
 1871  032BAC 48E7C0C0     scrn3:  movem.l d0/d1/a0/a1,-(a7)   * If there is a
 1871+                     n event yet to be displayed
 1872  032BB0 4EB900032AA4         jsr    chst2                * print it othe
 1872+                     rwise update status and exit
 1873  032BB6 227C00020013         move.l  #stats2,a1
 1874  032BBC 1211                 move.b  (a1),d1
 1875  032BBE 4EB900032B80         jsr     anypks
 1876  032BC4 6400001C             bcc     rdev
 1877  032BC8 003900080002         or.b    #$08,stats2
 1878  032BD0 08010003             btst    #3,d1
 1879  032BD4 66000052             bne     nchnge
 1880  032BD8 4EB90003141E         jsr     upst
 1881  032BDE 60000048             bra     nchnge
 1882  032BE2 023900F70002 rdev:   and.b   #$f7,stats2
 1883  032BEA 08010003             btst    #3,d1
 1884  032BEE 67000008             beq     nchg
 1885  032BF2 4EB90003141E         jsr     upst
 1886  032BF8 4EB900032AD6 nchg:   jsr    lgln             * an event to be pr
 1886+                     inted
 1887  032BFE 207C00020084         move.l  dbadrr,a0
 1888  032C04 2250                 move.l  (a0),a1
 1889  032C06 2019                 move.l  (a1)+,d0        * Move MS word of e
 1889+                     vent packet to D0.
 1890  032C08 2219                 move.l  (a1)+,d1        * Move LS word of e
 1890+                     vent packet to D1.
 1891  032C0A 2089                 move.l  a1,(a0)
 1892                      *        move.l  d0,d2
 1893                      *        and.l   #$ff000000,d2
 1894                      *        cmp.l   #$ff000000,d2   * Test for Centren
 1894+                     et Packet.
 1895                      *        bne     lgev
 1896  032C0C 083900050002         btst    #5,stats2
 1897  032C14 6700000C             beq     lgev
 1898  032C18 4EB900032B1A         jsr     ptctpk
 1899  032C1E 60000008             bra     nchnge
 1900  032C22 4EB900032A36 lgev:   jsr    evlog            * display event
 1901  032C28 4EB9000324F0 nchnge: jsr    akey             * Check to see if a
 1901+                      key has been pressed.
 Motorola M68000 Assembler                                           Page  49

 1902  032C2E 4CDF0303             movem.l (a7)+,d0/d1/a0/a1
 1903  032C32 4E75                 rts
 1904                      
 1905  032C34 4EB9000326D8 inevlg: jsr    evlg1            * set up and displa
 1905+                     y graphics window
 1906  032C3A 4EB900032612         jsr    evlg2            * for event log mon
 1906+                     itoring.
 1907  032C40 4EB90003141E         jsr    upst
 1908  032C46 4EB9000315B8 evg:    jsr    clrled
 1909  032C4C 4EB900032BAC         jsr    scrn3
 1910                      *       jsr    upst
 1911  032C52 4EB9000324F0         jsr    akey
 1912  032C58 083900070002         btst   #7,status        * Check if a change
 1912+        0012          of mode has been
 1913  032C60 66E4                 bne    evg              * indicated by key 
 1913+                     board support routines
 1914  032C62 4E75                 rts
 1915                      
 1916  032C64 143C0004     shdiag: move.b #04,d2           * Change screen for
 1916+                     mat and print out 
 1917  032C68 4EB9000316C4         jsr    smthsc           * information on cu
 1917+                     rrent hardware and 
 1918  032C6E 4EB900031656         jsr    windf2           * software being us
 1918+                     ed.
 1919  032C74 4EB900031686         jsr    cls
 1920  032C7A 343C3031             move.w #$3031,d2
 1921  032C7E 363C3031             move.w #$3031,d3
 1922  032C82 4EB9000313C8         jsr    moveto
 1923  032C88 49F900030CE6         lea    diagnp,a4
 1924  032C8E 223C00000442         move.l #diagnn-diagnp,d1
 1925  032C94 4EB9000300D2         jsr    pdata
 1926                      *        move.b #00,d2
 1927                      *        jsr    smthsc
 1928  032C9A 4EB9000324F0 shdig:  jsr    akey
 1929  032CA0 083900040002         btst   #4,status
 1930  032CA8 66F0                 bne    shdig
 1931  032CAA 4E75                 rts
 1932                      
 1933                      ***************************************************
 1933+                     ******************
 1934                      
 1935  032CAC 48           fint1p: dc.b   'Hardware Filtering by'
 1936  032CC2 00000000     fint1n: ds.w   0
 1937  032CC2 42           fint2p: dc.b   'Bounded Centrenet Board Addresses'
 1938  032CE4 00000000     fint2n: ds.w   0
 1939  032CE4 53           fint3p: dc.b   'Source Address Filter              
 1939+ 032CE5 6F             Destination Address Filter'
 1940  032D24 00000000     fint3n: ds.w   0
 1941  032D24 4C           flbp:   dc.b   'Lower Bound'
 1942  032D30 00000000     flbn:   ds.w   0
 1943  032D30 55           fubp:   dc.b   'Upper Bound'
 1944  032D3C 00000000     fubn:   ds.w   0
 1945  032D3C 20           fadp:   dc.b   '  Address'
 1946  032D46 00000000     fadn:   ds.w   0
 1947  032D46 20           fconp:  dc.b   ' Condition'
 1948  032D50 00000000     fconn:  ds.w   0
 1949  032D50 4F           fonp:   dc.b   'ON '
 1950  032D54 00000000     fonn:   ds.w   0
 1951  032D54 4F           foffp:  dc.b   'OFF'
 Motorola M68000 Assembler                                           Page  50

 1952  032D58 00000000     foffn:  ds.w   0
 1953  032D58 49           finp:   dc.b   'IN '
 1954  032D5C 00000000     finn:   ds.w   0
 1955  032D5C 4F           foutp:  dc.b   'OUT'
 1956  032D60 00000000     foutn:  ds.w   0
 1957  032D60 54           fhelp:  dc.b   'To change options, use two letter c
 1957+ 032D61 6F           odes as described'
 1958  032D94 20                   dc.b   ' ( * = HEX digit ).       '
 1959  032DAE 0A                   dc.b   lf,cr
 1960  032DB0 20                   dc.b   ' (S) to identify Source and (D) to 
 1960+ 032DB1 28           identify Destination.'
 1961  032DE8 20                   dc.b   ' Then (I) or (L) or (U)'
 1962  032DFF 0A                   dc.b   lf,cr
 1963  032E01 74                   dc.b   'to toggle "the Active Filter Range"
 1963+ 032E02 6F            or Lower or Upper '
 1964  032E37 42                   dc.b   'Bounds respectively.     '
 1965  032E50 0A                   dc.b   lf,cr
 1966  032E52 20                   dc.b   ' (L) or (U) followed by ** sets the
 1966+ 032E53 28            corresponding Address'
 1967  032E8B 20                   dc.b   ' Values.  (X) to exit.'
 1968  032EA2 00000000     fhelpn: ds.w   0
 1969                      
 1970  032EA2 49F900032D50 fpon:   lea    fonp,a4
 1971  032EA8 7204                 move.l #fonn-fonp,d1
 1972  032EAA 4EB9000300D2         jsr    pdata
 1973  032EB0 4E75                 rts
 1974                      
 1975  032EB2 49F900032D54 fpoff:  lea    foffp,a4
 1976  032EB8 7204                 move.l #foffn-foffp,d1
 1977  032EBA 4EB9000300D2         jsr    pdata
 1978  032EC0 4E75                 rts
 1979                      
 1980  032EC2 49F900032D58 fpin:   lea    finp,a4
 1981  032EC8 7204                 move.l #finn-finp,d1
 1982  032ECA 4EB9000300D2         jsr    pdata
 1983  032ED0 4E75                 rts
 1984                      
 1985  032ED2 49F900032D5C fpout:  lea    foutp,a4
 1986  032ED8 7204                 move.l #foutn-foutp,d1
 1987  032EDA 4EB9000300D2         jsr    pdata
 1988  032EE0 4E75                 rts
 1989                      
 1990  032EE2 49F900032D24 fplb:   lea    flbp,a4
 1991  032EE8 720C                 move.l #flbn-flbp,d1
 1992  032EEA 4EB9000300D2         jsr    pdata
 1993  032EF0 4E75                 rts
 1994                      
 1995  032EF2 49F900032D30 fpub:   lea    fubp,a4
 1996  032EF8 720C                 move.l #fubn-fubp,d1
 1997  032EFA 4EB9000300D2         jsr    pdata
 1998  032F00 4E75                 rts
 1999                      
 2000  032F02 49F900032D3C fpad:   lea    fadp,a4
 2001  032F08 720A                 move.l #fadn-fadp,d1
 2002  032F0A 4EB9000300D2         jsr    pdata
 2003  032F10 4E75                 rts
 2004                      
 2005  032F12 49F900032D46 fpcon:  lea    fconp,a4
 2006  032F18 720A                 move.l #fconn-fconp,d1
 Motorola M68000 Assembler                                           Page  51

 2007  032F1A 4EB9000300D2         jsr    pdata
 2008  032F20 4E75                 rts
 2009                      
 2010  032F22 343C3033     fintro: move.w #$3033,d2
 2011  032F26 363C3238             move.w #$3238,d3
 2012  032F2A 4EB9000313C8         jsr    moveto
 2013  032F30 343C3038             move.w #$3038,d2
 2014  032F34 4EB9000316FE         jsr    attr
 2015  032F3A 7216                 move.l #fint1n-fint1p,d1
 2016  032F3C 49F900032CAC         lea    fint1p,a4
 2017  032F42 4EB9000300D2         jsr    pdata
 2018  032F48 4EB900031736         jsr    clratt
 2019  032F4E 7222                 move.l #fint2n-fint2p,d1
 2020  032F50 49F900032CC2         lea    fint2p,a4
 2021  032F56 343C3035             move.w #$3035,d2
 2022  032F5A 363C3232             move.w #$3232,d3
 2023  032F5E 4EB9000313C8         jsr    moveto
 2024  032F64 343C3038             move.w #$3038,d2
 2025  032F68 4EB9000316FE         jsr    attr
 2026  032F6E 4EB9000300D2         jsr    pdata
 2027  032F74 4EB900031736         jsr    clratt
 2028  032F7A 49F900032CE4         lea    fint3p,a4
 2029  032F80 7240                 move.l #fint3n-fint3p,d1
 2030  032F82 343C3038             move.w #$3038,d2
 2031  032F86 363C3130             move.w #$3130,d3
 2032  032F8A 4EB9000313C8         jsr    moveto
 2033  032F90 4EB9000300D2         jsr    pdata
 2034  032F96 343C3131             move.w #$3131,d2
 2035  032F9A 363C3132             move.w #$3132,d3
 2036  032F9E 4EB9000313C8         jsr    moveto
 2037  032FA4 4EB900032EE2         jsr    fplb
 2038  032FAA 343C3131             move.w #$3131,d2
 2039  032FAE 363C3532             move.w #$3532,d3
 2040  032FB2 4EB9000313C8         jsr    moveto
 2041  032FB8 4EB900032EE2         jsr    fplb
 2042  032FBE 343C3134             move.w #$3134,d2
 2043  032FC2 363C3132             move.w #$3132,d3
 2044  032FC6 4EB9000313C8         jsr    moveto
 2045  032FCC 4EB900032EF2         jsr    fpub
 2046  032FD2 343C3134             move.w #$3134,d2
 2047  032FD6 363C3532             move.w #$3532,d3
 2048  032FDA 4EB9000313C8         jsr    moveto
 2049  032FE0 4EB900032EF2         jsr    fpub
 2050  032FE6 343C3132             move.w #$3132,d2
 2051  032FEA 363C3132             move.w #$3132,d3
 2052  032FEE 4EB9000313C8         jsr    moveto
 2053  032FF4 4EB900032F02         jsr    fpad
 2054  032FFA 343C3132             move.w #$3132,d2
 2055  032FFE 363C3532             move.w #$3532,d3
 2056  033002 4EB9000313C8         jsr    moveto
 2057  033008 4EB900032F02         jsr    fpad
 2058  03300E 343C3135             move.w #$3135,d2
 2059  033012 363C3132             move.w #$3132,d3
 2060  033016 4EB9000313C8         jsr    moveto
 2061  03301C 4EB900032F02         jsr    fpad
 2062  033022 343C3135             move.w #$3135,d2
 2063  033026 363C3532             move.w #$3532,d3
 2064  03302A 4EB9000313C8         jsr    moveto
 2065  033030 4EB900032F02         jsr    fpad
 Motorola M68000 Assembler                                           Page  52

 2066  033036 343C3137             move.w #$3137,d2
 2067  03303A 363C3132             move.w #$3132,d3
 2068  03303E 4EB9000313C8         jsr    moveto
 2069  033044 4EB900032F12         jsr    fpcon
 2070  03304A 343C3137             move.w #$3137,d2
 2071  03304E 363C3532             move.w #$3532,d3
 2072  033052 4EB9000313C8         jsr    moveto
 2073  033058 4EB900032F12         jsr    fpcon
 2074  03305E 4E75                 rts
 2075                      
 2076  033060 343C3131     fudo:   move.w #$3131,d2
 2077  033064 363C3235             move.w #$3235,d3
 2078  033068 4EB9000313C8         jsr    moveto
 2079  03306E 083900030002         btst   #3,filctl
 2080  033076 6700000C             beq    f3f
 2081  03307A 4EB900032EA2         jsr    fpon
 2082  033080 60000008             bra    f2
 2083  033084 4EB900032EB2 f3f:    jsr    fpoff
 2084  03308A 343C3134     f2:     move.w #$3134,d2
 2085  03308E 363C3235             move.w #$3235,d3
 2086  033092 4EB9000313C8         jsr    moveto
 2087  033098 083900020002         btst   #2,filctl
 2088  0330A0 6700000C             beq    f2f
 2089  0330A4 4EB900032EA2         jsr    fpon
 2090  0330AA 60000008             bra    f7
 2091  0330AE 4EB900032EB2 f2f:    jsr    fpoff
 2092  0330B4 343C3131     f7:     move.w #$3131,d2
 2093  0330B8 363C3635             move.w #$3635,d3
 2094  0330BC 4EB9000313C8         jsr    moveto
 2095  0330C2 083900070002         btst   #7,filctl
 2096  0330CA 6700000C             beq    f7f
 2097  0330CE 4EB900032EA2         jsr    fpon
 2098  0330D4 60000008             bra    f6
 2099  0330D8 4EB900032EB2 f7f:    jsr    fpoff
 2100  0330DE 343C3134     f6:     move.w #$3134,d2
 2101  0330E2 363C3635             move.w #$3635,d3
 2102  0330E6 4EB9000313C8         jsr    moveto
 2103  0330EC 083900060002         btst   #6,filctl
 2104  0330F4 6700000C             beq    f6f
 2105  0330F8 4EB900032EA2         jsr    fpon
 2106  0330FE 60000008             bra    f0
 2107  033102 4EB900032EB2 f6f:    jsr    fpoff
 2108  033108 343C3137     f0:     move.w #$3137,d2
 2109  03310C 363C3235             move.w #$3235,d3
 2110  033110 4EB9000313C8         jsr    moveto
 2111  033116 083900000002         btst   #0,filctl
 2112  03311E 6700000C             beq    f0f
 2113  033122 4EB900032EC2         jsr    fpin
 2114  033128 60000008             bra    f4
 2115  03312C 4EB900032ED2 f0f:    jsr    fpout
 2116  033132 363C3635     f4:     move.w #$3635,d3
 2117  033136 343C3137             move.w #$3137,d2
 2118  03313A 4EB9000313C8         jsr    moveto
 2119  033140 083900040002         btst   #4,filctl
 2120  033148 6700000A             beq    f4f
 2121  03314C 4EB900032EC2         jsr    fpin
 2122  033152 4E75                 rts
 2123  033154 4EB900032ED2 f4f:    jsr    fpout
 2124  03315A 4E75                 rts
 Motorola M68000 Assembler                                           Page  53

 2125                      
 2126  03315C 343C3132     fuad:   move.w #$3132,d2
 2127  033160 363C3235             move.w #$3235,d3
 2128  033164 4EB9000313C8         jsr    moveto
 2129  03316A 303900020016         move.w scbnds,d0
 2130  033170 4EB9000301B8         jsr    ch2hex
 2131  033176 343C3135             move.w #$3135,d2
 2132  03317A 363C3235             move.w #$3235,d3
 2133  03317E 4EB9000313C8         jsr    moveto
 2134  033184 303900020016         move.w scbnds,d0
 2135  03318A E048                 lsr.w  #8,d0
 2136  03318C 4EB9000301B8         jsr    ch2hex
 2137  033192 343C3132             move.w #$3132,d2
 2138  033196 363C3635             move.w #$3635,d3
 2139  03319A 4EB9000313C8         jsr    moveto
 2140  0331A0 303900020018         move.w dtbnds,d0
 2141  0331A6 4EB9000301B8         jsr    ch2hex
 2142  0331AC 343C3135             move.w #$3135,d2
 2143  0331B0 363C3635             move.w #$3635,d3
 2144  0331B4 4EB9000313C8         jsr    moveto
 2145  0331BA 303900020018         move.w dtbnds,d0
 2146  0331C0 E048                 lsr.w  #8,d0
 2147  0331C2 4EB9000301B8         jsr    ch2hex
 2148  0331C8 4E75                 rts
 2149                      
 2150  0331CA 4EB90003008E fqury:  jsr    outch
 2151  0331D0 4EB900031AB2         jsr    wind2
 2152  0331D6 343C3230             move.w #$3230,d2
 2153  0331DA 363C3031             move.w #$3031,d3
 2154  0331DE 4EB9000313C8         jsr    moveto
 2155  0331E4 49F900032D60         lea    fhelp,a4
 2156  0331EA 223C00000142         move.l #fhelpn-fhelp,d1
 2157  0331F0 4EB9000300D2         jsr    pdata
 2158  0331F6 600000DE             bra    fnwchr
 2159                      
 2160  0331FA 4EB90003008E fkeys:  jsr    outch
 2161  033200 383C0000             move.w #0,d4
 2162  033204 4EB900030064         jsr    inchu
 2163  03320A B03C000D             cmp.b  #cr,d0             * If carriage ret
 2163+                     urn then toggle both
 2164  03320E 6600001E             bne    fkcr               * lower and Upper
 2164+                      bound flags.
 2165  033212 4EB90003008E         jsr    outch
 2166  033218 0604000C             addi.b #$c,d4
 2167  03321C E72C                 lsl.b  d3,d4
 2168  03321E B93900020021         eor.b  d4,filctl
 2169  033224 4EB900033060         jsr    fudo
 2170  03322A 600000AA             bra    fnwchr
 2171  03322E B03C0049     fkcr:   cmp.b  #$49,d0            * If 'I' then tog
 2171+                     gle In/out flag.
 2172  033232 6600001E             bne    fkni
 2173  033236 4EB90003008E         jsr    outch
 2174  03323C 06040001             addi.b #1,d4
 2175  033240 E72C                 lsl.b  d3,d4
 2176  033242 B93900020021         eor.b  d4,filctl
 2177  033248 4EB900033060         jsr    fudo
 2178  03324E 60000086             bra    fnwchr
 2179  033252 B03C004C     fkni:   cmp.b  #$4c,d0            * If 'L' check fo
 2179+                     r following hexd digits
 Motorola M68000 Assembler                                           Page  54

 2180  033256 6600003A             bne    fknl
 2181  03325A 4EB90003008E         jsr    outch
 2182  033260 4EB90003029A         jsr    sin2hx
 2183  033266 65000014             bcs    fkl
 2184  03326A D1FC00000001         adda.l #1,a0
 2185  033270 1080                 move.b d0,(a0)
 2186  033272 4EB90003315C         jsr    fuad
 2187  033278 6000005C             bra    fnwchr
 2188  03327C 06040008     fkl:    addi.b #$8,d4
 2189  033280 E72C                 lsl.b  d3,d4
 2190  033282 B93900020021         eor.b  d4,filctl
 2191  033288 4EB900033060         jsr    fudo
 2192  03328E 60000046             bra    fnwchr
 2193  033292 B03C0055     fknl:   cmp.b  #$55,d0            * If 'U' then see
 2193+                      if followed by hex digits
 2194  033296 6600003E             bne    fnwchr
 2195  03329A 4EB90003008E         jsr    outch
 2196  0332A0 4EB90003029A         jsr    sin2hx
 2197  0332A6 6500000E             bcs    fku                * No hex digits
 2198  0332AA 1080                 move.b d0,(a0)            * Hex digits so u
 2198+                     pdate address values
 2199  0332AC 4EB90003315C         jsr    fuad
 2200  0332B2 60000022             bra    fnwchr
 2201  0332B6 06040004     fku:    addi.b #$4,d4
 2202  0332BA E72C                 lsl.b  d3,d4
 2203  0332BC B93900020021         eor.b  d4,filctl
 2204  0332C2 4EB900033060         jsr    fudo
 2205  0332C8 6000000C             bra    fnwchr
 2206                      
 2207  0332CC 143C0000     fkey:   move.b #0,d2
 2208  0332D0 4EB9000316C4         jsr    smthsc
 2209  0332D6 4EB900031EEE fnwchr: jsr    lprom
 2210  0332DC 4EB900030064 fnchr:  jsr    inchu
 2211  0332E2 B03C000D             cmp.b  #cr,d0             * If cr then new 
 2211+                     promt
 2212  0332E6 6600000A             bne    fncr
 2213  0332EA 4EB90003008E         jsr    outch
 2214  0332F0 60E4                 bra    fnwchr
 2215  0332F2 B03C0058     fncr:   cmp.b  #$58,d0            * If X then quit 
 2215+                     mode by setting H'ware
 2216  0332F6 6700E9D6             beq    fset               * to new values.
 2217  0332FA B03C003F             cmp.b  #$3f,d0            * If '?' then pri
 2217+                     nt help message
 2218  0332FE 6700FECA             beq    fqury
 2219  033302 B03C0053             cmp.b  #$53,d0            * If 'S' then fet
 2219+                     ch source address and 
 2220  033306 66000010             bne    fns                * set d3 which is
 2220+                      the flag to control
 2221  03330A 41F900020016         lea    scbnds,a0          * bit toggling in
 2221+                      the control register.
 2222  033310 163C0000             move.b #0,d3
 2223  033314 6000FEE4             bra    fkeys
 2224  033318 B03C0044     fns:    cmp.b  #$44,d0            * If 'D' the fetc
 2224+                     h destination add as above.
 2225  03331C 66000010             bne    fnd
 2226  033320 41F900020018         lea    dtbnds,a0
 2227  033326 163C0004             move.b #4,d3
 2228  03332A 6000FECE             bra    fkeys
 2229  03332E 4EB90003010C fnd:    jsr    pbell              *Else invalid 
 Motorola M68000 Assembler                                           Page  55

 2230  033334 60A6                 bra    fnchr
 2231  033336 4E75         fend:   rts
 2232                      
 2233  033338 4EB900031656 filtch: jsr    windf2
 2234  03333E 4EB900031686         jsr    cls
 2235  033344 4EB900032F22         jsr    fintro
 2236  03334A 4EB900033060         jsr    fudo
 2237  033350 4EB90003315C         jsr    fuad
 2238  033356 4EB9000332CC         jsr    fkey
 2239                      *
 2240                      * Intro
 2241                      * Fetch current values
 2242                      * Allow updates to values
 2243                      * set new values and exit.
 2244                      *
 2245  03335C 4EB90003008E         jsr    outch              *output final 'F'
 2245+                      char
 2246  033362 4EB900031EEE         jsr    lprom              * shift up promt
 2247  033368 143C0004             move.b #4,d2
 2248  03336C 4EB9000316C4         jsr    smthsc             * diasable smooth
 2248+                      scrolling.
 2249                      
 2250  033372 4EB9000324F0 ftch:   jsr    akey
 2251  033378 083900050002         btst   #5,status
 2252  033380 66F0                 bne    ftch
 2253  033382 4E75                 rts
 2254                      
 2255                      ***************************************************
 2255+                     ******************
 2256                      
 2257  033384 4EB900031978 inlsc2: jsr    linsc1         * setup for event lin
 2257+                     e monitoring
 2258  03338A 4EB900031A2E         jsr    linsc2
 2259  033390 4EB90003141E         jsr    upst
 2260  033396 4EB9000324F0 lsc:    jsr    akey
 2261  03339C 083900060002         btst   #6,status
 2262  0333A4 66F0                 bne    lsc
 2263  0333A6 4E75                 rts
 2264                      
 2265  0333A8 4EB900031656 quitt:  jsr    windf2        * Routine to shutdown 
 2265+                     monitor.
 2266  0333AE 4EB900031686         jsr    cls
 2267  0333B4 007C0700             or.w  #$0700,sr      * disable interupts
 2268                      *       jsr    redrt
 2269  0333B8 4EB90003176C         jsr    intscn
 2270  0333BE 4E40                 trap   #0
 2271  0333C0 4EF9000333C0 stop:   jmp    stop
 2272                      
 2273  0333C6 343C3033     error:  move.w #$3033,d2     * Fatal system errors 
 2273+                     will be flagged
 2274  0333CA 363C3631             move.w #$3631,d3     * and currently monito
 2274+                     r will hang.
 2275  0333CE 4EB9000313C8         jsr    moveto
 2276  0333D4 49F900030ADE         lea    err,a4
 2277  0333DA 7212                 move.l #errn-err,d1
 2278  0333DC 4EB9000300D2         jsr    pdata
 2279  0333E2 4EF9000333E2 err1:   jmp    err1
 2280                      
 2281  0333E8 4EB900032AA4 chgst:  jsr    chst2         * Routine to change mo
 Motorola M68000 Assembler                                           Page  56

 2281+                     de of operation of the
 2282                      *       btst   #0,status     * monitor.
 2283                      *       beq    nxtst4
 2284                      *       move.l stack,a7     ***   Clear the stack
 2285                      *       bra    start
 2286  0333EE 083900020002         btst   #2,status     * quit the monitor
 2287  0333F6 67000004             beq    nxtst
 2288  0333FA 4E75                 rts
 2289  0333FC 083900040002 nxtst:  btst   #4,status
 2290  033404 67000008             beq    nxtst1
 2291  033408 4EB900032C64         jsr    shdiag        * print out system inf
 2291+                     ormation
 2292  03340E 083900050002 nxtst1: btst   #5,status
 2293  033416 67000008             beq    nxtst2
 2294  03341A 4EB900033338         jsr    filtch        * update hardware filt
 2294+                     er addresses
 2295  033420 083900060002 nxtst2: btst   #6,status
 2296  033428 67000008             beq    nxtst3
 2297  03342C 4EB900033384         jsr    inlsc2        * Event line monitorin
 2297+                     g.
 2298  033432 083900070002 nxtst3: btst   #7,status
 2299  03343A 67000008             beq    nwscn
 2300  03343E 4EB900032C34         jsr    inevlg        * Event log monitoring
 2300+                     .
 2301  033444 207C00020012 nwscn:  move.l #status,a0
 2302  03344A 1010                 move.b (a0),d0
 2303                      *        lsr.w  #8,d0
 2304  03344C B03C0000             cmp.b  #00,d0
 2305  033450 6696                 bne    chgst
 2306  033452 4EB90003166E         jsr    windf         * If no mode active dr
 2306+                     aw intro screen
 2307  033458 4EB900031686         jsr    cls
 2308  03345E 4EB90003176C         jsr    intscn
 2309  033464 4EB900031EEE         jsr    lprom
 2310  03346A 4EB9000324F0 nwscn2: jsr    akey
 2311  033470 207C00020012         move.l #status,a0    * wait to move into an
 2311+                      active mode.
 2312  033476 1010                 move.b (a0),d0
 2313                      *        lsr.w  #8,d0
 2314  033478 B03C0000             cmp.b  #00,d0
 2315  03347C 67EC                 beq    nwscn2
 2316  03347E 6000FF68             bra    chgst
 2317                      
 2318  033482 007C0700     exitmn: or.w   #$0700,sr    * disable all interrupt
 2318+                     s
 2319  033486 103900020023         move.b hwcnt,d0
 2320  03348C 803C00FF             or.b   #$ff,d0      * switch off both leds,
 2320+                     read requests and interupts
 2321  033490 13C000070000         move.b d0,led       * requests to other pro
 2321+                     cessor and controllers.
 2322  033496 13C000020023         move.b d0,hwcnt
 2323  03349C 4E75                 rts
 2324                      
 2325         00035000             org    $035000
 2326                      
 2327  035000 4EB900031D0E start:  jsr    init         * setup register, datab
 2327+                     ase and duart
 2328  035006 4EB900030064         jsr    inchu
 2329  03500C 4EB9000333E8         jsr    chgst        * Get monitor mode and 
 Motorola M68000 Assembler                                           Page  57

 2329+                     cycle thro modes until
 2330  035012 4EB900033482         jsr    exitmn       * Shut down monitor i.e
 2330+                     .
 2331  035018 4EB9000315D0         jsr    grnled       * quit. light green led
 2331+                      for okay
 2332                      
 2333  03501E 4EF9000333A8         jmp    quitt
 2334                      *       jmp    stop
 2335                      *
 2336                      
 2337                      *
 2338                      ***************************************************
 2338+                     ****************
 2339                      **      Interupt vector - for use with running the 
 2339+                     68000 software monitor.
 2340                      
 2341         0003FE50             org    $03fe50
 2342  03FE50 4EF900032438         jmp    chinp
 2343         0003FE60             org    $03fe60
 2344  03FE60 4EF900031516         jmp    ffserv
 2345         0003FE68             org    $03fe68
 2346  03FE68 4EF90003157A         jmp    acksrv
 2347                      *
 2348                              END

No faults and no warnings in this assembly.
