here is code whhat is wrong, any will be appreciated

; ******************************************************************
;  Convert integer to ASCII/Binary string.
;    Note, no error checking required on integer.

; -----
;  Arguments:
;    1) integer, value
;    2) string, address
; -----
;  Returns:
;    ASCII/Binary string (NULL terminated)

global    cvtIntToASCIIBinary

push    ebp
mov    ebp, esp
push    eax
push    ebx
push    ecx
push    edx
push    esi
push    edi

mov eax,dword[ebp+8] ;get value of the number
mov ebx,dword[ebp+12], get the address of the string
mov ecx,8

mov edx,0
div dword[two]
mov byte[ebx],dl       ;save value 
inc ebx
loop convert

mov byte[ebx],NULL

pop    edi
pop    esi
pop    edx
pop    ecx
pop    ebx
pop    eax
mov    esp, ebp
pop    ebp



In what parts are you comparing the value with "AND"?
Maybe this is a new technique.

this is my new code something wrong
dont know

push    ebp
mov ebp, esp
push    eax
push    ecx
push    edx
push    edi

mov eax, dword[ebp+12]      ; string
mov ebx, dword[ebp+8]       ; integer value
mov ecx,ebx
shl eax,1
and dl,1
adc dl,0

mov byte[edi+(ecx-1)],dl

loop convert
mov dword[edi+8],NULL

pop edi
pop edx
pop ecx
pop eax
pop ebp
Be a part of the DaniWeb community

We're a friendly, industry-focused community of 1.18 million developers, IT pros, digital marketers, and technology enthusiasts learning and sharing knowledge.