home bbs files messages ]

Forums before death by AOL, social media and spammers... "We can't have nice things"

   comp.lang.asm.x86      Ahh, the lost art of x86 assembly      4,675 messages   

[   << oldest   |   < older   |   list   |   newer >   |   newest >>   ]

   Message 3,013 of 4,675   
   Robert Prins to All   
   Translating blocks of memory containing    
   09 Oct 17 21:38:32   
   
   From: robert@nospicedham.prino.org   
      
   It's obviously very simple for plain old ASCII (CP437/850) data:   
      
   asm   
      mov   ecx, bytes_read   
      mov   edx, offset buffer   
      
   @1:   
      movzx eax, byte ptr [edx]   
      mov   al, byte ptr [eax + offset xlat]   
      mov   [edx], al   
      inc   edx   
      dec   ecx   
      jnz   @1   
   end;   
      
   where "xlat" is the translation table. Currently I'm using this code to   
   translate old CP437 box characters to '+', '-', and '|'.   
      
   However, given that I'm now also working with UTF8 data inside the box (no pun   
   intended), I really don't want to translate box characters that are the first   
   character of UTF8 characters. I can (obviously) naively test for all of the   
   valid boxchar-followed-by-boxchar variations, but I wonder if there is a faster   
   way of doing this?   
      
   Yes, the obvious thing to do is to no longer use CP437... However, that would   
   make detecting the first and final lines of boxes rather a lot harder, so I'm   
   not really ready for that.   
      
   Robert   
   --   
   Robert AH Prins   
   robert(a)prino(d)org   
      
   --- SoupGate-Win32 v1.05   
    * Origin: you cannot sedate... all the things you hate (1:229/2)   

[   << oldest   |   < older   |   list   |   newer >   |   newest >>   ]


(c) 1994,  bbs@darkrealms.ca