91av视频/亚洲h视频/操亚洲美女/外国一级黄色毛片 - 国产三级三级三级三级

  • 大小: 18KB
    文件類型: .rar
    金幣: 2
    下載: 0 次
    發布日期: 2021-06-01
  • 語言: 其他
  • 標簽: stm8;STVD??

資源簡介

通過在STVD的安裝路徑加入此插件,可以完成代碼量統計的功能,顯示ROM,RAM的使用情況。

資源截圖

代碼片段和文件信息

//?mapinfo.cpp?:?Defines?the?entry?point?for?the?console?application.
//

#include?
#include?
#include?

#define?STR_FLAG????“?segment?“
#define?STR_STACK “Stack?size:“

enum
{
????TYPE_UNKNOWN
????TYPE_RAM
????TYPE_FLASH
????TYPE_RAM_FLASH
????TYPE_EEPROM
TYPE_INFO
TYPE_BIT
TYPE_DEBUG
};

int?get_len(char?*pos);
int?get_type(char?*pos);

int?main(int?argc?char*?argv[])
{
????char?fn[2048]?=?“\0“;
????char?*buf?=?NULL;

????for(int?i=1;i????{
????????strcat(fnargv[i]);
????}
????//
????//
????//
????FILE?*fp;

????fp?=?fopen(fn“r“);
????if(?NULL==fp?)
????{
????????printf(“mapinfo?error:?Can?not?read?\“%s\““fn);
????????return?-1;
????}
fseek(fp0SEEK_END);
long?flen?=?ftell(fp);
buf?=?(char*)malloc(flen);
if(?NULL==buf?)
{
printf(“mapinfo?error:?malloc?failed!“);
????????return?-1;
}
????fseek(fp0SEEK_SET);
????fread(buf1flenfp);
????fclose(fp);
????buf[flen-1]=‘\0‘;
????//
????//
????//
????char?*pos?=?buf;
char?*next?=?buf;
int?byte_unknown?=?0;
????int?byte_flash?=?0;
????int?byte_ram?=?0;
????int?byte_ram_flash?=?0;
????int?byte_eeprom?=?0;
int?byte_stack?=?0;
????for(;;)
????{
????????pos?=?strstr(pos?STR_FLAG);
????????if(?NULL==pos?)
????????{
????????????break;
????????}
????????int?len?=?get_len(pos);
????????pos?+=?sizeof(STR_FLAG);
next?=?pos;
????????int?type?=?get_type(pos);
????????//
????????//
????????//
????????switch(?type?)
????????{
case?TYPE_UNKNOWN:
byte_unknown?+=?len;
break;
????????case?TYPE_FLASH:
????????????byte_flash?+=?len;
????????????break;
????????case?TYPE_RAM:
????????????byte_ram?+=?len;
????????????break;
????????case?TYPE_RAM_FLASH:
????????????byte_ram?+=?len;
????????????byte_flash?+=?len;
????????????break;
????????case?TYPE_EEPROM:
????????????byte_eeprom?+=?len;
????????????break;
????????}
????}
pos?=?strstr(nextSTR_STACK);
if(?pos!=NULL?)
{
byte_stack?=?atoi(&pos[sizeof(STR_STACK)]);
}
????//
????//
????//
if(?byte_unknown!=0?)
{
printf(“\nram:%d???flash:%d???eeprom:%d???stack:%d???unknown:%d“?byte_rambyte_flashbyte_eeprombyte_stackbyte_unknown);
}
else
{
printf(“\nram:%d???flash:%d???eeprom:%d???stack:%d“?byte_rambyte_flashbyte_eeprombyte_stack);
}
????return?0;
}

int?get_len(char?*pos)
{
????*pos?=?‘\0‘;
????while(*--pos!=‘?‘)
????{
????}
????return?atoi(pos+1);
}

#define????STRCMP(str1str2)????strncmp(str1str2sizeof(str2)-1)
int?get_type(char?*pos)
{
????if(?0==STRCMP(pos“const“)?)
????{
????????return?TYPE_FLASH;
????}
????else
????if(?0==STRCMP(pos“text“)?)
????{
????????return?TYPE_FLASH;
????}
????else
????if(?0==STRCMP(pos“eeprom“)?)
????{
????????return?TYPE_EEPROM;
????}
else
????if(?0==STRCMP(pos“bsct?initialized“)?)
????{
????????return?TYPE_BIT;
????}
????else
????if(?0==STRCMP(pos“bsct?from“)?)
????{
????????return?T

?屬性????????????大小?????日期????時間???名稱
-----------?---------??----------?-----??----

?????文件???????3892??2010-10-28?11:35??mapinfo.cpp

?????文件??????45056??2010-10-28?11:35??mapinfo.exe

?????文件????????866??2016-11-23?08:34??Readme.txt

-----------?---------??----------?-----??----

????????????????49814????????????????????3


評論

共有 條評論

相關資源