Email: Password: Remember Me | Create Account (Free)

Back to Subject List

Old thread has been locked -- no new posts accepted in this thread
???
02/01/03 11:07
Read: times


 
#37986 - RE: compress data with 8051
Responding to: ???'s previous message
This is a very old bit of code which gives the basic idea.iwrite and iread are just buffering routinesasfar as i remembe
r
void compress(void)
{
unsigned int hr,indexz,zero_counter=0;

for(indexz=0;indexz<=hash_size-1;indexz++){
hr=*(p+indexz);
if(hr==0){++zero_counter;}else{ if(zero_counter!=0){iwrite(zero_counter);zero_counter=0;
iwrite(hr+hash_size);}else{iwrite(hr+hash_size);}}}

iwrite(zero_counter);
}


void explode(void){

unsigned int hr,indexz=0;
bit pos_err=0;

while (indexz<=hash_size-1){
if(exp_err){hr=hash_size;}else{hr=read();}
if(hr>hash_size){pos_err=0;
*(p+indexz)=((unsigned char)(hr-hash_size));++indexz;}
else{if(pos_err){error_code=exp_err;}else{ pos_err=1;}
while(hr){*(p+indexz)=0;--hr;++indexz;}}
}

}

List of 10 messages in thread
TopicAuthorDate
compress data with 8051            01/01/70 00:00      
   RE: compress data with 8051            01/01/70 00:00      
   RE: compress data with 8051            01/01/70 00:00      
   RE: compress data with 8051            01/01/70 00:00      
   I would recommend CPLD/FPGA            01/01/70 00:00      
      Constder application ofRISC controllers.            01/01/70 00:00      
         RE: Constder application ofRISC controllers.            01/01/70 00:00      
RE: compress data with 8051- Jez            01/01/70 00:00      
RE: WinZip-51?            01/01/70 00:00      
   RE: WinZip-51?            01/01/70 00:00      

Back to Subject List