Вверх ↑
Разработчик
Ответов: 26161
Рейтинг: 2127
#1: 2011-01-19 16:53:28 ЛС | профиль | цитата
AVladM, на, держи. Реализаци твоего CRC8 на HiAsm-e табличным алгоритмом, но начальное значение CRC должно быть не FF, как ты указал, а 00

code_22233.txt
------------ Дoбавленo в 15.44:
Можно сократить на один элемент, если применить целочисленное представление массива


Add(MainForm,9052991,175,203)
{
Width=289
Height=139
Caption="CRC8"
}
Add(StrList,3265764,455,189)
{
Strings=#1:0|2:94|3:188|3:226|2:97|2:63|3:221|3:131|3:194|3:156|3:126|2:32|3:163|3:253|2:31|2:65|3:157|3:195|2:33|3:127|3:252|3:162|2:64|2:30|2:95|1:1|3:227|3:189|2:62|2:96|3:130|3:220|2:35|3:125|3:159|3:193|2:66|2:28|3:254|3:160|3:225|3:191|2:93|1:3|3:128|3:222|2:60|2:98|3:190|3:224|1:2|2:92|3:223|3:129|2:99|2:61|3:124|2:34|3:192|3:158|2:29|2:67|3:161|3:255|2:70|2:24|3:250|3:164|2:39|3:121|3:155|3:197|3:132|3:218|2:56|3:102|3:229|3:187|2:89|1:7|3:219|3:133|3:103|2:57|3:186|3:228|1:6|2:88|2:25|2:71|3:165|3:251|3:120|2:38|3:196|3:154|3:101|2:59|3:217|3:135|1:4|2:90|3:184|3:230|3:167|3:249|2:27|2:69|3:198|3:152|3:122|2:36|3:248|3:166|2:68|2:26|3:153|3:199|2:37|3:123|2:58|3:100|3:134|3:216|2:91|1:5|3:231|3:185|3:140|3:210|2:48|3:110|3:237|3:179|2:81|2:15|2:78|2:16|3:242|3:172|2:47|3:113|3:147|3:205|2:17|2:79|3:173|3:243|3:112|2:46|3:204|3:146|3:211|3:141|3:111|2:49|3:178|3:236|2:14|2:80|3:175|3:241|2:19|2:77|3:206|3:144|3:114|2:44|3:109|2:51|3:209|3:143|2:12|2:82|3:176|3:238|2:50|3:108|3:142|3:208|2:83|2:13|3:239|3:177|3:240|3:174|2:76|2:18|3:145|3:207|2:45|3:115|3:202|3:148|3:118|2:40|3:171|3:245|2:23|2:73|1:8|2:86|3:180|3:234|3:105|2:55|3:213|3:139|2:87|1:9|3:235|3:181|2:54|3:104|3:138|3:212|3:149|3:203|2:41|3:119|3:244|3:170|2:72|2:22|3:233|3:183|2:85|2:11|3:136|3:214|2:52|3:106|2:43|3:117|3:151|3:201|2:74|2:20|3:246|3:168|3:116|2:42|3:200|3:150|2:21|2:75|3:169|3:247|3:182|3:232|2:10|2:84|3:215|3:137|3:107|2:53|
Point(onGetString)
Point(doGetString)
link(onGetString,4905685:doValue,[(499,202)(499,160)(375,160)(375,181)])
}
Add(Edit,3064670,252,203)
{
Left=10
Top=15
Width=250
Text="53 07 17 17 8A FF"
}
Add(Edit,2985955,511,273)
{
Left=10
Top=70
Width=250
Text=""
}
Add(Button,3199795,175,266)
{
Left=110
Top=40
TabOrder=-1
Caption="CRC8"
link(onClick,8145734:doEnum,[])
}
Add(Str_Enum,8145734,252,266)
{
Delimiter=" "
link(onEnum,1470689:doConvert,[(303,272)(303,237)])
link(onEndEnum,2692897:doEvent1,[])
link(String,3064670:Text,[])
}
Add(Memory,4905685,392,175)
{
Default=Integer(0)
}
Add(Convertor,1470689,322,231)
{
Mode=5
link(onResult,6611471:doOperation,[])
}
Add(Math,6611471,392,231)
{
OpType=6
ResultType=0
link(onResult,3265764:doGetString,[])
link(Op1,11129187:Var2,[])
}
Add(Hub,2692897,322,273)
{
link(onEvent1,13928944:doConvert,[])
link(onEvent2,4905685:doClear,[(375,286)(375,188)])
}
Add(GetDataEx,11129187,392,210)
{
link(Data,4905685:Value,[])
}
Add(Convertor,13928944,434,273)
{
Mode=6
link(onResult,2985955:doText,[])
link(Data,11129187:Var3,[(440,215)])
}

------------ Дoбавленo в 16.53:
И в довесок -- на математическом методе расчета CRC8



Add(MainForm,9052991,133,154)
{
Width=289
Height=139
Caption="CRC8"
}
Add(Edit,3064670,182,154)
{
Left=10
Top=15
Width=250
Text="53 07 17 17 8A FF"
}
Add(Edit,2985955,294,217)
{
Left=10
Top=70
Width=250
Text=""
}
Add(Button,3199795,133,217)
{
Left=110
Top=40
TabOrder=-1
Caption="CRC8"
link(onClick,8145734:doEnum,[])
}
Add(Str_Enum,8145734,182,217)
{
Delimiter=" "
link(onEnum,14808049:doCRC8,[])
link(onEndEnum,14808049:doResult,[])
link(String,3064670:Text,[])
}
Add(MultiElementEx,14808049,238,217)
{
link(onResult,2985955:doText,[])
}
BEGIN_SDK
Add(EditMultiEx,1303282,21,21)
{
WorkCount=#6:doCRC8|8:doResult|
EventCount=#8:onResult|0:|
Width=615
Height=326
VOffset=203
link(doCRC8,15999778:doEvent1,[])
link(doResult,14096745:doEvent1,[(35,237)(35,307)])
}
Add(Convertor,1470689,98,49)
{
Mode=5
link(onResult,10977222:doWork2,[])
}
Add(Convertor,13928944,448,301)
{
Mode=6
link(onResult,1303282:onResult,[(606,307)(606,230)])
link(Data,7872028:Var3,[(454,170)])
}
Add(For,4554275,84,231)
{
Start=1
End=8
link(onEvent,16526803:doOperation,[])
}
Add(Memory,2872008,196,119)
{
@Hint=#3:CRC|
Default=Integer(0)
AddHint(45,-22,37,13,@Hint)
}
Add(Memory,3975745,161,49)
{
Default=Integer(0)
}
Add(Math,4844075,217,231)
{
OpType=40
ResultType=0
link(onResult,6415487:doEvent,[])
}
Add(Math,16526803,161,231)
{
OpType=6
ResultType=0
link(onResult,4844075:doOperation,[])
link(Op1,13179297:Var2,[])
link(Op2,2219551:Var1,[(174,170)])
}
Add(IndexToChanel,6415487,273,231)
{
link(onEvent1,12466413:doOperation,[(319,237)(319,195)])
link(onEvent2,14023631:doOperation,[])
}
Add(Math,14023631,329,238)
{
OpType=6
Op2=24
ResultType=0
link(onResult,8093318:doOperation,[])
link(Op1,11229820:Var2,[])
}
Add(GetDataEx,2219551,196,165)
{
link(Data,2872008:Value,[])
}
Add(Math,8093318,378,238)
{
OpType=10
Op2=1
ResultType=0
link(onResult,7338157:doOperation,[])
}
Add(Math,7338157,427,238)
{
OpType=5
Op2=128
ResultType=0
link(onResult,13542433:doEvent1,[])
}
Add(Hub,13542433,476,238)
{
link(onEvent1,5220357:doWork3,[(512,244)])
link(onEvent2,8829076:doWork3,[(536,251)])
}
Add(Math,12466413,378,189)
{
OpType=10
Op2=1
ResultType=0
link(onResult,14250538:doEvent1,[])
link(Op1,7872028:Var2,[])
}
Add(GetDataEx,11229820,329,165)
{
Angle=3
link(Data,2219551:Var3,[])
}
Add(Hub,14250538,476,189)
{
link(onEvent1,5220357:doWork2,[])
link(onEvent2,8829076:doWork2,[])
}
Add(HubEx,5220357,508,189)
{
Angle=3
link(onEvent,2872008:doValue,[(512,97)(184,97)(184,125)])
}
Add(Math,12927633,553,196)
{
OpType=10
Op2=1
ResultType=0
link(onResult,10977222:doWork1,[(597,202)(597,34)(144,34)])
link(Op1,13179297:Var3,[(559,89)])
}
Add(GetDataEx,13179297,161,84)
{
link(Data,3975745:Value,[])
}
Add(HubEx,8829076,532,196)
{
link(onEvent,12927633:doOperation,[])
}
Add(Hub,15999778,49,224)
{
link(onEvent1,1470689:doConvert,[(73,230)(73,55)])
link(onEvent2,4554275:doFor,[])
}
Add(HubEx,10977222,140,49)
{
link(onEvent,3975745:doValue,[])
}
Add(Hub,14096745,49,301)
{
link(onEvent1,13928944:doConvert,[])
link(onEvent2,2872008:doClear,[(143,314)(143,132)])
}
Add(GetDataEx,7872028,378,165)
{
Angle=3
link(Data,11229820:Var3,[])
}
END_SDK


карма: 22

1
файлы: 1code_22233.txt [2.5KB] [184]
Голосовали:kacmem