Can someone translate this into Masm? I have a program to send mail messages, Messages are first put into my "Outbox". Then it should check if the computer is online, if so, send. If not, then wait and keep checking. I came across this code. But it is in Tasm style and does not work for me. If anyone could please translate, i'll be thankful! Thank you. -J44
; --- code starts here --- .data localhostname db 256 dup (0) localhostnamelen EQU $-offset(localhostname) .code WaitForConnection: push localhostnamelen ; Check if there's an internet push offset localhostname ; connection : get the local hostname, call gethostname ; do a call to gethostbyname, then or eax, eax ; read out hostent structure to compare jnz WaitForConnection ; IP # with 127.0.0.1 push offset localhostname ; call gethostbyname or eax, eax jz WaitForConnection ; on error : try again @@1: push eax ; read out hostent structure in a clean way mov eax, dword ptr ds: mov ebx, dword ptr ds: pop eax add eax, 4 cmp ebx, 0 jnz @@1 add eax, 4 mov eax, ds: mov eax, ds: mov eax, ds: cmp eax, 0100007Fh ; 127.0.0.1 jnz SendOutGoingMail push 10000d ; 10 sec. Delay call Sleep jmp WaitForConnection ; if IP# = 127.0.0.1 : try again (wait) SendOutGoingMail:[\code]
what is there to convert??? that looks like MASM code to me.