Hi John,
You are welcome, thanks.
Hi jk,
It would be preferable to give unique and more descriptive names to your labels to avoid conflicts.
Assembling the code with MS Macro Assembler supplied with the Masm32 package :
E:\PellesC\Bin>\masm32\bin\ml.exe /c /coff test.asm
Microsoft (R) Macro Assembler Version 6.14.8444
Copyright (C) Microsoft Corp 1981-1997. All rights reserved.
Assembling: test.asm
Trying to link the object module with Polink :
E:\PellesC\Bin>polink.exe /SUBSYSTEM:WINDOWS test.obj \PellesC\lib\Win\kernel32.lib
POLINK: error: Symbol '__el1' is multiply defined: 'test.obj' and 'test.obj'.
The output of MS Macro Assembler :
_TESTME@0 PROC NEAR
push ebp ; 0000 _ 55
mov ebp, esp ; 0001 _ 8B. EC
add esp, -4 ; 0003 _ 83. C4, FC
push ebx ; 0006 _ 53
push esi ; 0007 _ 56
push edi ; 0008 _ 57
xor eax, eax ; 0009 _ 33. C0
__el1 LABEL NEAR
test eax, eax ; 000B _ 85. C0
jnz ?_002 ; 000D _ 75, 11
lea ebx, [__el1] ; 000F _ 8D. 1D, 00000000(d)
mov dword ptr [ebp-4H], ebx ; 0015 _ 89. 5D, FC
jmp ?_001 ; 0018 _ EB, 00
?_001: add eax, 1 ; 001A _ 83. C0, 01
jmp dword ptr [ebp-4H] ; 001D _ FF. 65, FC
_TESTME@0 ENDP
?_002 LABEL NEAR
pop edi ; 0020 _ 5F
pop esi ; 0021 _ 5E
pop ebx ; 0022 _ 5B
leave ; 0023 _ C9
ret ; 0024 _ C3
_start@0 PROC NEAR
push ebp ; 0025 _ 55
mov ebp, esp ; 0026 _ 8B. EC
add esp, -4 ; 0028 _ 83. C4, FC
push ebx ; 002B _ 53
push esi ; 002C _ 56
push edi ; 002D _ 57
call _TESTME@0 ; 002E _ E8, FFFFFFCD
xor edx, edx ; 0033 _ 33. D2
__el1 LABEL NEAR
test edx, edx ; 0035 _ 85. D2
jnz ?_004 ; 0037 _ 75, 11
lea ebx, [__el1] ; 0039 _ 8D. 1D, 00000000(d)
mov dword ptr [ebp-4H], ebx ; 003F _ 89. 5D, FC
jmp ?_003 ; 0042 _ EB, 00