Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

This is a purposefully obfuscated piece of code (the chip manufacturer didn't want to leak what the bits meant):

    sBoardWantsEncryption = (x&0x3)!=0x1||(x&0x3)==0x1&&(x&0x3c)!=0x00; // Wheee!
Here's a better one from some DDS tape drive firmware:

    /*  All measurements in 27 MHz ticks
     // PG = Drum PG
     // RG = Read Gate
     // WG = Write Gate
     // BH = B Head
     // 
     // *****************************************************************************
     //  **DDS:
     //       sReadTrackStart          Sync
     //              v                   v 
     //              |  Margin  |Preamble|SubData|...|Subdata|PostAmble|  Margin  |
     //              |<- 3782 ->|<- 688->|                   |<- 343 ->|<- 3782 ->|
     //                    ____________________ . . . ____________________
     //        RG ________|                                               |________
     // WWWWWWWWWWWW
     //              RRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRR
     //                   |<--- ???? --->|
     //                  (gDesiredRGToSync)
     //                 (ArbitrarySyncTime)  
     //                                                                     ~2500
     //              |<---------- 67382.701 nominal (67248 - 67517) ------------->|
     //                                      (From DDS Spec)
     //
     //  W = write track
     //  R = read track
     //  sReadTrackStart is calculated below.
     //  SkipMargin = Margin+Preamble - ArbitrarySyncTime (3300)
     //  ReadGateOn     = sReadTrackStart + Margin+Preamble - ArbitrarySyncTime
     //  ReadGateOff    = sReadTrackStart + SpecTrackLength - (Margin+PostAmble)/2
This is another one from the same project that I particularly liked:

    /* So you want to know the relation between the hardware and the
       software control constants. Well,

                       /---/\/\---||---\
                       |    R2     C   |
                  R1   | |\            |
              e--/\/\----|-\___________|____v
              2.5v-------|+/
                         |/

                Kh = Ks/(2^ix) = R2/R1
                Ih = Is/(2^ix)/dt = 1/R1/C

                   Capstan         Drum
               dt  1/1800          1/100
               ix    Cix            Vix
    */


Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: