Deprecated: mysql_connect(): The mysql extension is deprecated and will be removed in the future: use mysqli or PDO instead in /home/overhertz/domains/codeziron.com/public_html/ziron/ziron.db.connector.php on line 13 code:zIRON - Get the latest releases plus source-codes and tutorials - Simplifed Assembly Programming Language.
Register | Login
Forum Index > Requests and Feedback > for with var parametr
Author Message
Pages: 1
Emil_halim
Ziron Beta Tester

avatar

(send private message)

Posts: 638
Topics: 103

Location:
Alex, Egypt
[712] for with var parametr - posted: 2011-11-16 18:25:56

hi i want for allow this
Code:
   int32 i;
   for(i =0 to indx)
    {
       IntToStr(indx,@tmp);
       edx = @right; eax = i; imul  eax,255; add eax , Edx; 
       H_strjoin(@buf, 'byte ' , @var, '[' , @tmp ,']=' , eax , ';' );
       Ziron_ShowMessage(@buf);
    } 


BTW C++ allow this , declare variable inside 'for' block
Code:
 for(int i=0; i<100; i++)
  {
   } 


http://www.freewebs.com/ogremagic/index.htm
Emil_halim
Ziron Beta Tester

avatar

(send private message)

Posts: 638
Topics: 103

Location:
Alex, Egypt
[713] - posted: 2011-11-16 19:06:06

also i need ziron allows that
Code:
 add eax , @right; // @right is a pointer


http://www.freewebs.com/ogremagic/index.htm
Admin
Site Admin

avatar

(send private message)

Posts: 925
Topics: 54

Location:
OverHertz Studio
[715] - posted: 2011-11-16 21:51:34
i will add it, but i should note that a variable inside a for loop is extremely slow.

a better way would be to use registers as often as possible like so:
Code:
   push edi
   push esi
   esi = indx;
   for(edi = 0 to esi) { //cmp of registers is much faster
       IntToStr(esi,@tmp);
       edx = @right; eax = edi; imul eax,255; add eax, edx; 
       H_strjoin(@buf, 'byte ' , @var, '[' , @tmp ,']=' , eax , ';' );
       Ziron_ShowMessage(@buf);
   } 
   pop esi
   pop edi


Download Ziron
Get free hosting for Ziron related fan-sites and Ziron projects, contact me in private message.
Pages: 1
create new reply


Quick reply:

Message:



Currently Active Users:
There are currently 2 user(s) online. 0 member(s) and 2 guest(s)
Most users ever online was 533, May 5, 2016, 7:19 am.


Statistics:
Threads: 223 | Posts: 1837 | Members: 50 | Active Members: 50
Welcome to our newest member, NobodyAtWork
const Copyright = '2011-2018 © OverHertz Ltd. All rights reserved.';
Web development by OverHertz Ltd