亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? main.c

?? CodeWarrior for HCS12 V4.7 Checksums SingleApp.rar
?? C
?? 第 1 頁 / 共 2 頁
字號:
/******************************************************************************
  FILE        : main.c
  PURPOSE     : checksum demo/test file
  LANGUAGE    : ANSI-C
  -----------------------------------------------------------------------------
  HISTORY
    19 sep 2002       Created.
 ******************************************************************************/

/* this module demonstrates and checks various features of the checksum computation capabilities of the linker */


#include "hidef.h"
#include "checksum.h"

#ifdef __HC08__
#include "start08.h" /* for automatic startup data structure based checksums */
#elif defined(__HC12__)
#include "start12.h" /* for automatic startup data structure based checksums */
#else
#error "Not adapted for this target"
#endif

#if 0

How the checksum feature works.

This file does demonstrate two different ways of how the linker can compute checksums. The "PRM file Method" and the "Automatic linker controlled Method".

PRM file Method:
The linker can be instructed by some new commands in the prm file to compute the checksum over some areas.
All necessary information for this is specified in this structure:
For example (in the prm file):
CHECKSUM
    CHECKSUM_ENTRY
        METHOD_CRC_CCITT
        OF      READ_ONLY   0xE020 TO 0xFEFF
        INTO    READ_ONLY   0xE010 SIZE 2
        UNDEFINED 0xff
    END
END
This entry causes the computation of a checksum from 0xE020 up to 0xFEFF (including this address).
The checksum is calculated according to the CRC CCITT.
The EBNF of the CHECKSUM entry:
CHECKSUM=        "CHECKSUM" { CHECKSUM_ENTRY } "END".
CHECKSUM_ENTRY=  "CHECKSUM_ENTRY" CHECKSUM_METHOD [INIT_VAL] [POLYNOM] OF_AREA INTO_AREA [UNDEF_VAL] "END".
CHECKSUM_METHOD= "METHOD_CRC_CCITT"|"METHOD_CRC8"|"METHOD_CRC16"|"METHOD_CRC32"|"METHOD_ADD"|"METHOD_XOR".
INIT_VAL=        "INIT" number.
POLYNOM=         "POLY" number.
OF_AREA=        "OF" MEMORY_AREA.
INTO_AREA=       "INTO" MEMORY_AREA.
MEMORY_AREA=     CHECKSUM_SPACE number (("TO" number)|("SIZE" number)).
UNDEF_VAL=       "UNDEFINED" number.
CHECKSUM_SPACE=  "READ_ONLY" | "CODE".

CHECKSUM: contains a list of checksums descriptions to be computed.
CHECKSUM_ENTRY: one single checksum computation description.
CHECKSUM_METHOD: How to compute the checksum.
- METHOD_XOR. The elements of the memory area are xored together.
  The element size is defined by the size of the INTO_AREA.
- METHOD_ADD. The elements of the memory area are added together.
  The element size is defined by the size of the INTO_AREA.
- METHOD_CRC_CCITT. A 16-bit CRC (cyclic redundancy check) checksum according
  to CRC CCITT is computed over all bytes in the area. The INTO_AREA size must be 2 bytes.
- METHOD_CRC16. A 16-bit CRC checksum according to the commonly used CRC 16 is computed
  over all bytes in the area. The INTO_AREA size must be 2 bytes.
- METHOD_CRC32. A 32-bit CRC checksum according to the commonly used CRC 32 is computed
  over all bytes in the area. The INTO_AREA size must be 4 bytes.
INIT_VAL: The value to start the checksum computation. This value is provided to compute any kind of CRC checksum.
  However, specifing it does not increase the robustness of the checksum and therefore the default values of -1 for CRC
  checksums and 0 for addition and XOR is usually sufficient.
POLYNOM: The polynom specifies how a set bit in the code should affect the checksum. For certain polynoms especially efficient
  checksums exists. 0 is not a valid choice.
OF_AREA: The area of which the checksum should be computed.
INTO_AREA: The area into which the computed checksum should be stored. Should be distinct from the OF_AREA and from any other placement in the prm file.
MEMORY_AREA: Describes a memory area. The same syntax as in the placement is used.
UNDEF_VAL: The value to be used in the checksum computation for areas not covered by the application.
  It is recommended to use the FILL directive to avoid undefined areas.
    E.g.:
    SEGMENTS
      MY_ROM = READ_ONLY   0xE020 TO 0xFEFF FILL 0xFF;
CHECKSUM_SPACE: The address space. Use "READ_ONLY" unless your target uses a harward architecture and you are refering to the "CODE" address space.

Example:
Assume the following memory content:
0x1000 02 02 03 04
Then the XOR 1 byte checksum from 0x1000 to 0x1003 is 0x06 (=0x02^0x02^0x03^0x04).
Notes:
- METHOD_XOR is the fastest method to compute together with METHOD_ADD.
- However, for METHOD_XOR and METHOD_ADD, regular multiple one bit changes can cancel each other out. The CRC methods avoid this weakness.
  As example, assume that both 0x1000 and 0x1001 are getting cleared, then, the XOR checksum does not change. There are similar cases for the addition as well.
- METHOD_XOR/METHOD_ADD do also support to compute the checksum with larger element sizes.
  The element size is taken as the size of the INTO_AREA part.
  With a element size of 2, the checksum of the example would be 0x0506 (= 0x2020 ^ 0x0304).
  Larger element sizes do allow a faster computation of the checksums on 16 or 32 bit machines.
  The size and the address of the OF_AREA part have to be a multiple of the element size.
  CRC checksums do only compute the values byte wise (or more precisely they are even defined bitwise).
- Often, the actual size of the area to be checked is not known in advance.
  Depending on how much code the compiler is generating for C source code, the placements do fill up more or less.
  This method however does not support varying sizes. Instead, the unused areas in the placement
  have to be filled with the FILL directive to a known value.
  This causes a certain overhead as the checksum is computed over these fill areas as well.

Automatic linker controlled Method:
The linker itself is the one who knows all the memory areas used by an application.
Therefore this method is using this knowledge to generate a data structure,
which then can be used at runtime to validate the complete code.
The linker is providing this information similar to the way it provides copy down and zero out information.
The startup data structure has to have additional fields:

extern struct _tagStartup {
....
     struct __Checksum* checkSum;
     int nofCheckSums;
....

The structure __Checksum is defined in the header file checksum.h:
struct __Checksum {
    void* start;
    unsigned int len;
#if _CHECKSUM_CRC_CCITT
    _CheckSum2ByteType checkSumCRC_CCITT;
#endif
#if _CHECKSUM_CRC_16
    _CheckSum2ByteType checkSumCRC16;
#endif
#if _CHECKSUM_CRC_32
    _CheckSum4ByteType checkSumCRC32;
#endif
#if _CHECKSUM_ADD_BYTE
    _CheckSum1ByteType checkSumByteAdd;
#endif
#if _CHECKSUM_XOR_BYTE
    _CheckSum1ByteType checkSumByteXor;
#endif
};

The __checksum structure is allocated by the linker in a ".checksum" section after all the other code.
The areas do cover all the used segments in the prm file. FILL areas are not checked.
The checksum types to be computed is derived by the linker by using the field names of the __Checksum structure.
Usually only one of the alternatives should be present, but the linker does support to compute any combination checksum methods together.
Automatic struct detection:
The linker does read the debug information of the module containing _tagStartup
to detect which checksums it should actually generate and how the structure is built.
Because of this, the structure used by the compiler does always match the structure generated by the linker.
The linker does know the structure field names and the name __Checksum of the checksum structure itself. These names cannot be changed.
The types of the structure fields can be adapted to the actual needs.

.checksum section:
The ".checksum" section must be the last section in a placement. It is allowed to be after the .copy section.
If it is not mentioned in the prm file, its automatically allocated when needed.
The checksum areas do not cover .checksum itself.
Notes:
The __Checksum structure can also contain checkSumWordAdd, checkSumLongAdd, checkSumWordXor and checkSumLongXor fields
to have checksums computed with larger element sizes. However, as the FILL areas are not considered,
the len field might be not a multiple of the element size. When this happens, 0 has to be assumed for the missing bytes.
Because this is not handled in the provided example code, automatic generated word or long size add or xor checksums are not officially supported.

Runtime support
The file checksum.h does contain functions and utilities to compute the various checksums.
The corresponding source file is checksum.c. Check it to find out how to compute the various checksums.

The automatic generated checksum feature does not need any customer code.
A simple call "_Checksum_Check(_startupData.checkSum, _startupData.nofCheckSums);" does state if the checksums are OK.

Comparison:   Automatic method                                       Prm Method
Complexity    Really easy to use.                                    More Complicated to use.
              Just call _Checksum_Check and the return value         The prm file has to be setup, with different things in mind.
              states whether the checksum is correct.                All the addresses of all memory areas have to be duplicated in the C source and
                                                                     int the prm file at 2 places.
Robustness    Good. Nothing (or few things) to configure.            Maybe values have to match.
              Automatic adaptation of the linker for C source file
              changes.
Control       Poor. Only if a segment should be checked and the      Everything is in full user control.
              method can be controlled.
Memory Usage  Needs few more memory because of the control           Needs not one unnecessary byte. As optimal as possible.
              structures.
Exec. Time    For execution time only innermost loop is significant. For execution time only innermost loop is significant.
              Both methods are using the same.                       Both methods are using the same.

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
国产成人精品免费网站| 免费人成黄页网站在线一区二区| 精品欧美黑人一区二区三区| 欧美一级专区免费大片| 久久免费精品国产久精品久久久久| 在线综合视频播放| 久久久久国产精品麻豆| 国产精品久久久久婷婷| 亚洲制服欧美中文字幕中文字幕| 亚洲香蕉伊在人在线观| 亚洲高清在线视频| 久久99日本精品| 91免费视频大全| 在线不卡中文字幕播放| 精品国产免费久久| 亚洲午夜日本在线观看| 开心九九激情九九欧美日韩精美视频电影 | 九色|91porny| 日本高清视频一区二区| 欧美日韩亚州综合| 国产精品久久久久国产精品日日| 亚洲一区二区三区视频在线| 成人动漫视频在线| 日韩三区在线观看| 亚洲va欧美va人人爽午夜| 99re免费视频精品全部| 欧美经典一区二区| 精品一区二区久久| 久久久久青草大香线综合精品| 亚洲国产视频网站| 欧美午夜影院一区| 五月天婷婷综合| 欧美精品日韩一区| 日韩在线一二三区| 日韩亚洲电影在线| 国产最新精品免费| 国产欧美视频在线观看| 成人av在线一区二区| 亚洲视频在线一区二区| 欧美亚男人的天堂| 青青青爽久久午夜综合久久午夜| 3d成人h动漫网站入口| 久久精品理论片| 中文字幕高清一区| 91麻豆免费视频| 日韩成人午夜电影| ww亚洲ww在线观看国产| 欧美一区二区三区四区视频| 国产高清无密码一区二区三区| 国产精品久久看| 欧美挠脚心视频网站| 久久99国产精品成人| 国产精品久久久久影院色老大 | 久久免费国产精品| 91视频在线观看免费| 日韩精品91亚洲二区在线观看| 国产亚洲欧美日韩日本| 在线观看日产精品| 风流少妇一区二区| 视频在线观看91| 久久久久久免费网| 日韩欧美成人激情| 欧美日韩在线精品一区二区三区激情 | 视频一区二区国产| 中文字幕综合网| 国产精品视频一区二区三区不卡| 欧美日韩一区二区在线观看| 成人黄色小视频在线观看| 日韩成人伦理电影在线观看| 亚洲色图欧美偷拍| 久久精品日产第一区二区三区高清版| 在线精品视频一区二区| 99久免费精品视频在线观看 | 欧洲av在线精品| 色综合久久综合| 不卡一区中文字幕| 91在线视频网址| 一本色道久久加勒比精品| 色狠狠av一区二区三区| 99re热视频精品| 在线免费精品视频| 欧美在线免费观看视频| 欧美日本在线观看| 日韩视频免费观看高清完整版在线观看| 欧美午夜一区二区| 日韩欧美国产系列| 久久只精品国产| 国产精品高清亚洲| 综合久久久久久| 亚洲18色成人| 国产成人精品1024| 欧美日本韩国一区二区三区视频| 欧美日韩国产成人在线91| 欧美一区在线视频| 男人的天堂久久精品| 国产精品亚洲综合一区在线观看| 国产精品 日产精品 欧美精品| 成人激情动漫在线观看| 91麻豆精品国产91久久久 | 99精品国产视频| 日韩一区二区三区在线| 久久久久久久综合日本| 亚洲综合免费观看高清完整版在线 | 国产一区二区三区电影在线观看| 99久久精品99国产精品 | 香港成人在线视频| 99精品视频在线观看| 日韩一级片网站| 亚洲欧美日韩精品久久久久| 国产综合久久久久影院| 欧美日韩一区在线观看| 中文字幕在线不卡一区| 国内外成人在线视频| 91国模大尺度私拍在线视频| 久久久久一区二区三区四区| 喷水一区二区三区| 欧美变态凌虐bdsm| 日韩av在线发布| 欧美巨大另类极品videosbest| 一区二区三区四区视频精品免费| 成人免费高清视频| 亚洲国产精品二十页| 国产乱人伦偷精品视频不卡| 日韩欧美亚洲国产另类| 麻豆国产91在线播放| 精品福利在线导航| 国产福利不卡视频| 欧美tk丨vk视频| 国产精品99久久久久久宅男| 国产欧美日韩综合精品一区二区| 国产精品正在播放| 日韩美女视频一区| 91精品国产综合久久久蜜臀粉嫩 | 亚洲免费观看在线观看| 欧美亚洲一区二区三区四区| 亚洲高清三级视频| 精品成人一区二区| 91在线看国产| 免费不卡在线视频| 欧美极品xxx| 91精品国产一区二区三区蜜臀| 久久91精品国产91久久小草| 国产午夜三级一区二区三| 色国产综合视频| 国产成人精品影院| 亚洲大型综合色站| 国产精品蜜臀在线观看| 在线综合视频播放| 波多野结衣一区二区三区| 日本欧美韩国一区三区| 日韩美女久久久| 久久精品人人做人人爽人人| 欧美精品 日韩| 色综合久久中文综合久久97| 国产在线精品免费av| 亚洲成年人网站在线观看| 日本一区免费视频| 一区视频在线播放| 国产区在线观看成人精品 | 久久精品国产澳门| 麻豆久久一区二区| 日本不卡的三区四区五区| 亚洲人成网站精品片在线观看 | 一本久久a久久精品亚洲| 国产999精品久久久久久| 美女网站色91| 韩国三级在线一区| 国产伦精品一区二区三区免费迷| 丝袜美腿亚洲一区二区图片| 日韩av成人高清| 美美哒免费高清在线观看视频一区二区 | 91国在线观看| 欧美艳星brazzers| 777午夜精品视频在线播放| 欧美天天综合网| 91精品国产一区二区三区香蕉| 欧美一卡在线观看| 日韩免费高清视频| 国产情人综合久久777777| 国产日韩欧美一区二区三区乱码| 久久久久久夜精品精品免费| 中文字幕国产一区| 亚洲成人免费观看| 国产毛片一区二区| 在线中文字幕不卡| 欧美一区二区视频网站| 国产日韩精品视频一区| 亚洲婷婷在线视频| 日韩国产欧美在线观看| 国产福利91精品一区| 欧美日韩一区二区在线观看| 久久嫩草精品久久久精品| 亚洲伦在线观看| 日本成人中文字幕| 99久久精品费精品国产一区二区| 欧美精品乱人伦久久久久久| 久久天天做天天爱综合色| 一区二区三区四区精品在线视频| 美女网站色91| 日韩一区二区视频|