home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Oakland CPM Archive
/
oakcpm.iso
/
sigm
/
vol157
/
cath.a86
< prev
next >
Wrap
Text File
|
1985-03-14
|
341b
|
23 lines
TITLE 'CONVERTS ASCII HEX IN A TO BINARY'
PUBLIC CATH
CSEG
;ENTER WITH ASCII HEX IN AL, LEAVE WITH BINARY OR BLANK IF NON
;HEX ASCII CHARACTER
CATH: CMP AL,'0'-1
JC BLOUT
CMP AL,'9'+1
JNC ALPHA
SUB AL,'0'
RET
ALPHA: CMP AL,'A'-1
JC BLOUT ;BAD
CMP AL,'G'
JNC BLOUT
SUB AL,'1' ;CONVERT TO BINARY
RET
BLOUT: MOV AL,' '
RET
END