dw2hex.asm
来自「这是一个数字图像处理的matlab仿真程序」· 汇编 代码 · 共 51 行
ASM
51 行
; ########################################################################
;
; This original module was written by f0dder.
;
; Part of the code has been optimised by Alexander Yackubtchik
;
; ########################################################################
.386
.model flat, stdcall
option casemap :none ; case sensitive
.code
; ########################################################################
dw2hex proc source:DWORD, lpBuffer:DWORD
push esi
mov edx, lpBuffer
mov esi, source
xor eax, eax
xor ecx, ecx
mov [edx+8], al ; put terminator at correct length
mov cl, 7 ; length of hexstring - 1
@@:
mov eax, esi ; we're going to work on AL
and al, 00001111b ; mask out high nibble
cmp al,10
sbb al,69h
das
mov [edx + ecx], al ; store the asciihex(AL) in the string
shr esi, 4 ; next nibble
dec ecx ; decrease counter (one byte less than dec cl :-)
jns @B ; eat them if there's any more
pop esi
ret
dw2hex endp
; #########################################################################
end
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?