.title unhex ; ; Authors: E.F.Beadel, Jr., Manager ; C.A.U.S.E. Instructional Computer Center ; SUNY at Oswego ; Oswego, NY 13126 ; phone: 315/341-3055 ; ; and ; ; T.J.Weslowski, Instructor ; Computer Science Department ; SUNY at Oswego ; Oswego, NY 13126 ; ; Date: 10-aug-83 ; ;************************************************************ ; ; This fortran callable routine converts its two character ; arguments which represent a hexidecimal byte to the ; actual byte. ; ; called by the call ; =UNHEX(,) ; ; where = in integer or byte variable identifier ; = byte or integer identifier representing ; the high hex digit ; = byte or integer identifier representing ; the low hex digit. ; ;************************************************************ ; twice = 2 .mcall .exit UNHEX:: cmp (5),#2 ;syntax for 2 arguments bne abort tst (5)+ ;skip into pointer table ctr=1 .rept twice movb @(5)+,r1 ;fetch a datum character bic #177400,r1 ;remove upper byte garbage. cmp r1,#'9 ;is this a digit??? .enabl lsb ble 1$ ;if so, goto 1$ sub #'A-10.,r1 ;convert to a 4-bit pattern br 2$ ;and skip next conversion. 1$: sub #'0,r1 ;Convert to a 4-bit pattern. 2$: .dsabl lsb .if eq ctr-1 mov r1,r0 ;if first character, put pattern .rept 4 ;in r0 and shift to where it belongs. asl r0 .endr This file appearently was corrupted, thus nothing follows here.. Billy Y.. 31-Oct-93 on uploading this package to Kanse.