Would not the key difference be in where the exit condition is tested? I think the correct terminology is pre-test loop and post-test loop.
dim as integer i
asm while_wend:
while i < 2
i += 1
wend
asm do_while_loop:
do while i < 2
i += 1
loop
asm do_loop_until:
do
i += 1
loop until i = 2
asm for_next:
for i = 0 to 2
next
.intel_syntax noprefix
#test.bas' compilation started at 19:34:39 (FreeBASIC 0.90.1)
.section .text
.balign 16
.globl _main
_main:
push ebp
mov ebp, esp
and esp, 0xFFFFFFF0
sub esp, 8
push ebx
push esi
push edi
mov dword ptr [ebp-4], 0
call ___main
push 0
push dword ptr [ebp+12]
push dword ptr [ebp+8]
call _fb_Init@12
.Lt_0002:
mov dword ptr [ebp-8], 0
while_wend:
.Lt_0004:
cmp dword ptr [ebp-8], 2
jge .Lt_0005
inc dword ptr [ebp-8]
jmp .Lt_0004
.Lt_0005:
do_while_loop:
.Lt_0006:
cmp dword ptr [ebp-8], 2
jge .Lt_0007
inc dword ptr [ebp-8]
jmp .Lt_0006
.Lt_0007:
do_loop_until:
.Lt_0008:
inc dword ptr [ebp-8]
.Lt_000A:
cmp dword ptr [ebp-8], 2
jne .Lt_0008
.Lt_0009:
for_next:
mov dword ptr [ebp-8], 0
.Lt_000E:
.Lt_000C:
inc dword ptr [ebp-8]
.Lt_000B:
cmp dword ptr [ebp-8], 2
jle .Lt_000E
.Lt_000D:
.Lt_0003:
push 0
call _fb_End@4
mov eax, dword ptr [ebp-4]
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret
#test.bas' compilation took 0.0004873414805022236 secs