;************************************************************************
; CHRCUR.M68    -       Character under Cursor SBR
;
; by Dave Heyliger - AMUS Staff
;
; Reads the character under the cursor and returns the character in A$
;
; Example:
;
;       PRINT TAB (-1,0);                       ! clear screen
;       PRINT "HELLO"                           ! HELLO
;       PRINT TAB (1,3);                        ! place cursor at the 1st "L"
;       XCALL CHRCUR,A$                         ! get the character
;       PRINT                                   ! move down a row
;       IF A$ = "L" THEN PRINT "Oh Boy!"        ! it works!
;
;************************************************************************

       OBJNAM .SBR

       SEARCH SYS                              ;search normals
       SEARCH SYSSYM
       SEARCH TRM

       VMAJOR = 1                              ;version number
       VMINOR = 0

       PHDR    -1,0,PH$REE!PH$REU              ;reentrant, reusable

       MOVW    #<-1_8.>+20.,D1                 ;create PRINT TAB (-1,20)
       TCRT                                    ;puts character in input buf
       JOBIDX  A6                              ;get yourself
       MOV     JOBTRM(A6),A6                   ;get your terminal def tbl ptr
       ORW     #T$IMI,@A6                      ;set image mode
       KBD                                     ;get key under cursor
       MOV     4(A3),A6                        ;A6 points to A$
       CLR     @A6                             ;clear out A$
       MOVB    D1,@A6                          ;and return character
       RTN                                     ;and return

       END