                .globl  _ttgetc
                .globl  _ttputc
                .globl  _scancode
                .globl  _shiftstatus
                .text
_ttgetc:        link    A6,#0
                movem.l D6-D7,-(sp)
                move    #7,(sp)
                trap    #1
                move.l  D0,D7
                swap    d7
                move.w  d7,_scancode
                move.w  #$ffff,(sp)
                move.w  #$b,-(sp)
                trap    #13
                addq.l  #2,sp
                move.w  d0,_shiftstatus
                swap    d7
                move.l  d7,d0
                and.l   #$7f,D0
                tst.l   (sp)+
                movem.l (sp)+,D7-D7
                unlk    A6
                rts
_ttputc:        link    A6,#0
                movem.l d6-d7,-(sp)
                move    $8(A6),(sp)
                and     #127,(sp)
                move    #6,-(sp)
                trap    #1
                addq.l  #2,sp
                tst.l   (sp)+
                movem.l (sp)+,R7-R7
                unlk    A6
                rts
 
                .bss
_scancode:      ds.w    1
_shiftstatus:   ds.w    1
