          ifund    profile.psigtc
          else
          page     psigtc profile and support code
profilenum.psigtc equ 30

thisdpb   set      *
          fcb      profilenum.psigtc                profile name
          fcb      dvtyp.console
          fdb      nextdpb                        next profile
          fcb      85                             default width
          fcb      48                             default depth
          fcb      4                              flags
          fdb      6*tickspersecond+ntimeoutblocks
          jmp      xlatei:psigtc                    perform input translation
          jmp      specialoutput:psigtc             perform control functions
          rts                                     set output coloring
          nop
          nop
          rts                                     set background coloring
          nop
          nop
          fcb      0                              initial XLATEI state byte
nextdpb   set      thisdpb
          page
          ifund    dcb:xlatestate
dcb:xlatestate equ dcb:profile+dpb:gpinit         translate state byte is 1st gp byte
          fin
xlatei:psigtc
;   translate psigtc input found in (a), returning translated character in (a)
;   with carry clear; carry set will cause character to be lost
          ldab     #$7f                           assume swap for underscore key
          cmpa     #$5f                           swap for underscore ?
          beq      xlatei:psigtc.b                  b/ yes, use (B) as translation
          ldab     #$5f                           assume swap for DEL key
          cmpa     #$7f                           swap for DEL key ?
          bne      xlatei:psigtc.done               b/ no
xlatei:psigtc.b ; use (B) as translation
          tba
xlatei:psigtc.done
          okrts
          page
specialoutput:psigtc
;   called to perform control functions for a Lear Siegler ADM 3-A
;   The position, and clear functions are implemented.  All others
;   must be simulated by the VT driver.
          cmpa     #specialfn:posn
          beq      specialoutput:psigtcposn
          cmpa     #specialfn:clear
          beq      specialoutput:psigtcclear
          errorrts                               psigtc can't do anything else

specialoutput:psigtcposn
          ldaa     #ascii:esc
          jsr      dcb:tlbuffer,x
          ldaa     #'=                           set up to do a position fn
          jsr      dcb:tlbuffer,x
          tsx
          ldaa     2,x
          adda     #$20
          ldx      dcbpointer
          jsr      dcb:tlbuffer,x
          tsx
          ldaa     3,x
          adda     #$20
          ldx      dcbpointer
          jsr      dcb:tlbuffer,x
          okrts

specialoutput:psigtcclear
          ldaa     #$1a                          performs a clear screen fn
          jsr      dcb:tlbuffer,x
          okrts
          fin      profile.psigtc
          ifund    profile.psigtbw
          else
          page     psigtbw profile and support code
profilenum.psigtbw equ 31

thisdpb   set      *
          fcb      profilenum.psigtbw                profile name
          fcb      dvtyp.console
          fdb      nextdpb                        next profile
          fcb      85                             default width
          fcb      24                             default depth
          fcb      4                              flags
          fdb      6*tickspersecond+ntimeoutblocks
          jmp      xlatei:psigtbw                    perform input translation
          jmp      specialoutput:psigtbw             perform control functions
          rts                                     set output coloring
          nop
          nop
          rts                                     set background coloring
          nop
          nop
          fcb      0                              initial XLATEI state byte
nextdpb   set      thisdpb
          page
          ifund    dcb:xlatestate
dcb:xlatestate equ dcb:profile+dpb:gpinit         translate state byte is 1st gp byte
          fin
xlatei:psigtbw
;   translate psigtbw input found in (a), returning translated character in (a)
;   with carry clear; carry set will cause character to be lost
          ldab     #$7f                           assume swap for underscore key
          cmpa     #$5f                           swap for underscore ?
          beq      xlatei:psigtbw.b                  b/ yes, use (B) as translation
          ldab     #$5f                           assume swap for DEL key
          cmpa     #$7f                           swap for DEL key ?
          bne      xlatei:psigtbw.done               b/ no
xlatei:psigtbw.b ; use (B) as translation
          tba
xlatei:psigtbw.done
          okrts
          page
specialoutput:psigtbw
;   called to perform control functions for a Lear Siegler ADM 3-A
;   The position, and clear functions are implemented.  All others
;   must be simulated by the VT driver.
          cmpa     #specialfn:posn
          beq      specialoutput:psigtbwposn
          cmpa     #specialfn:clear
          beq      specialoutput:psigtbwclear
          errorrts                               psigtbw can't do anything else

specialoutput:psigtbwposn
          ldaa     #ascii:esc
          jsr      dcb:tlbuffer,x
          ldaa     #'=                           set up to do a position fn
          jsr      dcb:tlbuffer,x
          tsx
          ldaa     2,x
          adda     #$20
          ldx      dcbpointer
          jsr      dcb:tlbuffer,x
          tsx
          ldaa     3,x
          adda     #$20
          ldx      dcbpointer
          jsr      dcb:tlbuffer,x
          okrts

specialoutput:psigtbwclear
          ldaa     #$1a                          performs a clear screen fn
          jsr      dcb:tlbuffer,x
          okrts
          fin      profile.psigtbw
          ifund    profile.psi480
          else
          page     psi480 profile and support code
profilenum.psi480 equ 32

thisdpb   set      *
          fcb      profilenum.psi480                profile name
          fcb      dvtyp.console
          fdb      nextdpb                        next profile
          fcb      80                             default width
          fcb      25                             default depth
          fcb      4                              flags
          fdb      6*tickspersecond+ntimeoutblocks
          jmp      xlatei:psi480                    perform input translation
          jmp      specialoutput:psi480             perform control functions
          rts                                     set output coloring
          nop
          nop
          rts                                     set background coloring
          nop
          nop
          fcb      0                              initial XLATEI state byte
nextdpb   set      thisdpb
          page
          ifund    dcb:xlatestate
dcb:xlatestate equ dcb:profile+dpb:gpinit         translate state byte is 1st gp byte
          fin
xlatei:psi480
;   translate psi480 input found in (a), returning translated character in (a)
;   with carry clear; carry set will cause character to be lost
          ldab     #$7f                           assume swap for underscore key
          cmpa     #$5f                           swap for underscore ?
          beq      xlatei:psi480.b                  b/ yes, use (B) as translation
          ldab     #$5f                           assume swap for DEL key
          cmpa     #$7f                           swap for DEL key ?
          bne      xlatei:psi480.done               b/ no
xlatei:psi480.b ; use (B) as translation
          tba
xlatei:psi480.done
          okrts
          page
specialoutput:psi480
;   called to perform control functions for a Lear Siegler ADM 3-A
;   The position, and clear functions are implemented.  All others
;   must be simulated by the VT driver.
          cmpa     #specialfn:posn
          beq      specialoutput:psi480posn
          errorrts                               psi480a can't do anything else

specialoutput:psi480posn
          ldaa     #16                           set up to do a position fn
          jsr      dcb:tlbuffer,x
          tsx
          ldaa     2,x
          adda     #$20
          ldx      dcbpointer
          jsr      dcb:tlbuffer,x
          tsx
          ldaa     3,x
          adda     #$20
          ldx      dcbpointer
          jsr      dcb:tlbuffer,x
          okrts
          fin      profile.psi480
          end
