         nam   SIO
         ttl   os9 device driver    

* Disassembled 98/08/23 20:58:36 by Disasm v1.6 (C) 1988 by RML

         ifp1
         use   defsfile
         endc
tylg     set   Drivr+Objct   
atrv     set   ReEnt+rev
rev      set   $01
         mod   eom,name,tylg,atrv,start,size
u0000    rmb   29
u001D    rmb   1
u001E    rmb   1
u001F    rmb   1
u0020    rmb   2
u0022    rmb   2
u0024    rmb   1
u0025    rmb   1
size     equ   .
         fcb   $03 
name     equ   *
         fcs   /SIO/
         fcb   $09 
L0012    fcb   $09 
         fcb   $0C 
         fcb   $03 
         fcb   $4C L
         fcb   $01 
         fcb   $A2 "
         fcb   $00 
         fcb   $CE N
         fcb   $00 
         fcb   $62 b
         fcb   $00 
         fcb   $2E .
         fcb   $00 
         fcb   $12 
         fcb   $00 
         fcb   $03 
start    equ   *
         lbra  L0034
         lbra  L0057
         lbra  L00E3
         lbra  L011A
         lbra  L0140
         lbra  L0056
L0034    pshs  cc
         orcc  #$50
         ldx   #$FF20
         clr   $01,x
         ldd   <$2C,y
         std   <u0024,u
         lda   #$FE
         sta   ,x
         lda   #$36
         sta   $01,x
         lda   ,x
         ldd   <$26,y
         lbsr  L0148
         puls  cc
         clrb  
L0056    rts   
L0057    bsr   L00AC
         bcs   L00C8
         ldb   #$08
         pshs  b,cc
         tst   <u001E,u
         beq   L0066
         dec   $01,s
L0066    bra   L0077
L0068    lda   <$35,y
         anda  #$0F
         cmpa  #$07
         beq   L0077
         ldx   #$0001
         os9   F$Sleep  
L0077    pshs  y
         ldy   #$FFFF
L007D    lda   >$FF22
         leay  -$01,y
         beq   L008B
         lsra  
         bcs   L007D
         puls  y
         bra   L0090
L008B    puls  y
         lsra  
         bcs   L0068
L0090    orcc  #$50
         clra  
         bsr   L00D5
L0095    bsr   L00CE
         ldb   >$FF22
         lsrb  
         rora  
         dec   $01,s
         bne   L0095
         bsr   L00D5
         tst   <u001E,u
         beq   L00A8
         lsra  
L00A8    puls  b,cc
         clrb  
         rts   
L00AC    pshs  a
         lda   <$35,y
         anda  #$0F
         cmpa  #$08
         bcc   L00C4
         lsla  
         leax  >L0012,pcr
         ldd   a,x
         std   <u0020,u
         clrb  
         puls  pc,a
L00C4    ldb   #$CB
         puls  a
L00C8    orcc  #$01
         rts   
L00CB    stb   >$FF20
L00CE    pshs  b,a
         ldd   <u0020,u
         bra   L00DC
L00D5    pshs  b,a
         ldd   <u0020,u
         lsra  
         rorb  
L00DC    subd  #$0001
         bne   L00DC
         puls  pc,b,a
L00E3    bsr   L00AC
         bcs   L00C8
         ldb   #$09
         pshs  b,cc
         orcc  #$50
         tst   <u001E,u
         beq   L00F4
         dec   $01,s
L00F4    andcc #$FE
L00F6    ldb   #$02
         bcs   L00FB
         clrb  
L00FB    bsr   L00CB
         lsra  
         dec   $01,s
         bne   L00F6
         ldb   <u001D,u
         beq   L010B
         andb  #$FE
         bsr   L00CB
L010B    ldb   #$02
         bsr   L00CB
         tst   <u001F,u
         beq   L0118
         ldb   #$02
         bsr   L00CB
L0118    puls  pc,b,cc
L011A    cmpa  #$06
         bne   L0120
L011E    clrb  
         rts   
L0120    ldx   $06,y
         cmpa  #$26
         beq   L0131
         cmpa  #$28
         bne   L017E
         ldd   <u0022,u
         std   $06,x
         bra   L011E
L0131    ldx   $06,y
         clra  
         ldb   <u0024,u
         std   $04,x
         ldb   <u0025,u
         std   $06,x
         bra   L011E
L0140    cmpa  #$28
         bne   L017E
         ldx   $06,y
         ldd   $06,x
L0148    std   <u0022,u
         clra  
         clrb  
         std   <u001D,u
         sta   <u001F,u
         ldd   <u0022,u
         tstb  
         bpl   L015C
         inc   <u001F,u
L015C    bitb  #$40
         bne   L017A
         bitb  #$20
         beq   L0167
         inc   <u001E,u
L0167    bita  #$20
         beq   L0179
         bita  #$80
         beq   L017A
         inc   <u001D,u
         bita  #$40
         bne   L0179
         inc   <u001D,u
L0179    rts   
L017A    comb  
         ldb   #$CB
         rts   
L017E    comb  
         ldb   #$D0
         rts   
         emod
eom      equ   *
