Win32


2.


Win32 , , Windows 3.x. startup , / , .

, , .

mylib.asm

Ideal

P586

Radix 16

Model flat

DLL_PROCESS_ATTACH = 1

extrn GetVersion: proc

 

DataSeg

hInst dd 0

OSVer dw 0

 

CodeSeg

proc libEntry stdcall

arg @@hInst :dword, @@rsn :dword, @@rsrv :dword

cmp [@@rsn],DLL_PROCESS_ATTACH

jne @@1

call GetVersion

mov [OSVer],ax

mov eax,[@@hInst]

mov [hInst],eax

@@1: mov eax,1

ret

endP libEntry

 

public stdcall Hex2Str

proc Hex2Str stdcall

arg @@num :dword, @@str :dword

uses ebx

mov eax,[@@num]

mov ebx,[@@str]

mov ecx,7

@@1: mov edx,eax

shr eax,4

and edx,0F

cmp edx,0A

jae @@2

add edx,'0'

jmp @@3

@@2: add edx,'A' - 0A

@@3: mov [byte ebx + ecx],dl

dec ecx

jns @@1

mov [byte ebx + 8],0

ret

endp Hex2Str

 

end libEntry

, , 2.