The last Delphi made ASM embedded process / function format is: procedure procname (...); asm ... End; for this process / function, the entire entire is written by ASM. The embedded ASM has a common usage, that is, in the program part calls ASM: Function ByTohex (src: byte): String; Begin SetLength (Result, 2); ASM MOV EDI, [Result] MOV EDI, [EDI] MOV Al, SRC MOV AH, Al // Save to Ah SHR Al, 4 // Output High 4 Bits Add Al, '0' CMP AL, '9' JBE @@ Outcharlo Add Al, 'A' - '9'-1 @@ Outcharlo: and ah, $ f add Ah, '0' CMP AH, '9' JBE @@ Outchar Add Ah, 'A' - '9'-1 @@ Outchar: Stosw End; End; the subroutine can be implemented One byte of SRC is converted to a 16-way form. Just a friend has such a problem, is it fast enough? :) Of course, the fastest way is not this, want faster? Lala roller, look at:
Use the check form! 512 bytes of table, the fastest speed! :)