Delphi-Quelltext
1: 2: 3: 4: 5: 6: 7: 8: 9: 10: 11: 12: 13: 14: 15: 16: 17: 18: 19: 20:
| function swapbytes(c: cardinal): cardinal; cdecl; asm MOV ECX,DWORD PTR SS:[c] MOV EAX,ECX MOV EDX,ECX SAR EAX,$8 AND EDX,$FF AND EAX,$FF SHL EDX,$8 ADD EAX,EDX MOV EDX,ECX SAR EDX,$10 SHL EAX,$8 AND EDX,$FF ADD EAX,EDX SAR ECX,$18 SHL EAX,$8 AND ECX,$FF ADD EAX,ECX end; |
wiekann ich das in delphi lösen
bytes tauschen bei 4 bytes
aus $12345678 soll $78563412 werden
wenns mit ner assemböer anweisung in weniger zeilen geht oder es nen delphi code gibt plz posten es kann ruhig langsamer sein