CNVTAH          ; ROUTINE TO CONVERT ASCII TO HEX                22-AUG-1978 03:25:06   VAX-11 MACRO X0.3-11               Page   1

                                                                                                                                 (1)



                                     0000     1 ;	UETP prefix file (contains macro library file specs).

                                     0000     2 ;

                                     0000     3 	.LIBRARY	/EXECML$/	;SYSTEM MACROS

                                     0000     4 	.LIBRARY	/LIBD$:[SYSTST.OBJ]SYSTST.MLB/ ; PRIVATE UETP,SYSTST LIB

                                     0000     5 	.LIST	MEB

                                     0000     6 ;

                                     0000     1 	.TITLE	CNVTAH		; ROUTINE TO CONVERT ASCII TO HEX

                                     0000     2 ;

                                     0000     3 ;	ROUTINE TO CONVERT AN UP-TO-8 CHAR HEXADECIMAL ASCII

                                     0000     4 ;	STRING TO A LONG WORD.

                                     0000     5 ;

                                     0000     6 ;					RAB 27-APR-78

                                     0000     7 ;

                                     0000     8 ; INPUTS:

                                     0000     9 ;	1)	LONG WORD LENGTH OF THE ASCII STRING IN BYTES

                                     0000    10 ;

                                     0000    11 ;	2)	LONG WORD ADDRESS OF THE ASCII STRING

                                     0000    12 ;

                                     0000    13 ; OUTPUTS:

                                     0000    14 ;	THE LONG WORD RESULT IS RETURNED IN R11

                                     0000    15 ;

                                     0000    16 ; CALLING SEQUENCE:

                                     0000    17 ;			PUSHL	LENGTH

                                     0000    18 ;			PUSHAL	ADDRESS

                                     0000    19 ;			CALLS	#2,CNVTAH

                                     0000    20 ;

                                     0000    21 ;

                                     0000    22 CNVTAH::

                               001C  0000    23 	.WORD	^M<R2,R3,R4>

            53         04 AC     7D  0002    24 	MOVQ	4(AP),R3		; GET COUNT IN R4 AND ADDRESS

                                     0006    25 					; IN R3.

                          54     D5  0006    26 	TSTL	R4			; CHECK FOR ZERO LENGTH

                          20     15  0008    27 	BLEQ	20$			; BR IF LENGTH <=0

            09            54     D1  000A    28 	CMPL	R4,#9			; CHECK FOR LENGTH TOO BIG

                          1B     18  000D    29 	BGEQ	20$			; BR IF LENGTH =>9

                          5B     D4  000F    30 	CLRL	R11			; OUTPUT NUMBER INITED

                                     0011    31 10$:

            52            83     9A  0011    32 	MOVZBL	(R3)+,R2		; GET A BYTE

            30            52     91  0014    33 	CMPB	R2,#^A/0/		; IS THE CHAR.

                          11     19  0017    34 	BLSS	20$			; LESS THAN A '0'

            39            52     91  0019    35 	CMPB	R2,#^A/9/		; OR

                          17     15  001C    36 	BLEQ	30$			; UP TO A '9'?

         41 8F            52     91  001E    37 	CMPB	R2,#^A/A/		; IS THE CHAR.

                          06     19  0022    38 	BLSS	20$			; LESS THAN A 'A'

         46 8F            52     91  0024    39 	CMPB	R2,#^A/F/		; OR

                          08     15  0028    40 	BLEQ	29$			; UP TO A 'F'?

                                     002A    41 20$:

            50   00000000'8F     D0  002A    42 	MOVL	#SS$_BADPARAM,R0	; SET BAD CHAR

                                 04  0031    43 	RET				; RETURN

                                     0032    44 ;

                                     0032    45 29$:

            52            09     C0  0032    46 	ADDL2	#9,R2			; MAKE LOW 4 BITS HEX A-F

                                     0035    47 30$:

            52         F0 8F     8A  0035    48 	BICB2	#^XF0,R2		; ISOLATE LOW 4 BITS

            5B            04     9C  0039    49 	ROTL	#4,R11,R11		; POSITION THE NIBBLE

                          5B         003C       

            5B            52     C0  003D    50 	ADDL2	R2,R11			; PUT NEW DIGIT INTO R11

CNVTAH          ; ROUTINE TO CONVERT ASCII TO HEX                22-AUG-1978 03:25:06   VAX-11 MACRO X0.3-11               Page   2

                                                                                                                                 (1)



         FF 8F            01     9D  0040    51 	ACBB	#1,#-1,R4,10$		; DONE WITH 8 CHAR?

            FFCA          54         0044       

            50   00000000'8F     D0  0047    52 	MOVL	#SS$_NORMAL,R0		; SET SUCCESS RETURN

                                 04  004E    53 	RET				; RETURN

                                     004F    54 	.END

CNVTAH          ; ROUTINE TO CONVERT ASCII TO HEX                22-AUG-1978 03:25:06   VAX-11 MACRO X0.3-11               Page   3

SYMBOL TABLE                                                                                                                     (1)



CNVTAH           00000000 RG    01   

SS$_BADPARAM     ********   X   01   

SS$_NORMAL       ********   X   01   





PROGRAM SECTION SYNOPSIS



.  ABS  .        00000000      00     NOPIC   USR   CON   ABS   LCL NOSHR NOEXE NORD  NOWRT BYTE  

. BLANK .        0000004F      01     NOPIC   USR   CON   REL   LCL NOSHR   EXE   RD    WRT BYTE  





THERE WERE NO ERRORS OR WARNINGS.

28482. BYTES LEFT IN FREE MEMORY POOL.

OBJ$:CNVTAH,LIS$:CNVTAH/-SP=SRC$:UETPLIBS,CNVTAH

0 MLB DIR RDS - 0 GETS TO DEFINE 0 MACROS. 1 INTER. FILE WRITES. 

