-if you are not knowledgeable of Assembly then please disregard this.
0x01 start:
0x02 push 0x01
0x03 push 0x19
0x04 cmp [esp], [esp - 0x01]
0x05 je 0x08
0x06 inc [esp - 0x01]
0x07 jmp 0x04
0x08 pop eax
0x09 sub eax, eax
0x0A pop eax
0x0B sub eax, eax
so I push 0x01 onto the stack, which is my i variable, then i push 25 (0x19 in hex) onto the stack which is my limit variable, at this point i am pretty sure that my i var's address would be esp - 0x01, as i pushed the limit above i. then i do a basic cmp between the values at both addresses, then a basic jump if equal to, otherwise inc i, and jump back to 0x04 (the cmp instruction). then i pop limit into eax register, clear out eax, then do the same for the i var. My question for anyone who knows Assembly is whether this code is actually valid or not. I feel like i might have an error around the start label, popping the stack, and the address of i. I would appreciate any help. Then Lua equivalent of my Assembly code is intended to be this:
local i = 1;
local limit = 25;
while (i < limit) do
i = i + 1;
end

1 comment
My lua example could also be represented as: for i = 1, 25 do end