![]() |
Simple asm from x86 to x64
Could you make for me compatible with both 32/64 bits this asm code (now is x86 only), because I'm not familiar with Assembler:?:
Delphi-Quellcode:
procedure ByteToHex(const AValue: Byte; Buffer: PAnsiChar);
asm JMP @@Convert @@HexTable: DB '0123456789ABCDEF'; @@Convert: PUSH ECX // Invalid combination of opcode and operands XOR ECX, ECX MOV CL, AL SHR CL, 4 MOV CL, @@HexTable.Byte[ECX] // Assembler instruction requires a 32bit absolute address fixup which is invalid for 64bit MOV BYTE PTR [EDX], CL MOV CL, AL AND CL, 0Fh MOV CL, @@HexTable.Byte[ECX] // Above error also here MOV BYTE PTR [EDX+1], CL POP ECX end; |
AW: Simple asm from x86 to x64
warum Assembler?
hast Du nicht genug mit Delphi und C++ zu tun ;-) sysutils : IntToHex |
AW: Simple asm from x86 to x64
You could try this code. It is even slightly faster than your assembler code if you activate the compiler's code optimization.
Delphi-Quellcode:
procedure ByteToHex(const AValue: Byte; Buffer: PAnsiChar);
const HexChars: array[0..15] of AnsiChar = '0123456789ABCDEF'; begin Buffer[0] := HexChars[AValue shr 4]; Buffer[1] := HexChars[AValue and $F]; end; |
Re: Simple asm from x86 to x64
This is very old procedure I found in past, it was faster than build-in routines, but if now Delphi can do it better the choice is simple, thanks buddies :)
|
AW: Simple asm from x86 to x64
Du weist aber das du in einem deutschen Forum bist, oder?
|
AW: Simple asm from x86 to x64
Zitat:
|
AW: Simple asm from x86 to x64
Zitat:
|
AW: Simple asm from x86 to x64
Arf j'en français écris ainsi, alors ici aussi ?
|
AW: Simple asm from x86 to x64
Hallöle...:P
Zitat:
Zitat aus dem ersten Beitrag von 2009: Zitat:
Zitat:
|
AW: Simple asm from x86 to x64
Zitat:
|
Alle Zeitangaben in WEZ +1. Es ist jetzt 21:42 Uhr. |
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
LinkBacks Enabled by vBSEO © 2011, Crawlability, Inc.
Delphi-PRAXiS (c) 2002 - 2023 by Daniel R. Wolf, 2024 by Thomas Breitkreuz