Test_Sort_EM_Jet_List_1   IDNT                             ; title

        INCLUDE 68020_EQUATES.INC        ; Get the MVME133A BUG ROM Calls.

        ORG     $10000                   ; start of code (MVME133A).


*************************************************************************
*       This section defines program-specific macros:                   *
*                                                                       *
*            RDIO:  Read bit from IRONICS I/O card and returns state    *
*            WRIO:  Write bit(s) to the IRONICS I/O card                *
*            SOFTWAIT:  Software delay timer for short waits            *
*                                                                       *
*************************************************************************

RDIO    MACRO                                 ; read byte from I/O port.
        CMPI.B  #BIT1HIGH,\1                  ; is selected line high?
        ENDM                                  ; set Z on result.

WRIO    MACRO                                 ; write byte to I/O port.
        NOT.B   \1                            ; complement input.
        MOVE.B  \1,\2                         ; and send to port.
        ENDM

SOFTWAIT   MACRO                              ; Software timer loop.
           LOCAL    WAITMORE                  ; Define a local symbol.
           MOVE.L   \1,D4                     ; Load delay time into D4.
WAITMORE   SUBI.L   #1,D4                     ; Decrement loop counter.
           BNE      WAITMORE                  ; Test for end of delay.
           ENDM                               ; Called with an argument
                                              ; of $1000 causes a delay
                                              ; of about 3 mill seconds.


        MOVE.L   #1,D0                   ; Get the Cashe running
        Move.L   #val1,D0
        Move.L   #val1+val2,D0
        Move.L   #val1+val2+100,D0


val1   EQU    1
val2   EQU    2

        end     ;************************************



        PEA.L   HELLOloc                 ; push message address on stack.
        SYSCALL .WRITELN                 ; and send it out.

        MOVE.L   #1,D0                   ; Get the Cashe running
        MOVEC   D0,CACR

        Move.W   #$608b,$fff80000         ; was $6083 ,  $608b will force DCTS

OMT     SOFTWAIT  #$800000                ; Wait about 4 seconds.

        PEA.L   HELLOloc2                 ; push message address on stack.
        SYSCALL .WRITELN                 ; and send it out.

        JMP     OMT


        SYSCALL .return                  ; return to the bug


HELLOloc      DC.B    50,'  Hello from the MAIN now jump to subroutine      '
HELLOloc2     DC.B    50,'  Hello terminal kybd is locked ?                 '


        END


        Move.L   #$300048,D2
        Move.L   #$30009C,D3
        Move.L   #$300020,D4
        Move.L   #$300054,D5
        Move.L   #$300038,D6
        Move.L   #$30008C,D7



        SOFTWAIT  #$80000                ; Wait about 400 mill seconds.
        MOVE.B   #$01,$FFFFF001          ; set external signal bit #0 High

        SOFTWAIT  #$80000                ; Wait about 400 mill seconds.
        MOVE.B   #$02,$FFFFF001          ; set external signal bit #0 High

        SOFTWAIT  #$80000                ; Wait about 400 mill seconds.
        MOVE.B   #$04,$FFFFF001          ; set external signal bit #0 High

        SOFTWAIT  #$80000                ; Wait about 400 mill seconds.
        MOVE.B   #$08,$FFFFF001          ; set external signal bit #0 High

        SOFTWAIT  #$80000                ; Wait about 400 mill seconds.
        MOVE.B   #$10,$FFFFF001          ; set external signal bit #0 High

        SOFTWAIT  #$80000                ; Wait about 400 mill seconds.
        MOVE.B   #$20,$FFFFF001          ; set external signal bit #0 High

        SOFTWAIT  #$80000                ; Wait about 400 mill seconds.
        MOVE.B   #$40,$FFFFF001          ; set external signal bit #0 High

        SOFTWAIT  #$80000                ; Wait about 400 mill seconds.
        MOVE.B   #$80,$FFFFF001          ; set external signal bit #0 High


        SOFTWAIT  #$80000                ; Wait about 400 mill seconds.
        SOFTWAIT  #$80000                ; Wait about 400 mill seconds.
        SOFTWAIT  #$80000                ; Wait about 400 mill seconds.
        SOFTWAIT  #$80000                ; Wait about 400 mill seconds.
        MOVE.B   #$FE,$FFFFF001          ; set external signal bit #0 High

        SOFTWAIT  #$80000                ; Wait about 400 mill seconds.
        MOVE.B   #$FD,$FFFFF001          ; set external signal bit #0 High

        SOFTWAIT  #$80000                ; Wait about 400 mill seconds.
        MOVE.B   #$FB,$FFFFF001          ; set external signal bit #0 High

        SOFTWAIT  #$80000                ; Wait about 400 mill seconds.
        MOVE.B   #$F7,$FFFFF001          ; set external signal bit #0 High

        SOFTWAIT  #$80000                ; Wait about 400 mill seconds.
        MOVE.B   #$EF,$FFFFF001          ; set external signal bit #0 High

        SOFTWAIT  #$80000                ; Wait about 400 mill seconds.
        MOVE.B   #$DF,$FFFFF001          ; set external signal bit #0 High

        SOFTWAIT  #$80000                ; Wait about 400 mill seconds.
        MOVE.B   #$BF,$FFFFF001          ; set external signal bit #0 High

        MOVE.B   #$7F,$FFFFF001          ; set external signal bit #0 High


        SOFTWAIT  #$80000                ; Wait about 400 mill seconds.


doit        MOVE.B   #$FF,$FFFFF001          ; set external signal LOW
            MOVE.B   #$00,$FFFFF001          ; set external signal bit #0 High

            BRA  doit




