Code/Resource
Windows Develop
Linux-Unix program
Internet-Socket-Network
Web Server
Browser Client
Ftp Server
Ftp Client
Browser Plugins
Proxy Server
Email Server
Email Client
WEB Mail
Firewall-Security
Telnet Server
Telnet Client
ICQ-IM-Chat
Search Engine
Sniffer Package capture
Remote Control
xml-soap-webservice
P2P
WEB(ASP,PHP,...)
TCP/IP Stack
SNMP
Grid Computing
SilverLight
DNS
Cluster Service
Network Security
Communication-Mobile
Game Program
Editor
Multimedia program
Graph program
Compiler program
Compress-Decompress algrithms
Crypt_Decrypt algrithms
Mathimatics-Numerical algorithms
MultiLanguage
Disk/Storage
Java Develop
assembly language
Applications
Other systems
Database system
Embeded-SCM Develop
FlashMX/Flex
source in ebook
Delphi VCL
OS Develop
MiddleWare
MPI
MacOS develop
LabView
ELanguage
Software/Tools
E-Books
Artical/Document
hexline.f
Package: celp_3.2a.tar.gz [view]
Upload User: szhypcb168
Upload Date: 2007-01-06
Package Size: 2187k
Code Size: 1k
Category:
Voice Compress
Development Platform:
Unix_Linux
- c==========================================================================
- c
- c ROUTINE
- c puthex & gethex
- c
- c FUNCTION
- c convert integer stream to hexadecimal format
- c
- c
- c SYNOPSIS
- c subroutine puthex (nb, bits, line)
- c entry gethex (nb, bits, line)
- cc
- c**************************************************************************
- c
- subroutine puthex (nb, bits, line)
- implicit undefined(a-z)
- integer j, k, m, n, nb, bits(nb)
- character*(*) line, hex*16
- data hex /'0123456789ABCDEF'/
- c
- k = 0
- m = 0
- line = ' '
- 10 if (k .ge. nb) return
- n = 0
- do 15 j = 1, 4
- k = k + 1
- if (k .le. nb) n = or (n, ishft(bits(k).and.1, 4-j))
- cAlli if (k .le. nb) n = ior (n, ishft(bits(k).and.1, 4-j))
- 15 continue
- m = m + 1
- if (m .gt. len(line)) stop 'Hex string too small'
- line(m:m) = hex(n+1:n+1)
- goto 10
- c
- entry gethex (nb, bits, line)
- k = 0
- m = 0
- 20 if (k .ge. nb) return
- m = m + 1
- if (m .gt. len(line)) stop 'Hex string too small'
- n = index (hex, line(m:m)) - 1
- if (n .lt. 0) stop 'Illegal character'
- do 25 j = 1, 4
- k = k + 1
- if (k .le. nb) bits(k) = and (ishft(n, j-4), 1)
- cAlli if (k .le. nb) bits(k) = iand (ishft(n, j-4), 1)
- 25 continue
- goto 20
- end