\IDENT\HEXIN
* BASIC IO PACKAGE -- 19720713
* P850, P855, P860
*
* CALLING SEQUENCE:  CF   A14,NAME
* WHERE:                  A14 = REGISTER WITH LINKSTACKPOINTER
*                         NAME  = ENTRY POINT NAME OF CALLED SUBROUTINE
*
* LINKSTACK: 3 ENTRIES USED MAXIMUM
* A15 STACK IS USED FOR REGISTER SAVE AREA
\ENTRY\HEXIN
\EXTRN\ASCOUT
\EXTRN\ASCIN
* ASSIGNMENTS
ASR\EQU\/10\DEV ADDR
HSR\EQU\/20\DEV ADDR
HSP\EQU\/30\DEV ADDR
*
S\EQU\1\START
H\EQU\0\HALT
*
* HEXIN--INPUT HEX NUMBER TO A1 FROM TELETYPE KEYBOARD
*        RETURN: A6,A7 UNDEFINED
*
HEXIN\LDK\A6,/2F\PRINT /
\CF\A14,ASCOUT
\LDK\A1,0\NUM = 0
NDIG\CF\A14,ASCIN\READ CHARACTER
\SUK\A6,/30
\RF(2)\NOHEX
\CWK\A6,/A
\RF(2)\HEX\LT A
\SUK\A6,7
\CWK\A6,/A
\RF(2)\NOHEX
\CWK\A6,/F
\RF(1)\NOHEX
HEX\SLL\A1,1
\SLL\A1,1
\SLL\A1,1
\SLL\A1,1
\ORR\A1,A6
\RB\NDIG
NOHEX\RTN\A14
\END
