Вверх ↑
Разработчик
Ответов: 26170
Рейтинг: 2127
#1: 2009-05-30 17:54:22 ЛС | профиль | цитата
tomas писал(а):
но медленнее хиасмовского работать вряд-ли будет

Про медленнее никто и не говорил
------------ Дoбавленo в 21.10:
Да, кстати. Вот ассемблерный вариант табличного реверс-алгоритма. Можно попробовать, но я не увидел большого выигрыша по сравнению с нетабличным алгоритмом


Add(InlineCode,7056652,511,602)
{
@Hint=#30:Reverse BYTE (table algorithm)|
WorkPoints=#7:doInput|
EventPoints=#8:onResult|
Code=#15:unit HiAsmUnit;|0:|9:interface|0:|21:uses kol,Share,Debug;|0:|4:type|28: THiAsmClass = class(TDebug)|10: private|0:|9: public|24: onResult:THI_Event;|51: procedure doInput(var Data:TData; Index:word);|5: end;|0:|14:implementation|0:|30:procedure THiAsmClass.doInput;|3:var|17: A, B: Cardinal;|5:begin|29: A := Byte(ToInteger(Data));|3:asm|17: MOV ECX, A|27: LEA EDX, @ReverseTbl|31: MOV EAX, [EDX + ECX * 4]|17: MOV B, EAX|16: JMP @Done|12:@ReverseTbl:|92: DD $00000000, $00000080, $00000040, $000000C0, $00000020, $000000A0, $00000060, $000000E0 |92: DD $00000010, $00000090, $00000050, $000000D0, $00000030, $000000B0, $00000070, $000000F0 |92: DD $00000008, $00000088, $00000048, $000000C8, $00000028, $000000A8, $00000068, $000000E8 |92: DD $00000018, $00000098, $00000058, $000000D8, $00000038, $000000B8, $00000078, $000000F8 |92: DD $00000004, $00000084, $00000044, $000000C4, $00000024, $000000A4, $00000064, $000000E4 |92: DD $00000014, $00000094, $00000054, $000000D4, $00000034, $000000B4, $00000074, $000000F4 |92: DD $0000000C, $0000008C, $0000004C, $000000CC, $0000002C, $000000AC, $0000006C, $000000EC |92: DD $0000001C, $0000009C, $0000005C, $000000DC, $0000003C, $000000BC, $0000007C, $000000FC |92: DD $00000002, $00000082, $00000042, $000000C2, $00000022, $000000A2, $00000062, $000000E2 |92: DD $00000012, $00000092, $00000052, $000000D2, $00000032, $000000B2, $00000072, $000000F2 |92: DD $0000000A, $0000008A, $0000004A, $000000CA, $0000002A, $000000AA, $0000006A, $000000EA |92: DD $0000001A, $0000009A, $0000005A, $000000DA, $0000003A, $000000BA, $0000007A, $000000FA |92: DD $00000006, $00000086, $00000046, $000000C6, $00000026, $000000A6, $00000066, $000000E6 |92: DD $00000016, $00000096, $00000056, $000000D6, $00000036, $000000B6, $00000076, $000000F6 |92: DD $0000000E, $0000008E, $0000004E, $000000CE, $0000002E, $000000AE, $0000006E, $000000EE |92: DD $0000001E, $0000009E, $0000005E, $000000DE, $0000003E, $000000BE, $0000007E, $000000FE |92: DD $00000001, $00000081, $00000041, $000000C1, $00000021, $000000A1, $00000061, $000000E1 |92: DD $00000011, $00000091, $00000051, $000000D1, $00000031, $000000B1, $00000071, $000000F1 |92: DD $00000009, $00000089, $00000049, $000000C9, $00000029, $000000A9, $00000069, $000000E9 |92: DD $00000019, $00000099, $00000059, $000000D9, $00000039, $000000B9, $00000079, $000000F9 |92: DD $00000005, $00000085, $00000045, $000000C5, $00000025, $000000A5, $00000065, $000000E5 |92: DD $00000015, $00000095, $00000055, $000000D5, $00000035, $000000B5, $00000075, $000000F5 |92: DD $0000000D, $0000008D, $0000004D, $000000CD, $0000002D, $000000AD, $0000006D, $000000ED |92: DD $0000001D, $0000009D, $0000005D, $000000DD, $0000003D, $000000BD, $0000007D, $000000FD |92: DD $00000003, $00000083, $00000043, $000000C3, $00000023, $000000A3, $00000063, $000000E3 |92: DD $00000013, $00000093, $00000053, $000000D3, $00000033, $000000B3, $00000073, $000000F3 |92: DD $0000000B, $0000008B, $0000004B, $000000CB, $0000002B, $000000AB, $0000006B, $000000EB |92: DD $0000001B, $0000009B, $0000005B, $000000DB, $0000003B, $000000BB, $0000007B, $000000FB |92: DD $00000007, $00000087, $00000047, $000000C7, $00000027, $000000A7, $00000067, $000000E7 |92: DD $00000017, $00000097, $00000057, $000000D7, $00000037, $000000B7, $00000077, $000000F7 |92: DD $0000000F, $0000008F, $0000004F, $000000CF, $0000002F, $000000AF, $0000006F, $000000EF |92: DD $0000001F, $0000009F, $0000005F, $000000DF, $0000003F, $000000BF, $0000007F, $000000FF |8: @Done:|6:end; |28: _hi_onEvent(onResult, B);|4:end;|0:|4:end.|
}

карма: 22

0