;************************************************************************
; ADDCUR.M68    -       Address of Cursor SBR
;
; by Dave Heyliger - AMUS Staff
;
; Reads the address of the cursor and returns "(x,y)" in A$
;
; Example:
;
;       PRINT TAB (-1,0);                       ! clear the screen
;       PRINT TAB (15,20);                      ! tab to here
;       XCALL ADDCUR,A$                         ! read cursor address (15,20)
;       PRINT                                   ! print to new line
;       PRINT "ADDRESS IS " A$                  ! print out address in A$
;************************************************************************

       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

       JOBIDX  A6                              ;get yourself
       MOV     JOBTRM(A6),A6                   ;get your term def tbl ptr
       ORW     #T$IMI!T$ECS,@A6                ;set image mode,no echo

       MOVW    #<-1_8.>+19.,D1                 ;create PRINT TAB (-1,19)
       TCRT                                    ;puts address in input buf

       MOV     4(A3),A2                        ;A0 points to A$
       CLR     @A2                             ;clear out A$
       CLR     4(A2)                           ;for 10 characters
       CLRW    10(A2)

       MOVB    #'(,(A2)+                       ;start string

       KBD                                     ;get row
       SUBB    #37,D1                          ;convert to binary number
       DCVT    0,OT$MEM                        ;convert to decimal in string
       MOVB    #',,(A2)+                       ;move in ","

       KBD                                     ;get column
       SUBB    #37,D1                          ;convert to binary number
       DCVT    0,OT$MEM                        ;convert to decimal in string
       MOVB    #'),@A2                         ;finish the string
       KBD                                     ;get CRLF, throw it away
       RTN                                     ;and return

       END