dumpsect.c

来自「MMC interface and FAT File system」· C语言 代码 · 共 54 行

C
54
字号
//###########################################################
// File: dumpsect.c
//
//#########################################################################
// Last change: 06.03.2004
//#########################################################################
// holger.klabunde@t-online.de
// http://home.t-online.de/home/holger.klabunde/homepage.htm
//#########################################################################
// Compiler: AVR-GCC 3.2
//#########################################################################

#include <io.h>

#include "mydefs.h"
#include "protos.h"
#include "dos.h"
#include "serial.h"

//######################################################
void DumpSector(unsigned char *buf)
//######################################################
{
 unsigned int i;
 unsigned char by,j;
 unsigned char *p;

 p=buf;
 
 for(i=0; i<BYTE_PER_SEC; i++)
  {
   by=*p++;

   if(bmode==0)
    {
     ser_puthex(by);
     if(i%16==15)
      {
       putchar(' ');
       putchar(' ');
       for(j=0; j<16; j++)
        {
         by=p[-16+j];
         if(by<0x20) by='.';
         putchar(by);
        }
      
       puts("\n");
      }
    } 
   else ser_putc(by);
  }
}

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?